Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

introduce Persistent Attribute Type section #554

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions spec/src/main/asciidoc/ch02-entities.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,25 @@ before the entity is made persistent. Once the entity becomes managed
(or detached), subsequent access to the collection must be through the
interface type.

==== Persistent Attribute Type

The enumeration `jakarta.persistence.metamodel.Attribute.PersistentAttributeType`
defines a classification of persistent entity attributes: `BASIC` for
basic attributes, `EMBEDDED` for embedded attributes, `ELEMENT_COLLECTION`
for element collections, and `MANY_TO_ONE`, `ONE_TO_ONE`, `ONE_TO_MANY`,
and `MANY_TO_MANY` for associations of the indicated multiplicity.
Each persistent attribute of an entity belongs to exactly one of the
listed types.

It is an error for an attribute of an entity to be annotated with
mapping annotations indicating conflicting persistent attribute types.
For example, an field may not be annotated `@Basic @Embedded`,
`@ManyToOne @ElementCollection`, or `@OneToOne @ManyToMany`. The
persistence provider must detect such contradictory combinations of
mapping annotations and report the error.footnote:[A persistence
provider is permitted--but not required--to accept the combinations
`@Basic @ElementCollection` and `@Embedded @ElementCollection`.]

==== Property Access

When property access is used, persistent properties of the entity class
Expand Down