- This topic has 4 replies, 2 voices, and was last updated 19 years, 7 months ago by powerware.nl.
-
AuthorPosts
-
powerware.nlMemberEJB Test1
/**
* @ejb.bean name=”Test1″
* display-name=”Test1″
* description=”Test1″
* jndi-name=”ejb/Test1″
* schema=”Test1″
* type=”CMP”
* cmp-version=”2.x”
* view-type=”local”
* primkey-field=”id”
*
* @ejb.value-object name=”Test1″ match=”*”
* @ejb.persistence table-name=”test1″
* @jboss.persistence table-name=”test1″
*
* @ejb.transaction
* type=”required”
*
* @ejb.util
* generate=”physical”
*/
public abstract class Test1 implements EntityBean {/** The entity context */
private EntityContext context;/**
* @ejb.interface-method view-type = “both”
* @ejb.persistence column-name = “fid”
* jdbc-type=”CHAR”
* sql-type=”char(32)”
*
* @ejp.pk-field
*
* @return
*/
public abstract String getId();/**
* @ejb.interface-method view-type = “both”
* @param id
*/
public abstract void setId(String id);/**
* @ejb.interface-method view-type = “both”
* @return
*/
public abstract Test2Local getTest2();/**
* @ejb.interface-method view-type = “both”
* @param test2
*/
public abstract void setTest2(Test2Local test2);EJB test2
/**
* @ejb.bean name=”Test2″
* display-name=”Test2″
* description=”Test2″
* jndi-name=”ejb/Test2″
* schema=”Test2″
* type=”CMP”
* cmp-version=”2.x”
* view-type=”local”
* primkey-field=”id”
*
* @ejb.value-object name=”Test2″ match=”*”
* @ejb.persistence table-name=”test2″
* @jboss.persistence table-name=”test2″
*
* @ejb.transaction
* type=”required”
*
* @ejb.util
* generate=”physical”
*/
public abstract class Test2 implements EntityBean {/** The entity context */
private EntityContext context;/**
* @ejb.interface-method view-type = “both”
* @ejb.persistence column-name = “fid”
* jdbc-type=”CHAR”
* sql-type=”char(32)”
*
* @ejp.pk-field
*
* @return
*/
public abstract String getId();/**
* @ejb.interface-method view-type = “both”
* @param id
*/
public abstract void setId(String id);How do i reference within test1 to test2
In the test1 database table the reference should create foreign keyHow must i declare the xdoclet so that it will generate the correct database table with a foreign key from test1 to test2 the refence in test1 can have a value null
The table where generated, i can create new records, so all is working.
I’m only struggeling with this kind off relationSergio
Do you have a good tutorial about relation with xdoclet and ejb ?
Riyad KallaMemberMoving to OT > Soft Dev
powerware.nlMemberThis item is moved, can you explain the reason ?
I thought i asked an question how to make an 1:0 relation for an ejb
Sergio
Riyad KallaMemberThe forum you originally posted this to is not a general help EJB forum, these forums are for supporting the MyEclipse product. The question you asked is a generic EJB question, it has nothing to do with the IDE You are using, that is why it was moved.
Also when things are moved here for Off Topic, we try and encourage our users to help each other, so I was hoping someone would reply with some suggestions for you.
powerware.nlMemberThank you for your answer.
Does somone has a sample with this realtion setup
by XDocletA sample will do, i can figure it out from the sample.
Sergio
-
AuthorPosts