facebook

EJB Relation Help

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #227782 Reply

    powerware.nl
    Member

    EJB 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 key

    How 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 relation

    Sergio

    Do you have a good tutorial about relation with xdoclet and ejb ?

    #227792 Reply

    Riyad Kalla
    Member

    Moving to OT > Soft Dev

    #227880 Reply

    powerware.nl
    Member

    This 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

    #227890 Reply

    Riyad Kalla
    Member

    The 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.

    #227903 Reply

    powerware.nl
    Member

    Thank you for your answer.

    Does somone has a sample with this realtion setup
    by XDoclet

    A sample will do, i can figure it out from the sample.

    Sergio

Viewing 5 posts - 1 through 5 (of 5 total)
Reply To: EJB Relation Help

You must be logged in to post in the forum log in