-->
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: sequence with annotation and specific class
PostPosted: Wed Nov 29, 2006 10:27 am 
Newbie

Joined: Wed Nov 29, 2006 9:35 am
Posts: 3
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hi

Is it possible to use a specific class for PK-sequence-generation with annotations.

hbm.xml mapping:

Code:
...
<id name="id" type="java.lang.Long" column="foo_id"
   unsaved-value="-100" access="field">
<generator class="org.test.SequenceGenerator">
<param name="sequence">db.seq</param>
</generator>
</id>
...


with annotations [id - getter]

Code:

@Id
@SequenceGenerator(name="SEQ_GEN", sequenceName="org.test.SequenceGenerator)
    public Long getId() {
      return this.id;
    }



or is it just possible with the sequence object in the database?

greez


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.