7 Replies Latest reply on Sep 19, 2002 2:38 PM by Dain Sundstrom

    i cant set relations - can somebody help?

    Fabricio Newbie

      i am using JBoss 3.0.2. I want to know WHEN is the proper time to use the SETxxxx method to relate an entity bean to other entity beans.

      I have, for example, a CMP entity bean, Purchase, that relates to other 2 CMP entity beans, Employee and Company. AFTER executing ejbCreate(), i understand that ejbPostCreate() should be invoked.

      In ejbPostCreate() i did:

      purchase.setEmployee(here goes a LocalEmployee employee)
      purchase.setCompany(here goes a LocalCompany company)

      after running a test case, i go and check in the database. Result: the Purchase record has been created (ejbCreate has been properly executed), but the record has NOT been related to the other entity beans.

      Please help me on this one, i have been able to solve many other problems, but i have been working on this for 3 days now...no ideas yet. thanks in advance.