Regular |
|
Joined: Fri Nov 12, 2004 12:07 am Posts: 57 Location: Beijing,China
|
Hi,
I encountered a oddish problem with hibernate3 today.
It is my first time developing with hibernate3,i always developed with hibernate2.8 in the past months and didn't encountered this problem.The thing is very simple,I have a pojo object as follow:
public final class ExampleModel {
private Long exampleId;
private String name;
public ExampleModel() {
}
public Long getExampleId(){
return exampleId;
}
public void setExampleId(Long exampleId){
this.exampleId=exampleId;
}
public String getName(){
return name;
}
public void setName(String name){
this.name=name;
}
}
and ExampleModel.hbm.xml as follow:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<class name="com.chinaclear.isin.model.example.ExampleModel" table="example_tab">
<id name="exampleId" column="example_id" type="long" unsaved-value="0">
<generator class="sequence">
<param name="sequence">SEQUENCE_ENGINE</param>
</generator>
</id>
<property name="name" column="name" type="string"/>
</class>
</hibernate-mapping>
My db is db2. The error message "org.hibernate.MappingException: could not instantiate id generator" always presents.but with hibernate2.8 all is ok.
What's wrong with my project? Can anybody tell me?
Thanks
Hibernate version:
Hibernate3.0
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
org.hibernate.MappingException: could not instantiate id generator
Name and version of the database you are using:
db2 8.0
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
|
|