I'm trying to debug a
org.hibernate.PropertyAccessException caused via a
java.lang.ClassCastException in the
BasicPropertyAccessor$BasicGetter class
To do this I'm trying to specify my own PropertyAccessor with annotations in Hibernate (4.3.5.Final)
My code is:
Code:
@Id
@Column(name="id", updatable=false, nullable=false)
@Type(type = "mypackage.CustomHibernateIntLongType")
@GeneratedValue(strategy = GenerationType.AUTO)
@AttributeAccessor("mypackage.DiagnosticAccessor")
public Long getId() {
return this.id;
}
public void setId(Long _id) {
this.id = _id;
}
The class
mypackage.DiagnosticAccessor implements
org.hibernate.property.PropertyAccessorHibernate doesn't seem to pay any attention to the
@AttributeAccessor annotation.
I tried putting in a bogus value for the
@AttributeAccessor and it doesn't even complain.
Does anyone have an example of this working, is there some other configuration option that I should be setting?
Any help much appreciated.