File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes primary key class of entity beans? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "primary key class of entity beans?" Watch "primary key class of entity beans?" New topic
Author

primary key class of entity beans?

yamini nadella
Ranch Hand

Joined: Apr 13, 2004
Posts: 257
(1) If entity bean operations are on two tables like employee and department then do we need two primary key classes? each for one table?
is it one primary key class for one table?

(2) is primary key class creation is compulsory for table handling in entity beans? If I am doing creation of entity / record then do I need to put setter methods for all fields of that table in primary key class.

(3) in data discriptor if primary key field is filled then do we need to fill <ejb-ql> with select statement.
what I am assuming is either primary key field or ejb-ql any one can present in DD. is it?

Thanks,
Yamini.
Narasimha Rao B.
Ranch Hand

Joined: Aug 26, 2002
Posts: 205
Hi Yamini,

(1) If entity bean operations are on two tables like employee and department then do we need two primary key classes? each for one table?

There is no requirement that each table needs a separate primary key clss. If your business allows you can have a single primary key class for both the tables.
But the main requirement is, primary class fields should be the subset of cmp fields.

(2) is primary key class creation is compulsory for table handling in entity beans? If I am doing creation of entity / record then do I need to put setter methods for all fields of that table in primary key class.

It is not compulsory to have create separate primary key class, if the primary key field is one of the cmp field, then you don't need separate primary key class.
Requiments are, <prim-key-class> field is must in the deployment descriptor.
If your primary key is compound key means, primary key is combination of two or more cmp fields, then you need a separate primary key class.

(3) in data discriptor if primary key field is filled then do we need to fill <ejb-ql> with select statement.
what I am assuming is either primary key field or ejb-ql any one can present in DD. is it?.


I have not understood you question fully. I don't think so, Is there any relation between <ejb-ql> and primary key field.

Thanks,
[ September 03, 2004: Message edited by: Narasimha Rao B. ]

Narasimha
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: primary key class of entity beans?
 
Similar Threads
URGENT HELP in EJB-QL USING WEBLOGIC 8.1
Ejb using Lomboz plugin for eclipse???
two or more primary keys
entity bean for a table with No Primary key : Please Help,,,, URGENT
CMR configuration confusion