-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: AttributeAccessor annotation example
PostPosted: Thu Jun 19, 2014 5:02 am 
Newbie

Joined: Thu Jun 19, 2014 4:57 am
Posts: 2
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.PropertyAccessor

Hibernate 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.


Top
 Profile  
 
 Post subject: Re: AttributeAccessor annotation example
PostPosted: Tue Jun 24, 2014 8:40 am 
Newbie

Joined: Thu Jun 19, 2014 4:57 am
Posts: 2
In the end I managed to resolve the underlying problem, although not the specific problem posted.

I posted my comments on it here:

http://stackoverflow.com/questions/24301813/hibernate-attributeaccessor-annotation-example


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.