document AccessType as topical guide

This commit is contained in:
Steve Ebersole 2014-03-30 09:45:41 -05:00
parent 887fdf597a
commit 91dd2d6dc0
1 changed files with 1 additions and 16 deletions

View File

@ -1,8 +1,7 @@
= AccessType = AccessType
:toc: :toc:
`AccessType` refers to the JPA notion represented by the `javax.persistence.AccessType` enum. Even though The JPA `javax.persistence.AccessType` enum actually represents 3 related concepts:
AccessType is a single value, it actually represents 3 related concepts:
. Determining which fields/methods constitute a persistent attribute. . Determining which fields/methods constitute a persistent attribute.
. Indicating where to look for mapping annotations for each persistent attribute. . Indicating where to look for mapping annotations for each persistent attribute.
@ -30,20 +29,6 @@ FIELD access means that:
. At runtime we access the persistent attribute's value directly via the field. . At runtime we access the persistent attribute's value directly via the field.
[sidebar]
.Background
--
Hibernate has always had a notion of "property access strategies" to allow users to control the runtime access part.
But, as back in those days there were no annotations and just XML-based mappings, the other 2 were never a concern.
Initially JPA had no such explicit concept, although it did implicitly define runtime access based on placement of
mapping annotations. JPA 2.0 introduced the concept of `javax.persistence.AccessType` to allow better control over
defining where the persistence provider look for mapping annotations and how it access the attribute values at
runtime. JPA allows defining AccessType at a number of "levels".
--
== Implicit (hierarchy) access type == Implicit (hierarchy) access type
The implicit access type for an entity hierarchy defines how access type is defined when there is no explicitly The implicit access type for an entity hierarchy defines how access type is defined when there is no explicitly