[hibernate-dev] Separating javax.persistence.AccessType and org.hibernate.property.PropertyAccessor

Hardy Ferentschik hardy at hibernate.org
Thu Mar 6 05:30:21 EST 2014

On 5 Jan 2014, at 18:40, Steve Ebersole <steve at hibernate.org> wrote:

> Historically annotation binding within Hibernate made a huge assumption
> that AccessType and PropertyAccessor were the same thing.  They aren't
> necessarily.  AccessType is simply meant to dictate where to look for
> annotations relating to "persistent attributes".  PropertyAccessor is
> Hibernate's way of accessing property values (getting/setting) at runtime.
> Granted, AccessType *by default* should indicate the PropertyAccessor to
> use.  I am not arguing that.  I am just suggesting that we should keep both
> as distinct values.  At the moment we collapse them into a single String
> (we dump AccessType and keep "PropertyAccessor name").
> The trouble is that later on we sometimes need to know the AccessType, at
> which point we are forced to make a guess by interpreting the
> PropertyAccessor in use and hoping that a custom PropertyAccessor was not
> supplied.

I don’t know where it is exactly where you need the distinction, but if you do,
I also think they should be kept separated. Also having distinct concepts for this maybe 
makes concepts also a bit clearer. 

+1 from me


More information about the hibernate-dev mailing list