• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

EJB 3.0 - PK Generation with GenerationType

 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 am mighty! And this is a mighty small ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic