JPA_SPEC-115: Adding repeating annotations support

Signed-off-by: Petros Splinakis <petros.splinakis@oracle.com>
Reviewed-by: Lukas Jungmann <lukas.jungmann@oracle.com>
diff --git a/src/javax/persistence/AssociationOverride.java b/src/javax/persistence/AssociationOverride.java
index 47d8b5a..49d93c6 100644
--- a/src/javax/persistence/AssociationOverride.java
+++ b/src/javax/persistence/AssociationOverride.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 - 2014 Oracle Corporation. All rights reserved. 
+ * Copyright (c) 2008 - 2015 Oracle Corporation. All rights reserved. 
  * 
  * This program and the accompanying materials are made available under the 
  * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
@@ -9,12 +9,14 @@
  * http://www.eclipse.org/org/documents/edl-v10.php.
  * 
  * Contributors:
+ *     Petros Splinakis - Java Persistence 2.2
  *     Linda DeMichiel - Java Persistence 2.0 - Version 2.0 (October 1 - 2013)
  *     Specification available from http://jcp.org/en/jsr/detail?id=317
  *
  ******************************************************************************/
 package javax.persistence;
 
+import java.lang.annotation.Repeatable;
 import java.lang.annotation.Target;
 import java.lang.annotation.Retention;
 import static java.lang.annotation.ElementType.TYPE;
@@ -122,6 +124,7 @@
  *
  * @since Java Persistence 1.0 
  */
+@Repeatable(AssociationOverrides.class)
 @Target({TYPE, METHOD, FIELD}) 
 @Retention(RUNTIME)
 
diff --git a/src/javax/persistence/AttributeOverride.java b/src/javax/persistence/AttributeOverride.java
index 83bb91f..512ffe0 100644
--- a/src/javax/persistence/AttributeOverride.java
+++ b/src/javax/persistence/AttributeOverride.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ * Copyright (c) 2008 - 2015 Oracle Corporation. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
@@ -9,12 +9,14 @@
  * http://www.eclipse.org/org/documents/edl-v10.php.
  *
  * Contributors:
+ *     Petros Splinakis - Java Persistence 2.2
  *     Linda DeMichiel - Java Persistence 2.1
  *     Linda DeMichiel - Java Persistence 2.0
  *
  ******************************************************************************/
 package javax.persistence;
 
+import java.lang.annotation.Repeatable;
 import java.lang.annotation.Target;
 import java.lang.annotation.Retention;
 import static java.lang.annotation.ElementType.TYPE;
@@ -117,11 +119,11 @@
  *       Map&#060;Address, PropertyInfo&#062; parcels;
  *    }
  *
- *   &#064;Embeddable public class PropertyInfo {
- *       Integer parcelNumber;
- *       Integer size;
- *       BigDecimal tax;
- *   }
+ *    &#064;Embeddable public class PropertyInfo {
+ *        Integer parcelNumber;
+ *        Integer size;
+ *        BigDecimal tax;
+ *    }
  *
  * </pre>
  *
@@ -132,6 +134,7 @@
  *
  * @since Java Persistence 1.0
  */
+@Repeatable(AttributeOverrides.class)
 @Target({TYPE, METHOD, FIELD}) 
 @Retention(RUNTIME)
 
diff --git a/src/javax/persistence/Convert.java b/src/javax/persistence/Convert.java
index cc150df..58ea697 100644
--- a/src/javax/persistence/Convert.java
+++ b/src/javax/persistence/Convert.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2011 - 2014 Oracle Corporation. All rights reserved.
+ * Copyright (c) 2011 - 2015 Oracle Corporation. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
@@ -9,11 +9,13 @@
  * http://www.eclipse.org/org/documents/edl-v10.php.
  *
  * Contributors:
+ *     Petros Splinakis - Java Persistence 2.2
  *     Linda DeMichiel - Java Persistence 2.1
  *
  ******************************************************************************/
 package javax.persistence;
 
+import java.lang.annotation.Repeatable;
 import java.lang.annotation.Target;
 import java.lang.annotation.Retention;
 import static java.lang.annotation.ElementType.TYPE;
@@ -181,6 +183,7 @@
  *
  *  @since Java Persistence 2.1
  */
+@Repeatable(Converts.class)
 @Target({METHOD, FIELD, TYPE}) @Retention(RUNTIME)
 public @interface Convert {
 
diff --git a/src/javax/persistence/JoinColumn.java b/src/javax/persistence/JoinColumn.java
index 74a2552..fd91f05 100644
--- a/src/javax/persistence/JoinColumn.java
+++ b/src/javax/persistence/JoinColumn.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ * Copyright (c) 2008 - 2015 Oracle Corporation. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
@@ -9,12 +9,14 @@
  * http://www.eclipse.org/org/documents/edl-v10.php.
  *
  * Contributors:
+ *     Petros Splinakis - Java Persistence 2.2
  *     Linda DeMichiel - Java Persistence 2.1
  *     Linda DeMichiel - Java Persistence 2.0
  *
  ******************************************************************************/
 package javax.persistence;
 
+import java.lang.annotation.Repeatable;
 import java.lang.annotation.Target;
 import java.lang.annotation.Retention;
 import static java.lang.annotation.ElementType.FIELD;
@@ -53,6 +55,7 @@
  *
  * @since Java Persistence 1.0
  */
+@Repeatable(JoinColumns.class)
 @Target({METHOD, FIELD})
 @Retention(RUNTIME)
 public @interface JoinColumn {
diff --git a/src/javax/persistence/MapKeyJoinColumn.java b/src/javax/persistence/MapKeyJoinColumn.java
index ca4e62d..45fc1a5 100644
--- a/src/javax/persistence/MapKeyJoinColumn.java
+++ b/src/javax/persistence/MapKeyJoinColumn.java
@@ -1,5 +1,5 @@
 /*******************************************************************************

- * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.

+ * Copyright (c) 2008 - 2015 Oracle Corporation. All rights reserved.
  *

  * This program and the accompanying materials are made available under the

  * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0

@@ -9,12 +9,14 @@
  * http://www.eclipse.org/org/documents/edl-v10.php.

  *

  * Contributors:

+ *     Petros Splinakis - Java Persistence 2.2
  *     Linda DeMichiel - Java Persistence 2.1

  *     Linda DeMichiel - Java Persistence 2.0

  *

  ******************************************************************************/ 

 package javax.persistence;

 

+import java.lang.annotation.Repeatable;
 import java.lang.annotation.Target;

 import java.lang.annotation.Retention;

 import static java.lang.annotation.ElementType.FIELD;

@@ -89,6 +91,7 @@
  *

  * @since Java Persistence 2.0

  */

+@Repeatable(MapKeyJoinColumns.class)
 @Target( { METHOD, FIELD })

 @Retention(RUNTIME)

 public @interface MapKeyJoinColumn {

diff --git a/src/javax/persistence/NamedEntityGraph.java b/src/javax/persistence/NamedEntityGraph.java
index e5f1931..a45a992 100644
--- a/src/javax/persistence/NamedEntityGraph.java
+++ b/src/javax/persistence/NamedEntityGraph.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2011 - 2013 Oracle Corporation. All rights reserved.
+ * Copyright (c) 2011 - 2015 Oracle Corporation. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
@@ -9,12 +9,14 @@
  * http://www.eclipse.org/org/documents/edl-v10.php.
  *
  * Contributors:
+ *     Petros Splinakis - Java Persistence 2.2
  *     Linda DeMichiel - Java Persistence 2.1
  *
  ******************************************************************************/
 
 package javax.persistence;
 
+import java.lang.annotation.Repeatable;
 import java.lang.annotation.Target;
 import java.lang.annotation.Retention;
 import static java.lang.annotation.ElementType.TYPE;
@@ -25,6 +27,7 @@
  *
  * @since Java Persistence 2.1
  */
+@Repeatable(NamedEntityGraphs.class)
 @Target({TYPE})
 @Retention(RUNTIME)
 public @interface NamedEntityGraph {
diff --git a/src/javax/persistence/NamedNativeQuery.java b/src/javax/persistence/NamedNativeQuery.java
index 08c8e83..95a34a8 100644
--- a/src/javax/persistence/NamedNativeQuery.java
+++ b/src/javax/persistence/NamedNativeQuery.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ * Copyright (c) 2008 - 2015 Oracle Corporation. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
@@ -9,12 +9,14 @@
  * http://www.eclipse.org/org/documents/edl-v10.php.
  *
  * Contributors:
+ *     Petros Splinakis - Java Persistence 2.2
  *     Linda DeMichiel - Java Persistence 2.1
  *     Linda DeMichiel - Java Persistence 2.0
  *
  ******************************************************************************/ 
 package javax.persistence;
 
+import java.lang.annotation.Repeatable;
 import java.lang.annotation.Target;
 import java.lang.annotation.Retention;
 import static java.lang.annotation.ElementType.TYPE;
@@ -28,6 +30,7 @@
  *
  * @since Java Persistence 1.0
  */
+@Repeatable(NamedNativeQueries.class)
 @Target({TYPE}) 
 @Retention(RUNTIME)
 public @interface NamedNativeQuery { 
diff --git a/src/javax/persistence/NamedQuery.java b/src/javax/persistence/NamedQuery.java
index 5a7202f..3ea065d 100644
--- a/src/javax/persistence/NamedQuery.java
+++ b/src/javax/persistence/NamedQuery.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ * Copyright (c) 2008 - 2015 Oracle Corporation. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
@@ -9,12 +9,14 @@
  * http://www.eclipse.org/org/documents/edl-v10.php.
  *
  * Contributors:
+ *     Petros Splinakis - Java Persistence 2.2
  *     Linda DeMichiel - Java Persistence 2.1
  *     Linda DeMichiel - Java Persistence 2.0
  *
  ******************************************************************************/ 
 package javax.persistence;
 
+import java.lang.annotation.Repeatable;
 import java.lang.annotation.Target;
 import java.lang.annotation.Retention;
 import static javax.persistence.LockModeType.NONE;
@@ -49,6 +51,7 @@
  *
  * @since Java Persistence 1.0
  */
+@Repeatable(NamedQueries.class)
 @Target({TYPE}) 
 @Retention(RUNTIME)
 public @interface NamedQuery {
diff --git a/src/javax/persistence/NamedStoredProcedureQuery.java b/src/javax/persistence/NamedStoredProcedureQuery.java
index 245521a..8619a88 100644
--- a/src/javax/persistence/NamedStoredProcedureQuery.java
+++ b/src/javax/persistence/NamedStoredProcedureQuery.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2011 - 2013 Oracle Corporation. All rights reserved.
+ * Copyright (c) 2011 - 2015 Oracle Corporation. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
@@ -9,11 +9,13 @@
  * http://www.eclipse.org/org/documents/edl-v10.php.
  *
  * Contributors:
+ *     Petros Splinakis - Java Persistence 2.2
  *     Linda DeMichiel - Java Persistence 2.1
  *
  ******************************************************************************/ 
 package javax.persistence;
 
+import java.lang.annotation.Repeatable;
 import java.lang.annotation.Target;
 import java.lang.annotation.Retention;
 import static java.lang.annotation.ElementType.TYPE;
@@ -66,6 +68,7 @@
  *
  * @since Java Persistence 2.1
  */
+@Repeatable(NamedStoredProcedureQueries.class)
 @Target({TYPE}) 
 @Retention(RUNTIME)
 public @interface NamedStoredProcedureQuery { 
diff --git a/src/javax/persistence/PersistenceContext.java b/src/javax/persistence/PersistenceContext.java
index ed2e240..07455cc 100644
--- a/src/javax/persistence/PersistenceContext.java
+++ b/src/javax/persistence/PersistenceContext.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ * Copyright (c) 2008 - 2015 Oracle Corporation. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
@@ -9,12 +9,14 @@
  * http://www.eclipse.org/org/documents/edl-v10.php.
  *
  * Contributors:
+ *     Petros Splinakis - Java Persistence 2.2
  *     Linda DeMichiel - Java Persistence 2.1
  *     Linda DeMichiel - Java Persistence 2.0
  *
  ******************************************************************************/ 
 package javax.persistence;
 
+import java.lang.annotation.Repeatable;
 import java.lang.annotation.Target;
 import static java.lang.annotation.ElementType.*;
 import java.lang.annotation.Retention;
@@ -27,6 +29,7 @@
  * @since Java Persistence 1.0
  */
 
+@Repeatable(PersistenceContexts.class)
 @Target({TYPE, METHOD, FIELD})
 @Retention(RUNTIME)
 public @interface PersistenceContext {
diff --git a/src/javax/persistence/PersistenceUnit.java b/src/javax/persistence/PersistenceUnit.java
index 5ab73e4..180a61b 100644
--- a/src/javax/persistence/PersistenceUnit.java
+++ b/src/javax/persistence/PersistenceUnit.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ * Copyright (c) 2008 - 2015 Oracle Corporation. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
@@ -9,12 +9,14 @@
  * http://www.eclipse.org/org/documents/edl-v10.php.
  *
  * Contributors:
+ *     Petros Splinakis - Java Persistence 2.2
  *     Linda DeMichiel - Java Persistence 2.1
  *     Linda DeMichiel - Java Persistence 2.0
  *
  ******************************************************************************/ 
 package javax.persistence;
 
+import java.lang.annotation.Repeatable;
 import java.lang.annotation.Target;
 import static java.lang.annotation.ElementType.*;
 import java.lang.annotation.Retention;
@@ -27,6 +29,7 @@
  *
  * @since Java Persistence 1.0
  */
+@Repeatable(PersistenceUnits.class)
 @Target({TYPE, METHOD, FIELD})
 @Retention(RUNTIME)
 public @interface PersistenceUnit {
diff --git a/src/javax/persistence/PrimaryKeyJoinColumn.java b/src/javax/persistence/PrimaryKeyJoinColumn.java
index 5da2697..d0722ea 100644
--- a/src/javax/persistence/PrimaryKeyJoinColumn.java
+++ b/src/javax/persistence/PrimaryKeyJoinColumn.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ * Copyright (c) 2008 - 2015 Oracle Corporation. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
@@ -9,12 +9,14 @@
  * http://www.eclipse.org/org/documents/edl-v10.php.
  *
  * Contributors:
+ *     Petros Splinakis - Java Persistence 2.2
  *     Linda DeMichiel - Java Persistence 2.1
  *     Linda DeMichiel - Java Persistence 2.0
  *
  ******************************************************************************/ 
 package javax.persistence;
 
+import java.lang.annotation.Repeatable;
 import java.lang.annotation.Target;
 import java.lang.annotation.Retention;
 import static java.lang.annotation.ElementType.METHOD;
@@ -65,6 +67,7 @@
  *
  * @since Java Persistence 1.0
  */
+@Repeatable(PrimaryKeyJoinColumns.class)
 @Target({TYPE, METHOD, FIELD})
 @Retention(RUNTIME)
 
diff --git a/src/javax/persistence/SecondaryTable.java b/src/javax/persistence/SecondaryTable.java
index 7ce3ffd..7fe63f1 100644
--- a/src/javax/persistence/SecondaryTable.java
+++ b/src/javax/persistence/SecondaryTable.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 - 2013 Oracle Corporation. All rights reserved.
+ * Copyright (c) 2008 - 2015 Oracle Corporation. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
@@ -9,12 +9,14 @@
  * http://www.eclipse.org/org/documents/edl-v10.php.
  *
  * Contributors:
+ *     Petros Splinakis - Java Persistence 2.2
  *     Linda DeMichiel - Java Persistence 2.1
  *     Linda DeMichiel - Java Persistence 2.0
  *
  ******************************************************************************/ 
 package javax.persistence;
 
+import java.lang.annotation.Repeatable;
 import java.lang.annotation.Target;
 import java.lang.annotation.Retention;
 import static java.lang.annotation.ElementType.TYPE;
@@ -57,6 +59,7 @@
  *
  * @since Java Persistence 1.0
  */
+@Repeatable(SecondaryTables.class)
 @Target(TYPE) 
 @Retention(RUNTIME)
 
diff --git a/src/javax/persistence/SqlResultSetMapping.java b/src/javax/persistence/SqlResultSetMapping.java
index 94d86f7..792692c 100644
--- a/src/javax/persistence/SqlResultSetMapping.java
+++ b/src/javax/persistence/SqlResultSetMapping.java
@@ -1,5 +1,5 @@
 /*******************************************************************************
- * Copyright (c) 2008 - 2014 Oracle Corporation. All rights reserved.
+ * Copyright (c) 2008 - 2015 Oracle Corporation. All rights reserved.
  *
  * This program and the accompanying materials are made available under the
  * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
@@ -9,12 +9,14 @@
  * http://www.eclipse.org/org/documents/edl-v10.php.
  *
  * Contributors:
+ *     Petros Splinakis - Java Persistence 2.2
  *     Linda DeMichiel - Java Persistence 2.1
  *     Linda DeMichiel - Java Persistence 2.0
  *
  ******************************************************************************/ 
 package javax.persistence;
 
+import java.lang.annotation.Repeatable;
 import java.lang.annotation.Target;
 import java.lang.annotation.Retention;
 import static java.lang.annotation.ElementType.TYPE;
@@ -54,6 +56,7 @@
  *
  * @since Java Persistence 1.0
  */
+@Repeatable(SqlResultSetMappings.class)
 @Target({TYPE}) 
 @Retention(RUNTIME)
 public @interface SqlResultSetMapping {