Help coderanch get a
new server
by contributing to the fundraiser
  • 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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

@SequenceGenerator

 
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Probably an obvious question - just reading EJB In Action, p268 - which is discussing the @SequenceGenerator annotation.

As once declared my sequence can be used globally across the persistence unit, my question is where I should put this annotation? i.e. let's say this particular sequence is used in 2 EJB's, which one would I put it in?
If there is no real place, I would be tempted to declare it using the deployment descriptor in this case (assuming you can).

Thanks in advance,

MG
 
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
For @SequenceGenerator holds the same as for queries discussed in link.
 
Mark Garland
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ralph,

Thanks for the link.
The author concludes that orm.xml is the place for these declarations. Is this right?

That makes sense - it's accessible to all Entities - and it describes a mapping between a database sequence and one used in the object model.

Thanks Ralph,

MG
 
reply
    Bookmark Topic Watch Topic
  • New Topic