-->
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.  [ 1 post ] 
Author Message
 Post subject: GeneratedValue for non ID/PK columns
PostPosted: Wed Sep 27, 2006 5:29 am 
Newbie

Joined: Wed Sep 27, 2006 5:18 am
Posts: 1
Hello,

I am wondering if it is possible to use the @GeneratedValue and @GenericGenerator annotations also on non id columns (columns not annotated with @Id)?

I tested it with some classes and it seems, that the generator is only used, when the @Id annotation is set.

Because we don't want to use fields, which are used outside the system as identifiers for data, as primary keys we have an internal primary key, which is already annotated with @Id and generated via a sequence. Additionally there is the mentioned second field which data is communicated to other applications.
This second field is basically also unqiue and should also be generated via a (second) sequence (in fact we like to use a custom generator).

Is there any chance to use the hibernate functionalities also for this column or does we have to implement some own functionality?

Best regards and thanks for help,
Oliver


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

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.