title: hibernate AttributeAccessor annotation example
body: <p>I'm trying to debug a <code>org.hibernate.PropertyAccessException</code> caused via a <code>java.lang.ClassCastException</code> in the <code>BasicPropertyAccessor$BasicGetter</code> class</p>
  
  <p>To do this I'm trying to specify my own PropertyAccessor with annotations in Hibernate (4.3.1.Final)</p>
  
  <p>My code is: </p>
  
  <pre><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;
     }
  </code></pre>
  
  <p>The class <code>mypackage.DiagnosticAccessor</code> implements  org.hibernate.property.PropertyAccessor` </p>
  
  <p>Hibernate doesn't seem to pay any attention to the <code>@AttributeAccessor</code> annotation.  </p>
  
  <p>I tried putting in a bogus value for the <code>@AttributeAccessor</code> and it doesn't even complain.</p>
  
  <p>Does anyone have an example of this working, is there some other configuration option that I should be setting?</p>
  
  <p>Any help much appreciated.</p>