permaculture playing cards*
The moose likes EJB and other Java EE Technologies and the fly likes Auto Increment Problem with JPA and EJB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Auto Increment Problem with JPA and EJB" Watch "Auto Increment Problem with JPA and EJB" New topic
Author

Auto Increment Problem with JPA and EJB

Samson Mlati
Ranch Hand

Joined: Feb 23, 2009
Posts: 41

Hi,

I followed the simple example found here

http://netbeans.org/kb/docs/web/jsf20-crud.html

Created a crud web app and I am hoping to learn how to customize this so I can solve a problem. My main issue with JPA/EJB is that it seems not able to work with auto_increment values, my JSF pages must have the id which should ideally be generated by MySQL.. I have looked at the annotations in the mapping and the id is marked with annotation IDENTITY, i have tried TABLE and AUTO but none of them work. My pages must send the id value. How do I fix this?

Thanks.

Mlati.


Best,
Mlati
 
jQuery in Action, 2nd edition
 
subject: Auto Increment Problem with JPA and EJB
 
Similar Threads
How to implement EJB 2.0 Entity bean for auto increment DB file
Am I persisting a detached Entity?
Putting it together: Struts, Tags, OGNL
How do DB-Auto-Generated Primary Key in EJB 2.0?
are entity beans EJB3?