Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:3
Name and version of the database you are using:SQL server
hi all,
I have one table in SQL data base which has so many columns and one of these columns is comment that type is text. i try to map all columns of that table.
Now my question is how to map comment column which is text type in database. becoz i try to map that column as a string and when i try to call the getter of that property then it throw the exception..
org.hibernate.exception.GenericJDBCException: could not initialize lazy properties: [com.onebeacon.office.ormapping.domain.Pending#3618]
at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:82)
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:70)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.persister.entity.BasicEntityPersister.initializeLazyProperty(BasicEntityPersister.java:719)
at org.hibernate.intercept.FieldInterceptor.intercept(FieldInterceptor.java:60)
at org.hibernate.intercept.FieldInterceptor.readObject(FieldInterceptor.java:113)
at com.onebeacon.office.ormapping.domain.Pending.$cglib_read_Comments(Pending.java)
at com.onebeacon.office.ormapping.domain.Pending.getComments(Pending.java:245)
at com.Test.main(Test.java:63)
Caused by: java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]
Value can not be converted to requested type. at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.base.BaseData.getInteger(Unknown Source)
at com.microsoft.jdbc.base.BaseResultSet.getInt(Unknown Source)
at com.microsoft.jdbc.base.BaseResultSet.getInt(Unknown Source)
at org.hibernate.type.IntegerType.get(IntegerType.java:26)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:77)
at org.hibernate.type.NullableType.nullSafeGet(NullableType.java:68)
at org.hibernate.persister.entity.BasicEntityPersister.initializeLazyProperty(BasicEntityPersister.java:702)
... 5 more
what i put in the type attribute of property tag of hbm file for that column.
so please help me...