S
shaji.cc
Hi hibernate guys,
I am facing a problem with data type problem in hibernate mapping.
Below is a standard example from hibernate.org. It works perfectly
fine.
public class Person {
private Long id;
private int age;
private String firstname;
private String lastname;
Person() {}
// Accessor methods for all properties, private setter for 'id'
}
<hibernate-mapping>
<class name="Person" table="PERSON">
<id name="id" column="PERSON_ID">
<generator class="increment"/>
</id>
<property name="age"/>
<property name="firstname"/>
<property name="lastname"/>
</class>
</hibernate-mapping>
In my case data type of id is int.
In database also it is int. I am using MSSQL server and hibernate3.0
I am getting an exception like
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Value
can not be converted to requested type
Is there any other way?
I am facing a problem with data type problem in hibernate mapping.
Below is a standard example from hibernate.org. It works perfectly
fine.
public class Person {
private Long id;
private int age;
private String firstname;
private String lastname;
Person() {}
// Accessor methods for all properties, private setter for 'id'
}
<hibernate-mapping>
<class name="Person" table="PERSON">
<id name="id" column="PERSON_ID">
<generator class="increment"/>
</id>
<property name="age"/>
<property name="firstname"/>
<property name="lastname"/>
</class>
</hibernate-mapping>
In my case data type of id is int.
In database also it is int. I am using MSSQL server and hibernate3.0
I am getting an exception like
java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Value
can not be converted to requested type
Is there any other way?