jsr338-experts@jpa-spec.java.net

[jsr338-experts] Fwd: [jpa-spec users] JPA_SPEC-115: Add @Repeatable(containerClass.class)

From: Linda DeMichiel <linda.demichiel_at_oracle.com>
Date: Wed, 26 Apr 2017 10:21:17 -0700

Forwarding to former EG list for those of you who may not have seen
this.....


-------- Original Message --------
Subject: [jpa-spec users] JPA_SPEC-115: Add
@Repeatable(containerClass.class)
Date: Wed, 26 Apr 2017 12:02:08 +0200
From: Lukas Jungmann <lukas.jungmann_at_oracle.com>
Reply-To: users_at_jpa-spec.java.net
To: users_at_jpa-spec.java.net



Hi,

    in order to address adoption of @Repeatable in JPA APIs[1] following
is the complete list of changed annotations:

javax.persistence.AssociationOverride
javax.persistence.AttributeOverride
javax.persistence.Convert
javax.persistence.JoinColumn
javax.persistence.MapKeyJoinColumn
javax.persistence.NamedEntityGraph
javax.persistence.NamedNativeQuery
javax.persistence.NamedQuery
javax.persistence.NamedStoredProcedureQuery
javax.persistence.PersistenceContext
javax.persistence.PersistenceUnit
javax.persistence.PrimaryKeyJoinColumn
javax.persistence.SecondaryTable
javax.persistence.SqlResultSetMapping

I believe that this is list is clear, non-controversial since all of
these annotations do have their corresponding container annotation and
therefore this change can be included in JPA 2.2 MR.

Two other candidates for adding @Repeatable are:

javax.persistence.SequenceGenerator
javax.persistence.TableGenerator

as both may be specified either on the entity class or on the primary
key field or property, therefore there might be multiple occurrences
within one class. But in this case there are currently no related
container annotations.

I see too options:

 1. do not change these annotations
 2. add javax.persistence.SequenceGenerators and
    javax.persistence.TableGenerators container annotations and add
    @Repeatable to Sequence/TableGenerator as well

I'd like to propose going with option 2 - or does anyone see why it
should not be done this way?

Thank you,
--lukas

[1]: https://java.net/jira/browse/JPA_SPEC-115