aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes EJB 3.0 - PK Generation with GenerationType Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EJB 3.0 - PK Generation with GenerationType" Watch "EJB 3.0 - PK Generation with GenerationType" New topic
Author

EJB 3.0 - PK Generation with GenerationType

Juarez Alvares Barbosa Junior
Ranch Hand

Joined: Mar 18, 2002
Posts: 80
Hi there,

The types of primary key generation are defined by the GenerationType enum as shown below (from the ejb-3_0-fr-spec-persistence.pdf Final release):

public enum GenerationType { TABLE, SEQUENCE, IDENTITY, AUTO };

But as far as I understood there's no way to use user defined key strategy, i mean, what if I want to generate the keys myself?

Please could someone help me in this regard? Thanks in advance!

BR,

Juarez Jr
Juarez Alvares Barbosa Junior
Ranch Hand

Joined: Mar 18, 2002
Posts: 80
Hi there,

I figured out what the options are for that. Thanks anyway.

I will not use the annotation for generated values at all such as
@GeneratedValue(strategy = GenerationType.AUTO). I will define the keys myself, of course

BR,

Juarez Jr
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EJB 3.0 - PK Generation with GenerationType