-->
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.  [ 4 posts ] 
Author Message
 Post subject: problem using correct JPA annotations
PostPosted: Mon Dec 04, 2006 4:11 am 
Newbie

Joined: Tue Sep 20, 2005 1:52 pm
Posts: 6
Hi all,

I am trying to migrate a small test application running under Glassfish / Toplink to Hibernate EntityManager. The problematic code looks like this (it is running fine under Toplink):

@SequenceGenerator(name="idgenerator", sequenceName="idgenerator", allocationSize=1 ) // BUG in build 48: allocationSize is not avaluated -> The sequence named [idgenerator] is setup incorrectly. Its increment does not match its pre-allocation size.
@MappedSuperclass
public abstract class AbstractEntity implements Serializable, Visitable {
@Id
@Column(name = "SURROGATE", nullable = false)
@GeneratedValue( strategy=GenerationType.SEQUENCE, generator="idgenerator" )
protected int surrogate;


I encounter the follwing Exception during deployment

org.hibernate.AnnotationException: Unknown Id.generator: idgenerator
at org.hibernate.cfg.BinderHelper.makeIdGenerator(BinderHelper.java:392)

The id (here called surrogate) should remain in this abstract superclass. Is there a workaround for this bug ?

Many thanks,
Mike


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 05, 2006 3:38 am 
Newbie

Joined: Tue Sep 20, 2005 1:52 pm
Posts: 6
Obviously it is a bug in Hibernate implementation. I've used the latest Releases for Annotations, EntityManager and Hibernate itself. Is there a fix ?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 05, 2006 5:36 pm 
Newbie

Joined: Tue Dec 05, 2006 2:47 am
Posts: 9
Remove the allocationSize=1? or set the increment to 1? Why do you want the allocationSize=1 in the first place?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 06, 2006 3:42 am 
Newbie

Joined: Tue Sep 20, 2005 1:52 pm
Posts: 6
@hindog: Please ignore the BUG comment - it is a problem of Glassfish Toplink combination !! It has nothing to do with the mapping problem depicted before..


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