Forums Register Login

EJB 3.0 - PK Generation with GenerationType

+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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
There will be plenty of time to discuss your objections when and if you return. The cargo is this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 606 times.
Similar Threads
Difference between id generators
Problem with @GeneratedValue
hibernate_sequence does exists ERROR
Pros & Cons on J2EE Table GenerationTypes
Hibernate id sequence generator error
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 08:07:41.