-->
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.  [ 2 posts ] 
Author Message
 Post subject: Sequence mit Annotations
PostPosted: Wed Nov 29, 2006 9:47 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

Hallo zusammen

Gibt es eine Möglichkeit eine eigene Klasse die für die Erzeugung einer Sequence mit Hilfe von Annotations zu nutzen?

Mit Beispielen lässt sich das besser veranschaulichen:

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>
...


mit annotations [getter für id]

Code:

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



oder ists nur mit dem sequence-objekt in der datenbank möglich

lg


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 05, 2006 4:06 am 
Expert
Expert

Joined: Tue Nov 23, 2004 7:00 pm
Posts: 570
Location: mostly Frankfurt Germany
google: http://www.devx.com/Java/Article/30396/0/page/3

_________________
Best Regards
Sebastian
---
Training for Hibernate and Java Persistence
Tutorials for Hibernate, Spring, EJB, JSF...
eBook: Hibernate 3 - DeveloperGuide
Paper book: Hibernate 3 - Das Praxisbuch
http://www.laliluna.de


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.