Hibernate - PropertyNotFoundException: Could not find a getter for ...

Posted by Ben Noland on Stack Overflow See other posts from Stack Overflow or by Ben Noland
Published on 2009-05-28T14:50:04Z Indexed on 2010/04/04 15:43 UTC
Read the original article Hit count: 405

Filed under:
|

I have a class that looks like the following:

public class MyClass {
    private String dPart1;

    public String getDPart1() {
    	return dPart1;
    }

    public void setDPart1(String dPart1) {
    	this.dPart1 = dPart1;
    }
}

My hibernate mapping file maps the property as follows:

<property name="dPart1" not-null="true"/>

I get the following error:

org.hibernate.PropertyNotFoundException: Could not find a getter for dPart1 in class com.mypackage.MyClass
        at org.hibernate.property.BasicPropertyAccessor.createGetter(BasicPropertyAccessor.java:282)
        at org.hibernate.property.BasicPropertyAccessor.getGetter(BasicPropertyAccessor.java:275)
        at org.hibernate.mapping.Property.getGetter(Property.java:272)
        at org.hibernate.tuple.entity.PojoEntityTuplizer.buildPropertyGetter(PojoEntityTuplizer.java:247)
        at org.hibernate.tuple.entity.AbstractEntityTuplizer.<init>(AbstractEntityTuplizer.java:125)
        at org.hibernate.tuple.entity.PojoEntityTuplizer.<init>(PojoEntityTuplizer.java:55)
        at org.hibernate.tuple.entity.EntityEntityModeToTuplizerMapping.<init>(EntityEntityModeToTuplizerMapping.java:56)
        at org.hibernate.tuple.entity.EntityMetamodel.<init>(EntityMetamodel.java:302)
        at org.hibernate.persister.entity.AbstractEntityPersister.<init>(AbstractEntityPersister.java:434)
        at

It appears that hibernate doesn't like my capitalization. How should I fix this?

© Stack Overflow or respective owner

Related posts about java

Related posts about hibernate