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