-->
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: Extending org.hibernate.id.IdentityGenerator
PostPosted: Tue Feb 07, 2012 5:55 am 
Newbie

Joined: Fri Aug 12, 2011 1:20 pm
Posts: 5
Hi there!

I'm using Hibernate 3.6.7.Final with MySQL/HSQLDB
I've tried to extend org.hibernate.id.IdentityGenerator.

Simple class:

Code:
public class Generator extends org.hibernate.id.IdentityGenerator
{
}


Used in mapping:

Code:
<generator class="sample.Generator"  ></generator>


Causes that:
1. ID field doesn't get auto_increment attribute (in MySQL).
2. Due to (1) attempt to save entity causes Exception due to: "Field 'IDaccount' doesn't have a default value".

What am I doing wrong?
Is there any other solution saving entity with assigned id if it is set on entity or generated id if entity has no identifier.

Thanks in advance.

Best regards,
rafi


Top
 Profile  
 
 Post subject: Re: Extending org.hibernate.id.IdentityGenerator
PostPosted: Fri Feb 10, 2012 6:44 pm 
Newbie

Joined: Fri Aug 12, 2011 1:20 pm
Posts: 5
It seems to be a bug. I've filed it here:
https://hibernate.onjira.com/browse/HHH-7053


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.