Hi,

Suppose I have 3 EntityBeans BankBean, PersonBean and AccountBean

AccountBean has a reference to a BankBean and to a PersonBean.

How should I do this?

make fields like this:

public Bank bank;
public Person person;

or like this:

public BankPK bankPK;
public PersonPK personPK;

...

Is there a difference if I make the beans CMP or BMP ? In case of BMP, I
have more control over how the object-relational mapping occurs, so I have 

I am a first-time EJB user, so if these questions seem to stupid, sorry
...

When I deploy the AccountBean using the first option, I get deployment
exceptions telling me that the server can't find class definitions for
Bank and Person. However both Bank and Person have been deployed
successfully and tested.

This seems to be an often recurring pattern, entity beans referring to
other entitybeans as part of their data definition. It would map on
foreign keys in relational databases. I would feel bad about using the
primary key data of PersonBean and BankBean in AccountBean since that
would make AccountBean highly dependant on fields in those beans. 

Ideally, I would just have to use a reference, the server would see 
that it is an entitybean reference and transparantly store primary 
key information instead of the reference.

Is there a document describing this pattern, in particular while using the
JBoss EJB server (since deployment descriptor files like ejb-jar.xml and
jboss.xml are central here, at least I think they are).

-- 
Bavo De Ridder
Project Manager
VA Linux Belgium / Life
Interleuvenlaan 15A
3001 Haasrode, Belgium
phone: +32 16 20 89 61
fax: +32 16 20 79 73  



--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to