Discussions

EJB design: EJB Relationship questions

  1. EJB Relationship questions (1 messages)

    Hi there! I have a few questions related to this topic, wish you guys could help me:

    1st - I can't remember, do the entities used in a relation must lie in the same jar? Or could they be distributed in diffent jars in a unique ear?

    2nd - In a relationship, when adding a parent and a child, don't the CMP engine adds the child automatic for me? Do I need to transverse the Collection and call childhome.create() for each child of a given parent?

    3rd - kinda related to the question above. I know that deletes can be "cascaded" what about updates? Do I need to transverse the Collection either or in this case it's a different scenario?

    Thanks all

    Vinicius Carvalho
  2. do the entities used in a relation must lie in the same jar?
    Yes


    >2nd - In a relationship, when adding a parent and a child, don't the CMP engine adds the child automatic for me?
    No. you will have to call childhome.create()


    >I know that deletes can be "cascaded" what about updates?
    Not sure I have understand the question. An update on a parent can't be cascaded to the children since after all they are different records in different tables.