Hibernate JPA @AttributeAccessor annotation Example

@AttributeAccessor

The @AttributeAccessor annotation is used to specify a custom PropertyAccessStrategy.
Should only be used to name a custom PropertyAccessStrategy. For property/field access type, the JPA @Access annotation should be preferred.

However, if this annotation is used with either value="property" or value="field", it will act just as the corresponding usage of the JPA @Access annotation.

AttributeAccessor Names a persistent property access strategy (PropertyAccessStrategy) to use. Can be specified at either:
TYPE level, which will act as naming the default accessor strategy for all attributes on the class which do not explicitly name an accessor strategy
METHOD/FIELD level, which will be in effect for just that attribute.
Should only be used to name custom PropertyAccessStrategy. For property/field access, the JPA Access annotation should be preferred using the appropriate AccessType. However, if this annotation is used with either value="property" or value="field", it will act just as the corresponding usage of Access.

Comments

Popular posts from this blog

Today Walkin 14th-Sept

Hibernate Search - Elasticsearch with JSON manipulation

Spring Elasticsearch Operations