Hello,
here comes a short receipe for reproducing.
What happens to me is the exception: PropertyNotFoundException
in one of our databasetables are Columns with names like
a_col
b_bol
...
A reverse engeneering tool generated the coresponding hbm.xml(see below)and the Java Class:
Code:
public class Foo {
private Integer id;
private java.lang.String aCol;
private java.lang.Short bCol;
public java.lang.String getACol(){ return this.aCol;}
public java.lang.Short getBCol(){ return this.bCol;}
//[..rest of class omitted]
}
After getting the exception i renamed aCol consistently to anCol.
After that i get a PropertyNotFoundException for bCol
What is happening here?
The workaround is clear: I renamed all my properties
Ciao,
Hibernate version: 3.0
Mapping documents:Code:
<hibernate-mapping package="de.bafz.lims.model">
<class name="Foo" table="foo" mutable="false">
<id name="id" type="integer">
<generator class="assigned"/>
</id>
<property name="aCol" column="A_COL" type="java.lang.String" not-null="true" />
<property name="bCol" column="B_COL" type="java.lang.Short" />
</class>
</hibernate-mapping>
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
[code]
16:30:46,796 INFO SessionFactoryImpl: building session factory
16:30:46,796 DEBUG SessionFactoryImpl: Session factory constructed with filter configurations : {}
16:30:46,796 DEBUG SessionFactoryImpl: instantiating session factory with properties: [...]
16:30:47,921 ERROR HibernateUtil: Building SessionFactory failed.
org.hibernate.PropertyNotFoundException: Could not find a setter for property aCol in class de.bafz.lims.model.Foo