good morning for all!
sorry, but my english is not very well (if anybody knows portuguese of brazil tell me! :) )
hibernate 2.1.3
sqlserver
im having a litle problem when i make session.load with hibernate
Code:
net.sf.hibernate.PropertyAccessException: exception setting property value with CGLIB (set hibernate.cglib.use_reflection_optimizer=false for more info) setter of Produto.setDesc
at net.sf.hibernate.persister.AbstractEntityPersister.setPropertyValues(AbstractEntityPersister.java:212)
at net.sf.hibernate.impl.SessionImpl.initializeEntity(SessionImpl.java:2199)
at net.sf.hibernate.loader.Loader.doQuery(Loader.java:240)
at net.sf.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:133)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:836)
at net.sf.hibernate.loader.Loader.loadEntity(Loader.java:856)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:59)
at net.sf.hibernate.loader.EntityLoader.load(EntityLoader.java:51)
at net.sf.hibernate.persister.EntityPersister.load(EntityPersister.java:419)
at net.sf.hibernate.impl.SessionImpl.doLoad(SessionImpl.java:2106)
at net.sf.hibernate.impl.SessionImpl.doLoadByClass(SessionImpl.java:1980)
at net.sf.hibernate.impl.SessionImpl.load(SessionImpl.java:1909)
this my class Produto
Code:
public class Produto {
private int ID;
private String desc;
private double preco;
Produto(){
//default is empty
}
public void setDesc(String desc){
this.desc = desc;
}
public String getDesc(){
return desc;
}
//sets and gets....
the hbm.xml....
Code:
<property name="desc" column="DESCRICAO" type="char"/>
<!-- i try put char(50), this is the size of my table, but dont accept too..
-->
the insert its ok! the problem is when i try take the object form the db
thanks!