• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

@SequenceGenerator

 
Mark Garland
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
  • 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
 
Ralph Jaus
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • 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
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic