This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes How to use generators in Composite-id Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "How to use generators in Composite-id" Watch "How to use generators in Composite-id" New topic
Author

How to use generators in Composite-id

Venkat dasari
Ranch Hand

Joined: Nov 12, 2003
Posts: 67
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


Regards,<br />Venkat Dasari<br />SCJP 1.4, SCBCD.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

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?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to use generators in Composite-id