-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Generator with property tag or composite-id tag
PostPosted: Sun Jul 18, 2004 3:24 am 
Newbie

Joined: Sun Jul 18, 2004 3:16 am
Posts: 1
Is it possible to use a generator (increment) outside the id element? Can in be used with a <composite-id> or <property> element?

Steve


Top
 Profile  
 
 Post subject: Re: Generator with property tag or composite-id tag
PostPosted: Sun Jul 18, 2004 10:53 am 
Senior
Senior

Joined: Sat Jul 17, 2004 5:16 pm
Posts: 143
Have you checked the DTD?

http://hibernate.sourceforge.net/hibern ... ng-2.0.dtd

Looks like the answer is no if you are only talking about mapping. Since you are allowed to put custom SQL in queries you might be able to reference a sequence or at least do a stored procedure where you can do some of this one-off logic. Chris

ps. If you are using a generator, which is unique, then why do you need it in a composite key or parameter? Just make that the ID for hibernate, even though you might use it in a composite key in the DB...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 05, 2004 11:31 am 
Regular
Regular

Joined: Sat Oct 18, 2003 11:53 am
Posts: 55
I have a generic question about this also. I have a table that not only generates a ID, but it has to generate a Tracking Number also (just an incremented number). Is there a pattern that someone can recommend?

Matt


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.