I have a class that looks like the following:
public class MyClass {
private String dPart1;
public String getDPart1() {
return dPart1;
}
The naming convention of the property matters example in my own case I initially used
private String newimsi, getNewImsi();
the above failed with same exception
propertynotfoundexception
until I corrected to below before it worked
getNewimsi();
<property name="DPart1" not-null="true"/>
should work...
Can't you just access it like a field?
access="field"
I got the solution
Please make dPart1 to dpart1 and change the getter and setter again..
It is working for me now.
Remember to change the xml also.
From what I've seen, Hibernate (at least version 3.2.4) will expect a property like dPart to have a getter named getdPart: d stays lowercase. Look at dfa's answer as well - I am guessing that other versions might expect getDpart instead.
private String rptausu;
public String getRptausu() {
return rptausu;
}
public void setRptausu(String rpta) {
rptausu = rpta;
}
mapping:
<property name="prtausu" />
works correctly