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 and other Java EE Technologies and the fly likes Primary Key Class in CMP & BMP Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Reply Bookmark "Primary Key Class in CMP & BMP" Watch "Primary Key Class in CMP & BMP" New topic
Author

Primary Key Class in CMP & BMP

Shrinivas Mujumdar
Ranch Hand

Joined: Aug 27, 2004
Posts: 328
Hello
1> What is the use of Primary Key Class in CMP or BMP?

2> It is observed from my side that If Primary Key is a single field Primary Key then without putting a ".class" of primary key class in jar also EJB works fine.but for composite primary key i desperately required it?

Can anybody focus more on this?

Thanks in Advance

Shrinivas
Sebastian Hennebrueder
Ranch Hand

Joined: Sep 09, 2004
Posts: 49
When I use a single field as primary key, I do not use a Primary key class.

As you stated, with a complex primary key (more than one field) you must use a primary key class.

You may alway use a primary key because
- design purpose (consistent use of pk classes or wanting to seperate primary key and fields used for primary key)
- auto - increment for some EJB containers when you want to use unknown pk

Regards Sebastian


Things get always more complicated as expected.<br />Author of eBook Hibernate 3 Developer Guide by example<br />Tutorials about Hibernate, EJB, Struts, JSF <a href="http://www.laliluna.de" target="_blank" rel="nofollow">www.laliluna.de</a>
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Primary Key Class in CMP & BMP
 
Similar Threads
Primary Key Class
is it legal?
ejbCreate() in Entity bean returns null
ejbCreate()
Need confirmation for single primary key class