I have a hibernate mapping which was working until recently – and while I’m sure this is the result of some change I’ve made, I can’t seem to find it.
The mapping file defines a field as:
<id name="id" column="id">
<generator class="native" />
</id>
The class defines this field as:
private Long id;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
When I run this code, I get the following error:
org.hibernate.PropertyAccessException:
IllegalArgumentException occurred while calling setter of MyClass.id
The database field to which this corresponds is defined as:
`id` bigint(20) NOT NULL AUTO_INCREMENT PRIMARY KEY
I have several other classes with similar structures and definitions, and have no issues with them. However, likely resulting from some recent change I made, this one particular mapping will no longer work properly.
Any suggestions?
I am not sure but you can try this :
Hibernate may be setting wrong value.