• 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
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

How to use generators in Composite-id

 
Ranch Hand
Posts: 67
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
My problem is.... I have a composite key out of which one is a sequence generator.How to declare this in my mapping file. let me give an example...

In a normal table with one primary key Id declaration in the mapping file will suffice as a primary key declaration. And a generator tag will make it more easier for auto generation of values.

Now if the table has a composite-key. One of the key attribute must be from a sequence generator. How to describe this in a mapping file..

Please do inform me about this...


thanks in advance,
Venkat Dasari
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Why are you using a sequence as part of a composite-id? Your sequence will be generating unique values so why not just use that?
 
reply
    Bookmark Topic Watch Topic
  • New Topic