diff --git a/spec/src/main/asciidoc/appendixes.adoc b/spec/src/main/asciidoc/appendixes.adoc index a20ca369..9207fe3e 100644 --- a/spec/src/main/asciidoc/appendixes.adoc +++ b/spec/src/main/asciidoc/appendixes.adoc @@ -124,4 +124,8 @@ Added _concat()_ overload accepting list of expressions to _CriteriaBuilder_ Made the _name_ member of _TableGenerator_ and _SequenceGenerator_ optional -Pulled _getParameters()_ up from _CriteriaQuery_ to _CommonAbstractCriteria_ \ No newline at end of file +Entity and embeddable classes may now be static inner classes + +Primary key classes are no longer required to be public and serializable + +Pulled _getParameters()_ up from _CriteriaQuery_ to _CommonAbstractCriteria_ diff --git a/spec/src/main/asciidoc/ch02-entities.adoc b/spec/src/main/asciidoc/ch02-entities.adoc index ed62709e..928576de 100644 --- a/spec/src/main/asciidoc/ch02-entities.adoc +++ b/spec/src/main/asciidoc/ch02-entities.adoc @@ -23,7 +23,7 @@ The entity class must have a no-arg constructor. The entity class may have other constructors as well. The no-arg constructor must be public or protected. -The entity class must be a top-level class. +The entity class must be a top-level class or a static inner class. An enum, record, or interface may not be designated as an entity. The entity class must not be final. No @@ -416,10 +416,10 @@ property, the temporal type should be specified as _DATE_. The following rules apply for composite primary keys: -- The primary key class may be a regular Java class, in which case it must -be public and must have a public no-arg constructor. Alternatively, it may -be a public Java record type, in which case it need not have a no-arg -constructor. +- The primary key class may be a non-abstract regular Java class with a +no-arg constructor. The no-arg constructor must be public or protected. +Alternatively, the primary key class may be any Java record type, in +which case it need not have a no-arg constructor. - The access type (field- or property-based access) of a primary key class is determined by the access type of the @@ -429,8 +429,6 @@ embedded id and a different access type is specified. See Section <>. - If property-based access is used, the properties of the primary key class must be public or protected. -- The primary key class must be serializable. - - The primary key class must define _equals_ and _hashCode_ methods. The semantics of value equality for these methods must be consistent with the database equality for the database @@ -1140,7 +1138,8 @@ for an embedded object is determined as described in <>. An embeddable class may be a regular Java class which adheres to the requirements specified in <> for entities, with the exception that -an embeddable class is not annotated as _Entity_. +an embeddable class is not annotated as _Entity_, and an embeddable +class may not be abstract. Alternatively, an embeddable class may be any Java record type.