title: "PropertyAccessException: could not set a field value by reflection setter" With Hibernate 4
body: <p>In the past I've used a java.util.Calendar with Hibernate 3 (from J-boss 5.1) and @Temporal annotation. After moving to Hibernate 4 (j-boss 7.1) I've run into this PropertyAccessException when trying a UserType instead.</p>
  
  <p>My UT is really just a wrapper around org.hibernate.type.StringType since I'm just forcing the Calendar into a String and back to cope with relative time-stamps: SQL Timestamp Without Time Zone.</p>
  
  <pre>
  Caused by: javax.persistence.PersistenceException: org.hibernate.PropertyAccessException: could not set a field value by reflection setter of [my-class]
      at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1361) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
      at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1289) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
      at org.hibernate.ejb.QueryImpl.getSingleResult(QueryImpl.java:313) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
  ...
  </pre>
  
  <p>Any ideas how I can fix this exception?</p>
  
  <p>EDIT: For the time being I've worked around it by dropping the UserType in favor of making the time-stamp a String, parsing, and formatting it within the setters and getters. I'd prefer to use the UserType or some cleaner solution if anyone knows of any.</p>