-->
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: hibernate-mapping id type / autoincrement
PostPosted: Thu Jul 08, 2004 11:34 pm 
Newbie

Joined: Thu Jul 08, 2004 11:20 pm
Posts: 6
Hello,
I have in my hbm.xml the following, for when I persist an object, the primary key column auto increments.

<id name="id" type="integer" unsaved-value="null" >
<column name="id" sql-type="integer" not-null="true"/>
<generator class="uuid.hex"/>
</id>

it is throwing an error when executed:

13:25:50,484 ERROR [Configuration] Could not compile the mapping document
net.sf.hibernate.MappingException: Problem trying to set property type by reflection
at net.sf.hibernate.mapping.SimpleValue.setTypeByReflection(SimpleValue.java:183)
at net.sf.hibernate.cfg.Binder.createProperty(Binder.java:1057)
at net.sf.hibernate.cfg.Binder.propertiesFromXML(Binder.java:1050)


how do I define an autoincremented integer in my mapping XML?

thanks and regards

Paul.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 09, 2004 4:51 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
use generator class="native" and read the docs.


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.