Index: 3rdParty_sources/persistence-api/javax/persistence/Access.java =================================================================== diff -u --- 3rdParty_sources/persistence-api/javax/persistence/Access.java (revision 0) +++ 3rdParty_sources/persistence-api/javax/persistence/Access.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b) @@ -0,0 +1,41 @@ +/******************************************************************************* + * Copyright (c) 2008 - 2013 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 + * which accompanies this distribution. + * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html + * and the Eclipse Distribution License is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + * + * Contributors: + * Linda DeMichiel - Java Persistence 2.1 + * Linda DeMichiel - Java Persistence 2.0 + * + ******************************************************************************/ +package javax.persistence; + +import static java.lang.annotation.ElementType.FIELD; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.TYPE; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +/** + * Used to specify an access type to be applied to an entity class, + * mapped superclass, or embeddable class, or to a specific attribute + * of such a class. + * + * @since Java Persistence 2.0 + */ +@Target( { TYPE, METHOD, FIELD }) +@Retention(RUNTIME) +public @interface Access { + + /** + * (Required) Specification of field- or property-based access. + */ + AccessType value(); +} Index: 3rdParty_sources/persistence-api/javax/persistence/AccessType.java =================================================================== diff -u --- 3rdParty_sources/persistence-api/javax/persistence/AccessType.java (revision 0) +++ 3rdParty_sources/persistence-api/javax/persistence/AccessType.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b) @@ -0,0 +1,34 @@ +/******************************************************************************* + * Copyright (c) 2008 - 2013 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 + * which accompanies this distribution. + * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html + * and the Eclipse Distribution License is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + * + * Contributors: + * Linda DeMichiel - Java Persistence 2.1 + * Linda DeMichiel - Java Persistence 2.0 + * + ******************************************************************************/ +package javax.persistence; + +/** + * Used with the {@link Access} annotation to specify an access + * type to be applied to an entity class, mapped superclass, or + * embeddable class, or to a specific attribute of such a class. + * + * @see Access + * + * @since Java Persistence 2.0 + */ +public enum AccessType { + + /** Field-based access is used. */ + FIELD, + + /** Property-based access is used. */ + PROPERTY +} Index: 3rdParty_sources/persistence-api/javax/persistence/AssociationOverride.java =================================================================== diff -u --- 3rdParty_sources/persistence-api/javax/persistence/AssociationOverride.java (revision 0) +++ 3rdParty_sources/persistence-api/javax/persistence/AssociationOverride.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b) @@ -0,0 +1,176 @@ +/******************************************************************************* + * 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 + * which accompanies this distribution. + * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html + * and the Eclipse Distribution License is available at + * 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; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.FIELD; +import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static javax.persistence.ConstraintMode.PROVIDER_DEFAULT; + +/** + * Used to override a mapping for an entity relationship. + * + *
May be applied to an entity that extends a mapped superclass to
+ * override a relationship mapping defined by the mapped
+ * superclass. If not specified, the association is mapped the same as
+ * in the original mapping. When used to override a mapping defined by
+ * a mapped superclass, AssociationOverride
is applied to
+ * the entity class.
+ *
+ *
May be used to override a relationship mapping from an
+ * embeddable within an entity to another entity when the embeddable
+ * is on the owning side of the relationship. When used to override a
+ * relationship mapping defined by an embeddable class (including an
+ * embeddable class embedded within another embeddable class),
+ * AssociationOverride
is applied to the field or
+ * property containing the embeddable.
+ *
+ *
When AssociationOverride
is used to override a
+ * relationship mapping from an embeddable class, the
+ * name
element specifies the referencing relationship
+ * field or property within the embeddable class. To override mappings
+ * at multiple levels of embedding, a dot (".") notation syntax must
+ * be used in the name
element to indicate an attribute
+ * within an embedded attribute. The value of each identifier used
+ * with the dot notation is the name of the respective embedded field
+ * or property.
+ *
+ *
When AssociationOverride
is applied to override
+ * the mappings of an embeddable class used as a map value,
+ * "value.
" must be used to prefix the name of the
+ * attribute within the embeddable class that is being overridden in
+ * order to specify it as part of the map value.
+ *
+ *
If the relationship mapping is a foreign key mapping, the
+ * joinColumns
element is used. If the relationship
+ * mapping uses a join table, the joinTable
element must
+ * be specified to override the mapping of the join table and/or its
+ * join columns.
+ *
+ *
+ * Example 1: Overriding the mapping of a relationship defined by a mapped superclass + * + * @MappedSuperclass + * public class Employee { + * ... + * @ManyToOne + * protected Address address; + * ... + * } + * + * @Entity + * @AssociationOverride(name="address", + * joinColumns=@JoinColumn(name="ADDR_ID")) + * // address field mapping overridden to ADDR_ID foreign key + * public class PartTimeEmployee extends Employee { + * ... + * } + *+ * + *
+ * Example 2: Overriding the mapping for phoneNumbers defined in the ContactInfo class + * + * @Entity + * public class Employee { + * @Id int id; + * @AssociationOverride( + * name="phoneNumbers", + * joinTable=@JoinTable( + * name="EMPPHONES", + * joinColumns=@JoinColumn(name="EMP"), + * inverseJoinColumns=@JoinColumn(name="PHONE") + * ) + * ) + * @Embedded ContactInfo contactInfo; + * ... + * } + * + * @Embeddable + * public class ContactInfo { + * @ManyToOne Address address; // Unidirectional + * @ManyToMany(targetEntity=PhoneNumber.class) List phoneNumbers; + * } + * + * @Entity + * public class PhoneNumber { + * @Id int number; + * @ManyToMany(mappedBy="contactInfo.phoneNumbers") + * Collection<Employee> employees; + * } + *+ * + * @see Embedded + * @see Embeddable + * @see MappedSuperclass + * @see AttributeOverride + * + * @since Java Persistence 1.0 + */ +@Repeatable(AssociationOverrides.class) +@Target({TYPE, METHOD, FIELD}) +@Retention(RUNTIME) + +public @interface AssociationOverride { + + /** + * (Required) The name of the relationship property whose mapping is + * being overridden if property-based access is being used, + * or the name of the relationship field if field-based access is used. + */ + String name(); + + /** + * The join column(s) being mapped to the persistent attribute(s). + * The
joinColumns
elements must be specified if a
+ * foreign key mapping is used in the overriding of the mapping of
+ * the relationship. The joinColumns
element must
+ * not be specified if a join table is used in the overriding of
+ * the mapping of the relationship.
+ */
+ JoinColumn[] joinColumns() default {};
+
+ /**
+ * (Optional) Used to specify or control the generation of a
+ * foreign key constraint for the columns corresponding to the
+ * joinColumns
element when table generation is in
+ * effect. If both this element and the foreignKey
+ * element of any of the joinColumns
elements are
+ * specified, the behavior is undefined. If no foreign key
+ * annotation element is specified in either location, the
+ * persistence provider's default foreign key strategy will
+ * apply.
+ *
+ * @since Java Persistence 2.1
+ */
+ ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT);
+
+ /**
+ * The join table that maps the relationship.
+ * The joinTable
element must be specified if a join table
+ * is used in the overriding of the mapping of the
+ * relationship. The joinTable
element must not be specified
+ * if a foreign key mapping is used in the overriding of
+ * the relationship.
+ *
+ * @since Java Persistence 2.0
+ */
+ JoinTable joinTable() default @JoinTable;
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/AssociationOverrides.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/AssociationOverrides.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/AssociationOverrides.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Used to override mappings of multiple relationship properties or fields.
+ *
+ * + * + * Example: + * + * @MappedSuperclass + * public class Employee { + * + * @Id protected Integer id; + * @Version protected Integer version; + * @ManyToOne protected Address address; + * @OneToOne protected Locker locker; + * + * public Integer getId() { ... } + * public void setId(Integer id) { ... } + * public Address getAddress() { ... } + * public void setAddress(Address address) { ... } + * public Locker getLocker() { ... } + * public void setLocker(Locker locker) { ... } + * ... + * } + * + * @Entity + * @AssociationOverrides({ + * @AssociationOverride( + * name="address", + * joinColumns=@JoinColumn("ADDR_ID")), + * @AttributeOverride( + * name="locker", + * joinColumns=@JoinColumn("LCKR_ID")) + * }) + * public PartTimeEmployee { ... } + *+ * + *@see AssociationOverride + * + * @since Java Persistence 1.0 + */ +@Target({TYPE, METHOD, FIELD}) +@Retention(RUNTIME) + +public @interface AssociationOverrides { + + /** + *(Required) The association override mappings that are to be + * applied to the relationship field or property . + */ + AssociationOverride[] value(); +} Index: 3rdParty_sources/persistence-api/javax/persistence/AttributeConverter.java =================================================================== diff -u --- 3rdParty_sources/persistence-api/javax/persistence/AttributeConverter.java (revision 0) +++ 3rdParty_sources/persistence-api/javax/persistence/AttributeConverter.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b) @@ -0,0 +1,52 @@ +/******************************************************************************* + * Copyright (c) 2011 - 2013 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 + * which accompanies this distribution. + * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html + * and the Eclipse Distribution License is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + * + * Contributors: + * Linda DeMichiel - Java Persistence 2.1 + * + ******************************************************************************/ +package javax.persistence; + +/** + * A class that implements this interface can be used to convert + * entity attribute state into database column representation + * and back again. + * Note that the X and Y types may be the same Java type. + * + * @param
dbData
type for the corresponding
+ * column for use by the JDBC driver: i.e., persistence providers are
+ * not expected to do such type conversion.
+ *
+ * @param dbData the data from the database column to be
+ * converted
+ * @return the converted value to be stored in the entity
+ * attribute
+ */
+ public X convertToEntityAttribute (Y dbData);
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/AttributeNode.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/AttributeNode.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/AttributeNode.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/
+
+package javax.persistence;
+
+import java.util.Map;
+
+/**
+ * Represents an attribute node of an entity graph.
+ *
+ * @param Basic
(whether
+ * explicit or default) property or field or Id
property or
+ * field.
+ *
+ * May be applied to an entity that extends a mapped superclass or + * to an embedded field or property to override a basic mapping or id + * mapping defined by the mapped superclass or embeddable class (or + * embeddable class of one of its attributes). + + *
May be applied to an element collection containing instances of
+ * an embeddable class or to a map collection whose key and/or value
+ * is an embeddable class. When AttributeOverride
is
+ * applied to a map, "key.
" or "value.
" must
+ * be used to prefix the name of the attribute that is being
+ * overridden in order to specify it as part of the map key or map
+ * value.
+ *
+ *
To override mappings at multiple levels of embedding, a dot (".")
+ * notation form must be used in the name
element to indicate an
+ * attribute within an embedded attribute. The value of each identifier
+ * used with the dot notation is the name of the respective embedded
+ * field or property.
+ *
+ *
If AttributeOverride
is not specified, the column
+ * is mapped the same as in the original mapping.
+ *
+ *
+ * Example 1: + * + * @MappedSuperclass + * public class Employee { + * @Id protected Integer id; + * @Version protected Integer version; + * protected String address; + * public Integer getId() { ... } + * public void setId(Integer id) { ... } + * public String getAddress() { ... } + * public void setAddress(String address) { ... } + * } + * + * @Entity + * @AttributeOverride(name="address", column=@Column(name="ADDR")) + * public class PartTimeEmployee extends Employee { + * // address field mapping overridden to ADDR + * protected Float wage(); + * public Float getHourlyWage() { ... } + * public void setHourlyWage(Float wage) { ... } + * } + * + * + * Example 2: + * + * @Embeddable public class Address { + * protected String street; + * protected String city; + * protected String state; + * @Embedded protected Zipcode zipcode; + * } + * + * @Embeddable public class Zipcode { + * protected String zip; + * protected String plusFour; + * } + * + * @Entity public class Customer { + * @Id protected Integer id; + * protected String name; + * @AttributeOverrides({ + * @AttributeOverride(name="state", + * column=@Column(name="ADDR_STATE")), + * @AttributeOverride(name="zipcode.zip", + * column=@Column(name="ADDR_ZIP")) + * }) + * @Embedded protected Address address; + * ... + * } + * + * + * Example 3: + * + * @Entity public class PropertyRecord { + * @EmbeddedId PropertyOwner owner; + * @AttributeOverrides({ + * @AttributeOverride(name="key.street", + * column=@Column(name="STREET_NAME")), + * @AttributeOverride(name="value.size", + * column=@Column(name="SQUARE_FEET")), + * @AttributeOverride(name="value.tax", + * column=@Column(name="ASSESSMENT")) + * }) + * @ElementCollection + * Map<Address, PropertyInfo> parcels; + * } + * + * @Embeddable public class PropertyInfo { + * Integer parcelNumber; + * Integer size; + * BigDecimal tax; + * } + * + *+ * + * @see Embedded + * @see Embeddable + * @see MappedSuperclass + * @see AssociationOverride + * + * @since Java Persistence 1.0 + */ +@Repeatable(AttributeOverrides.class) +@Target({TYPE, METHOD, FIELD}) +@Retention(RUNTIME) + +public @interface AttributeOverride { + + /** + * (Required) The name of the property whose mapping is being + * overridden if property-based access is being used, or the + * name of the field if field-based access is used. + */ + String name(); + + /** + * (Required) The column that is being mapped to the persistent + * attribute. The mapping type will remain the same as is + * defined in the embeddable class or mapped superclass. + */ + Column column(); +} Index: 3rdParty_sources/persistence-api/javax/persistence/AttributeOverrides.java =================================================================== diff -u --- 3rdParty_sources/persistence-api/javax/persistence/AttributeOverrides.java (revision 0) +++ 3rdParty_sources/persistence-api/javax/persistence/AttributeOverrides.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b) @@ -0,0 +1,55 @@ +/******************************************************************************* + * Copyright (c) 2008 - 2013 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 + * which accompanies this distribution. + * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html + * and the Eclipse Distribution License is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + * + * Contributors: + * Linda DeMichiel - Java Persistence 2.1 + * Linda DeMichiel - Java Persistence 2.0 + * + ******************************************************************************/ +package javax.persistence; + +import java.lang.annotation.Target; +import java.lang.annotation.Retention; +import static java.lang.annotation.ElementType.TYPE; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.FIELD; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +/** + * Used to override mappings of multiple properties or fields. + * + *
+ * + * Example: + * + * @Embedded + * @AttributeOverrides({ + * @AttributeOverride(name="startDate", + * column=@Column("EMP_START")), + * @AttributeOverride(name="endDate", + * column=@Column("EMP_END")) + * }) + * public EmploymentPeriod getEmploymentPeriod() { ... } + * + *+ * + * + * @see AttributeOverride + * + * @since Java Persistence 1.0 + */ +@Target({TYPE, METHOD, FIELD}) +@Retention(RUNTIME) + +public @interface AttributeOverrides { + + /** (Required) One or more field or property mapping overrides. */ + AttributeOverride[] value(); +} Index: 3rdParty_sources/persistence-api/javax/persistence/Basic.java =================================================================== diff -u --- 3rdParty_sources/persistence-api/javax/persistence/Basic.java (revision 0) +++ 3rdParty_sources/persistence-api/javax/persistence/Basic.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b) @@ -0,0 +1,81 @@ +/******************************************************************************* + * Copyright (c) 2008 - 2013 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 + * which accompanies this distribution. + * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html + * and the Eclipse Distribution License is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + * + * Contributors: + * Linda DeMichiel - Java Persistence 2.1 + * Linda DeMichiel - Java Persistence 2.0 + * + ******************************************************************************/ +package javax.persistence; + +import java.lang.annotation.Target; +import java.lang.annotation.Retention; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.FIELD; +import static java.lang.annotation.RetentionPolicy.RUNTIME; +import static javax.persistence.FetchType.EAGER; + +/** + * The simplest type of mapping to a database column. The + *
Basic
annotation can be applied to a persistent
+ * property or instance variable of any of the following types: Java
+ * primitive types, wrappers of the primitive types, String
,
+ * java.math.BigInteger
,
+ * java.math.BigDecimal
,
+ * java.util.Date
,
+ * java.util.Calendar
,
+ * java.sql.Date
,
+ * java.sql.Time
,
+ * java.sql.Timestamp
, byte[]
, Byte[]
,
+ * char[]
, Character[]
, enums, and any other type that
+ * implements java.io.Serializable
.
+ *
+ * The use of the Basic
annotation is optional for
+ * persistent fields and properties of these types. If the
+ * Basic
annotation is not specified for such a field or
+ * property, the default values of the Basic
annotation
+ * will apply.
+ *
+ *
+ * Example 1: + * + * @Basic + * protected String name; + * + * Example 2: + * + * @Basic(fetch=LAZY) + * protected String getName() { return name; } + * + *+ * @since Java Persistence 1.0 + */ +@Target({METHOD, FIELD}) +@Retention(RUNTIME) +public @interface Basic { + + /** + * (Optional) Defines whether the value of the field or property should + * be lazily loaded or must be eagerly fetched. The
EAGER
+ * strategy is a requirement on the persistence provider runtime
+ * that the value must be eagerly fetched. The LAZY
+ * strategy is a hint to the persistence provider runtime.
+ * If not specified, defaults to EAGER
.
+ */
+ FetchType fetch() default EAGER;
+
+ /**
+ * (Optional) Defines whether the value of the field or property may be null.
+ * This is a hint and is disregarded for primitive types; it may
+ * be used in schema generation.
+ * If not specified, defaults to true
.
+ */
+ boolean optional() default true;
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/Cache.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/Cache.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/Cache.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * Interface used to interact with the second-level cache.
+ * If a cache is not in use, the methods of this interface have
+ * no effect, except for contains
, which returns false.
+ *
+ * @since Java Persistence 2.0
+ */
+public interface Cache {
+
+ /**
+ * Whether the cache contains data for the given entity.
+ * @param cls entity class
+ * @param primaryKey primary key
+ * @return boolean indicating whether the entity is in the cache
+ */
+ public boolean contains(Class cls, Object primaryKey);
+
+ /**
+ * Remove the data for the given entity from the cache.
+ * @param cls entity class
+ * @param primaryKey primary key
+ */
+ public void evict(Class cls, Object primaryKey);
+
+ /**
+ * Remove the data for entities of the specified class (and its
+ * subclasses) from the cache.
+ * @param cls entity class
+ */
+ public void evict(Class cls);
+
+ /**
+ * Clear the cache.
+ */
+ public void evictAll();
+
+ /**
+ * Return an object of the specified type to allow access to the
+ * provider-specific API. If the provider's Cache
+ * implementation does not support the specified class, the
+ * PersistenceException is thrown.
+ * @param cls the class of the object to be returned. This is
+ * normally either the underlying Cache implementation
+ * class or an interface that it implements.
+ * @return an instance of the specified class
+ * @throws PersistenceException if the provider does not
+ * support the call
+ * @since Java Persistence 2.1
+ */
+ public javax.persistence.cache.retrieveMode
property to
+ * specify the behavior when data is retrieved by the
+ * find
methods and by queries.
+ *
+ * @since Java Persistence 2.0
+ */
+public enum CacheRetrieveMode {
+
+ /**
+ * Read entity data from the cache: this is
+ * the default behavior.
+ */
+ USE,
+
+ /**
+ * Bypass the cache: get data directly from
+ * the database.
+ */
+ BYPASS
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/CacheStoreMode.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/CacheStoreMode.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/CacheStoreMode.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,47 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * Used as the value of the
+ * javax.persistence.cache.storeMode
property to specify
+ * the behavior when data is read from the database and when data is
+ * committed into the database.
+ *
+ * @since Java Persistence 2.0
+ */
+public enum CacheStoreMode {
+
+ /**
+ * Insert entity data into cache when read from database
+ * and insert/update entity data when committed into database:
+ * this is the default behavior. Does not force refresh
+ * of already cached items when reading from database.
+ */
+ USE,
+
+ /**
+ * Don't insert into cache.
+ */
+ BYPASS,
+
+ /**
+ * Insert/update entity data into cache when read
+ * from database and when committed into database.
+ * Forces refresh of cache for items read from database.
+ */
+ REFRESH
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/Cacheable.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/Cacheable.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/Cacheable.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Specifies whether an entity should be cached if caching is enabled
+ * when the value of the persistence.xml
caching element
+ * is ENABLE_SELECTIVE
or DISABLE_SELECTIVE
.
+ * The value of the Cacheable
annotation is inherited by
+ * subclasses; it can be overridden by specifying
+ * Cacheable
on a subclass.
+ *
+ * Cacheable(false)
means that the entity and its state must
+ * not be cached by the provider.
+ *
+ * @since Java Persistence 2.0
+ */
+@Target( { TYPE })
+@Retention(RUNTIME)
+public @interface Cacheable {
+
+ /**
+ * (Optional) Whether or not the entity should be cached.
+ */
+ boolean value() default true;
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/CascadeType.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/CascadeType.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/CascadeType.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+ package javax.persistence;
+
+/**
+ * Defines the set of cascadable operations that are propagated
+ * to the associated entity.
+ * The value cascade=ALL
is equivalent to
+ * cascade={PERSIST, MERGE, REMOVE, REFRESH, DETACH}
.
+ *
+ * @since Java Persistence 1.0
+ */
+public enum CascadeType {
+
+ /** Cascade all operations */
+ ALL,
+
+ /** Cascade persist operation */
+ PERSIST,
+
+ /** Cascade merge operation */
+ MERGE,
+
+ /** Cascade remove operation */
+ REMOVE,
+
+ /** Cascade refresh operation */
+ REFRESH,
+
+ /**
+ * Cascade detach operation
+ *
+ * @since Java Persistence 2.0
+ *
+ */
+ DETACH
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/CollectionTable.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/CollectionTable.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/CollectionTable.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,171 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.ConstraintMode.PROVIDER_DEFAULT;
+
+/**
+ * Specifies the table that is used for the mapping of
+ * collections of basic or embeddable types. Applied
+ * to the collection-valued field or property.
+ *
+ *
By default, the columns of the collection table that correspond
+ * to the embeddable class or basic type are derived from the
+ * attributes of the embeddable class or from the basic type according
+ * to the default values of the Column
annotation. In the case
+ * of a basic type, the column name is derived from the name of the
+ * collection-valued field or property. In the case of an embeddable
+ * class, the column names are derived from the field or property
+ * names of the embeddable class.
+ *
Column
annotation is used on the
+ * collection-valued attribute in addition to the
+ * ElementCollection
annotation.
+ *
+ * AttributeOverride
and/or
+ * AttributeOverrides
annotations can be used in
+ * addition to the ElementCollection
annotation. If the
+ * embeddable class contains references to other entities, the default
+ * values for the columns corresponding to those references may be
+ * overridden by means of the AssociationOverride
and/or
+ * AssociationOverrides
annotations.
+ * If the CollectionTable
annotation is missing, the
+ * default values of the CollectionTable
annotation
+ * elements apply.
+ *
+ *
+ * Example: + * + * @Embeddable public class Address { + * protected String street; + * protected String city; + * protected String state; + * ... + * } + * + * @Entity public class Person { + * @Id protected String ssn; + * protected String name; + * protected Address home; + * ... + * @ElementCollection // use default table (PERSON_NICKNAMES) + * @Column(name="name", length=50) + * protected Set<String> nickNames = new HashSet(); + * ... + * } + * + * @Entity public class WealthyPerson extends Person { + * @ElementCollection + * @CollectionTable(name="HOMES") // use default join column name + * @AttributeOverrides({ + * @AttributeOverride(name="street", + * column=@Column(name="HOME_STREET")), + * @AttributeOverride(name="city", + * column=@Column(name="HOME_CITY")), + * @AttributeOverride(name="state", + * column=@Column(name="HOME_STATE")) + * }) + * protected Set<Address> vacationHomes = new HashSet(); + * ... + * } + *+ * + * @see ElementCollection + * @see AttributeOverride + * @see AssociationOverride + * @see Column + * + * @since Java Persistence 2.0 + */ + +@Target( { METHOD, FIELD }) +@Retention(RUNTIME) +public @interface CollectionTable { + + /** + * (Optional) The name of the collection table. If not specified, + * it defaults to the concatenation of the name of the containing + * entity and the name of the collection attribute, separated by + * an underscore. + */ + String name() default ""; + + /** + * (Optional) The catalog of the table. If not specified, the + * default catalog is used. + */ + String catalog() default ""; + + /** + * (Optional) The schema of the table. If not specified, the + * default schema for the user is used. + */ + String schema() default ""; + + /** + * (Optional) The foreign key columns of the collection table + * which reference the primary table of the entity. The default + * only applies if a single join column is used. The default is + * the same as for
JoinColumn
(i.e., the
+ * concatenation of the following: the name of the entity; "_";
+ * the name of the referenced primary key column.) However, if
+ * there is more than one join column, a JoinColumn
+ * annotation must be specified for each join column using the
+ * JoinColumns
annotation. In this case, both the
+ * name
and the referencedColumnName
+ * elements must be specified in each such
+ * JoinColumn
annotation.
+ */
+ JoinColumn[] joinColumns() default {};
+
+ /**
+ * (Optional) Used to specify or control the generation of a
+ * foreign key constraint for the columns corresponding to the
+ * joinColumns
element when table generation is in
+ * effect. If both this element and the foreignKey
+ * element of any of the joinColumns
elements are
+ * specified, the behavior is undefined. If no foreign key
+ * annotation element is specified in either location, the
+ * persistence provider's default foreign key strategy will
+ * apply.
+ *
+ * @since Java Persistence 2.1
+ */
+ ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT);
+
+ /**
+ * (Optional) Unique constraints that are to be placed on the
+ * table. These are only used if table generation is in effect.
+ */
+ UniqueConstraint[] uniqueConstraints() default {};
+
+ /**
+ * (Optional) Indexes for the table. These are only used if
+ * table generation is in effect.
+ *
+ * @since Java Persistence 2.1
+ */
+ Index[] indexes() default {};
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/Column.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/Column.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/Column.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,122 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies the mapped column for a persistent property or field.
+ * If no Column
annotation is specified, the default values apply.
+ *
+ * + * + * + * @since Java Persistence 1.0 + */ +@Target({METHOD, FIELD}) +@Retention(RUNTIME) +public @interface Column { + + /** + * (Optional) The name of the column. Defaults to + * the property or field name. + */ + String name() default ""; + + /** + * (Optional) Whether the column is a unique key. This is a + * shortcut for the+ * Example 1: + * + * @Column(name="DESC", nullable=false, length=512) + * public String getDescription() { return description; } + * + * Example 2: + * + * @Column(name="DESC", + * columnDefinition="CLOB NOT NULL", + * table="EMP_DETAIL") + * @Lob + * public String getDescription() { return description; } + * + * Example 3: + * + * @Column(name="ORDER_COST", updatable=false, precision=12, scale=2) + * public BigDecimal getCost() { return cost; } + * + *
UniqueConstraint
annotation at the table
+ * level and is useful for when the unique key constraint
+ * corresponds to only a single column. This constraint applies
+ * in addition to any constraint entailed by primary key mapping and
+ * to constraints specified at the table level.
+ */
+ boolean unique() default false;
+
+ /**
+ * (Optional) Whether the database column is nullable.
+ */
+ boolean nullable() default true;
+
+ /**
+ * (Optional) Whether the column is included in SQL INSERT
+ * statements generated by the persistence provider.
+ */
+ boolean insertable() default true;
+
+ /**
+ * (Optional) Whether the column is included in SQL UPDATE
+ * statements generated by the persistence provider.
+ */
+ boolean updatable() default true;
+
+ /**
+ * (Optional) The SQL fragment that is used when
+ * generating the DDL for the column.
+ * Defaults to the generated SQL to create a + * column of the inferred type. + */ + String columnDefinition() default ""; + + /** + * (Optional) The name of the table that contains the column. + * If absent the column is assumed to be in the primary table. + */ + String table() default ""; + + /** + * (Optional) The column length. (Applies only if a + * string-valued column is used.) + */ + int length() default 255; + + /** + * (Optional) The precision for a decimal (exact numeric) + * column. (Applies only if a decimal column is used.) + * Value must be set by developer if used when generating + * the DDL for the column. + */ + int precision() default 0; + + /** + * (Optional) The scale for a decimal (exact numeric) column. + * (Applies only if a decimal column is used.) + */ + int scale() default 0; +} Index: 3rdParty_sources/persistence-api/javax/persistence/ColumnResult.java =================================================================== diff -u --- 3rdParty_sources/persistence-api/javax/persistence/ColumnResult.java (revision 0) +++ 3rdParty_sources/persistence-api/javax/persistence/ColumnResult.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b) @@ -0,0 +1,74 @@ +/******************************************************************************* + * Copyright (c) 2008 - 2014 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 + * which accompanies this distribution. + * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html + * and the Eclipse Distribution License is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + * + * Contributors: + * Linda DeMichiel - Java Persistence 2.1 + * Linda DeMichiel - Java Persistence 2.0 + * + ******************************************************************************/ +package javax.persistence; + +import java.lang.annotation.Target; +import java.lang.annotation.Retention; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +/** + * Used in conjunction with the {@link SqlResultSetMapping} annotation or + * {@link ConstructorResult} annotation to map a column of the SELECT + * list of a SQL query. + * + *
The name
element references the name of a column in the SELECT list
+ * — i.e., column alias, if applicable. Scalar result types can be
+ * included in the query result by specifying this annotation in
+ * the metadata.
+ *
+ *
+ * + * Example: + * Query q = em.createNativeQuery( + * "SELECT o.id AS order_id, " + + * "o.quantity AS order_quantity, " + + * "o.item AS order_item, " + + * "i.name AS item_name, " + + * "FROM Order o, Item i " + + * "WHERE (order_quantity > 25) AND (order_item = i.id)", + * "OrderResults"); + * + * @SqlResultSetMapping(name="OrderResults", + * entities={ + * @EntityResult(entityClass=com.acme.Order.class, fields={ + * @FieldResult(name="id", column="order_id"), + * @FieldResult(name="quantity", column="order_quantity"), + * @FieldResult(name="item", column="order_item")})}, + * columns={ + * @ColumnResult(name="item_name")} + * ) + *+ * + * @see SqlResultSetMapping + * + * @since Java Persistence 1.0 + */ +@Target({}) +@Retention(RUNTIME) + +public @interface ColumnResult { + + /** (Required) The name of a column in the SELECT clause of a SQL query */ + String name(); + + /** + * (Optional) The Java type to which the column type is to be mapped. + * If the
type
element is not specified, the default JDBC type
+ * mapping for the column will be used.
+ * @since Java Persistence 2.1
+ */
+ Class type() default void.class;
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/ConstraintMode.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/ConstraintMode.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/ConstraintMode.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * Used to control the application of a constraint.
+ *
+ * @since Java Persistence 2.1
+ */
+public enum ConstraintMode {
+
+ /** Apply the constraint. */
+ CONSTRAINT,
+
+ /** Do not apply the constraint. */
+ NO_CONSTRAINT,
+
+ /** Use the provider-defined default behavior. */
+ PROVIDER_DEFAULT
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/ConstructorResult.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/ConstructorResult.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/ConstructorResult.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Used in conjunction with the {@link SqlResultSetMapping} annotation to map the SELECT
+ * clause of a SQL query to a constructor.
+ *
+ * Applies a constructor for the target class, passing in as arguments
+ * values from the specified columns. All columns corresponding
+ * to arguments of the intended constructor must be specified using the
+ * columns
element of the ConstructorResult
+ * annotation in the same order as that of the argument list of the
+ * constructor. Any entities returned as constructor results will be
+ * in either the new or detached state, depending on whether a primary
+ * key is retrieved for the constructed object.
+ *
+ *
+ * + * Example: + * + * Query q = em.createNativeQuery( + * "SELECT c.id, c.name, COUNT(o) as orderCount, AVG(o.price) AS avgOrder " + + * "FROM Customer c, Orders o " + + * "WHERE o.cid = c.id " + + * "GROUP BY c.id, c.name", + * "CustomerDetailsResult"); + * + * @SqlResultSetMapping( + * name="CustomerDetailsResult", + * classes={ + * @ConstructorResult( + * targetClass=com.acme.CustomerDetails.class, + * columns={ + * @ColumnResult(name="id"), + * @ColumnResult(name="name"), + * @ColumnResult(name="orderCount"), + * @ColumnResult(name="avgOrder", type=Double.class) + * } + * ) + * } + * ) + * + *+ * + * @see SqlResultSetMapping + * @see ColumnResult + * + * @since Java Persistence 2.1 + */ +@Target({}) +@Retention(RUNTIME) + +public @interface ConstructorResult { + + /** (Required) The class whose constructor is to be invoked. */ + Class targetClass(); + + /** + * (Required) The mapping of columns in the SELECT list to the arguments + * of the intended constructor, in order. + */ + ColumnResult[] columns(); +} Index: 3rdParty_sources/persistence-api/javax/persistence/Convert.java =================================================================== diff -u --- 3rdParty_sources/persistence-api/javax/persistence/Convert.java (revision 0) +++ 3rdParty_sources/persistence-api/javax/persistence/Convert.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b) @@ -0,0 +1,211 @@ +/******************************************************************************* + * 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 + * which accompanies this distribution. + * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html + * and the Eclipse Distribution License is available at + * 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; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.FIELD; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +/** + * Specifies the conversion of a Basic field or property. It is + * not necessary to use the
Basic
annotation or corresponding
+ * XML element to specify the Basic type.
+ *
+ * The Convert
annotation should not be used to specify
+ * conversion of the following: Id attributes, version attributes,
+ * relationship attributes, and attributes explicitly denoted as
+ * Enumerated or Temporal. Applications that specify such conversions
+ * will not be portable.
+ *
+ *
The Convert
annotation may be applied to a basic
+ * attribute or to an element collection of basic type (in which case
+ * the converter is applied to the elements of the collection). In
+ * these cases, the attributeName
element must not be
+ * specified.
+ *
+ *
The Convert
annotation may be applied to an embedded
+ * attribute or to a map collection attribute whose key or value is of
+ * embeddable type (in which case the converter is applied to the
+ * specified attribute of the embeddable instances contained in the
+ * collection). In these cases, the attributeName
+ * element must be specified.
+ *
+ *
To override conversion mappings at multiple levels of embedding,
+ * a dot (".") notation form must be used in the attributeName
+ * element to indicate an attribute within an embedded attribute. The
+ * value of each identifier used with the dot notation is the name of the
+ * respective embedded field or property.
+ *
+ *
When the Convert
annotation is applied to a map containing
+ * instances of embeddable classes, the attributeName
element
+ * must be specified, and "key."
or "value."
+ * must be used to prefix the name of the attribute that is to be converted
+ * in order to specify it as part of the map key or map value.
+ *
+ *
When the Convert
annotation is applied to a map to specify
+ * conversion of a map key of basic type, "key"
must be used
+ * as the value of the attributeName
element to specify that
+ * it is the map key that is to be converted.
+ *
+ *
The Convert
annotation may be applied to an entity class
+ * that extends a mapped superclass to specify or override a conversion
+ * mapping for an inherited basic or embedded attribute.
+ *
+ *
+ * Example 1: Convert a basic attribute + * + * @Converter + * public class BooleanToIntegerConverter + * implements AttributeConverter<Boolean, Integer> { ... } + * + * @Entity + * public class Employee { + * @Id long id; + * + * @Convert(converter=BooleanToIntegerConverter.class) + * boolean fullTime; + * ... + * } + * + * + * Example 2: Auto-apply conversion of a basic attribute + * + * @Converter(autoApply=true) + * public class EmployeeDateConverter + * implements AttributeConverter<com.acme.EmployeeDate, java.sql.Date> { ... } + * + * @Entity + * public class Employee { + * @Id long id; + * ... + * // EmployeeDateConverter is applied automatically + * EmployeeDate startDate; + * } + * + * + * Example 3: Disable conversion in the presence of an autoapply converter + * + * @Convert(disableConversion=true) + * EmployeeDate lastReview; + * + * + * Example 4: Apply a converter to an element collection of basic type + * + * @ElementCollection + * // applies to each element in the collection + * @Convert(converter=NameConverter.class) + * List<String> names; + * + * + * Example 5: Apply a converter to an element collection that is a map or basic values. + * The converter is applied to the map value. + * + * @ElementCollection + * @Convert(converter=EmployeeNameConverter.class) + * Map<String, String> responsibilities; + * + * + * Example 6: Apply a converter to a map key of basic type + * + * @OneToMany + * @Convert(converter=ResponsibilityCodeConverter.class, + * attributeName="key") + * Map<String, Employee> responsibilities; + * + * + * Example 7: Apply a converter to an embeddable attribute + * + * @Embedded + * @Convert(converter=CountryConverter.class, + * attributeName="country") + * Address address; + * + * + * Example 8: Apply a converter to a nested embeddable attribute + * + * @Embedded + * @Convert(converter=CityConverter.class, + * attributeName="region.city") + * Address address; + * + * + * Example 9: Apply a converter to a nested attribute of an embeddable that is a map key + * of an element collection + * + * @Entity public class PropertyRecord { + * ... + * @Convert(attributeName="key.region.city", + * converter=CityConverter.class) + * @ElementCollection + * Map<Address, PropertyInfo> parcels; + * } + * + * + * Example 10: Apply a converter to an embeddable that is a map key for a relationship + * + * @OneToMany + * @Convert(attributeName="key.jobType", + * converter=ResponsibilityTypeConverter.class) + * Map<Responsibility, Employee> responsibilities; + * + * + * Example 11: Override conversion mappings for attributes inherited from a mapped superclass + * + * @Entity + * @Converts({ + * @Convert(attributeName="startDate", + * converter=DateConverter.class), + * @Convert(attributeName="endDate", + * converter=DateConverter.class)}) + * public class FullTimeEmployee extends GenericEmployee { ... } + *+ * + * @see Converter + * @see Converts + * @see Basic + * + * @since Java Persistence 2.1 + */ +@Repeatable(Converts.class) +@Target({METHOD, FIELD, TYPE}) @Retention(RUNTIME) +public @interface Convert { + + /** + * Specifies the converter to be applied. A value for this + * element must be specified if multiple converters would + * otherwise apply. + */ + Class converter() default void.class; + + /** + * The
attributeName
element must be specified unless the
+ * Convert
annotation is on an attribute of basic type
+ * or on an element collection of basic type. In these cases, the
+ * attributeName
element must not be specified.
+ */
+ String attributeName() default "";
+
+ /**
+ * Used to disable an auto-apply or inherited converter.
+ * If disableConversion is true, the converter
element should
+ * not be specified.
+ */
+ boolean disableConversion() default false;
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/Converter.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/Converter.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/Converter.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies that the annotated class is a converter and defines its
+ * scope. A converter class must be annotated with the Converter
+ * annotation or defined in the object/relational mapping descriptor as
+ * a converter.
+ *
+ * If the autoApply
element is specified as
+ * true
, the persistence provider must automatically
+ * apply the converter to all mapped attributes of the specified
+ * target type for all entities in the persistence unit except for
+ * attributes for which conversion is overridden by means of the
+ * Convert
annotation (or XML equivalent).
+ *
+ *
In determining whether a converter is applicable to an attribute, + * the provider must treat primitive types and wrapper types as + * equivalent. + * + *
Note that Id attributes, version attributes, relationship
+ * attributes, and attributes explicitly annotated as
+ * Enumerated
or Temporal
(or designated as
+ * such via XML) will not be converted.
+ *
+ *
Note that if autoApply
is true
, the
+ * Convert
annotation may be used to override or disable
+ * auto-apply conversion on a per-attribute basis.
+ *
+ *
If autoApply
is false
, only those
+ * attributes of the target type for which the Convert
+ * annotation (or corresponding XML element) has been specified will
+ * be converted.
+ *
+ *
If there is more than one converter defined for the same target
+ * type, the Convert
annotation should be used to
+ * explicitly specify which converter to use.
+ *
+ * @see AttributeConverter
+ * @see Convert
+ *
+ * @since Java Persistence 2.1
+ */
+@Target({TYPE}) @Retention(RUNTIME)
+public @interface Converter {
+ boolean autoApply() default false;
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/Converts.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/Converts.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/Converts.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,40 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Used to group Convert
annotations. Multiple converters
+ * must not be applied to the same basic attribute.
+ *
+ * @see Convert
+ * @since Java Persistence 2.1
+ */
+@Target({METHOD, FIELD, TYPE})
+@Retention(RUNTIME)
+public @interface Converts {
+
+ /**
+ * The Convert
mappings that are to be applied.
+ *
+ */
+ Convert[] value();
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/DiscriminatorColumn.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/DiscriminatorColumn.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/DiscriminatorColumn.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,84 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.DiscriminatorType.STRING;
+
+/**
+ * Specifies the discriminator column for the
+ * SINGLE_TABLE
and
+ * JOINED
{@link Inheritance} mapping strategies.
+ *
+ *
The strategy and the discriminator column are only + * specified in the root of an entity class hierarchy or + * subhierarchy in which a different inheritance strategy is applied + * + *
If the DiscriminatorColumn
annotation is missing,
+ * and a discriminator column is required, the name of the
+ * discriminator column defaults to "DTYPE"
and the discriminator
+ * type to {@link DiscriminatorType#STRING DiscriminatorType.STRING}.
+ *
+ *
+ * Example: + * + * @Entity + * @Table(name="CUST") + * @Inheritance(strategy=SINGLE_TABLE) + * @DiscriminatorColumn(name="DISC", discriminatorType=STRING, length=20) + * public class Customer { ... } + * + * @Entity + * public class ValuedCustomer extends Customer { ... } + *+ * + * @see DiscriminatorValue + * + * @since Java Persistence 1.0 + */ +@Target({TYPE}) +@Retention(RUNTIME) + +public @interface DiscriminatorColumn { + + /** + * (Optional) The name of column to be used for the discriminator. + */ + String name() default "DTYPE"; + + /** + * (Optional) The type of object/column to use as a class discriminator. + * Defaults to {@link DiscriminatorType#STRING DiscriminatorType.STRING}. + */ + DiscriminatorType discriminatorType() default STRING; + + /** + * (Optional) The SQL fragment that is used when generating the DDL + * for the discriminator column. + *
Defaults to the provider-generated SQL to create a column + * of the specified discriminator type. + */ + String columnDefinition() default ""; + + /** + * (Optional) The column length for String-based discriminator types. + * Ignored for other discriminator types. + */ + int length() default 31; +} Index: 3rdParty_sources/persistence-api/javax/persistence/DiscriminatorType.java =================================================================== diff -u --- 3rdParty_sources/persistence-api/javax/persistence/DiscriminatorType.java (revision 0) +++ 3rdParty_sources/persistence-api/javax/persistence/DiscriminatorType.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b) @@ -0,0 +1,39 @@ +/******************************************************************************* + * Copyright (c) 2008 - 2013 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 + * which accompanies this distribution. + * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html + * and the Eclipse Distribution License is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + * + * Contributors: + * Linda DeMichiel - Java Persistence 2.1 + * Linda DeMichiel - Java Persistence 2.0 + * + ******************************************************************************/ +package javax.persistence; + +/** + * Defines supported types of the discriminator column. + * + * @since Java Persistence 1.0 + */ +public enum DiscriminatorType { + + /** + * String as the discriminator type. + */ + STRING, + + /** + * Single character as the discriminator type. + */ + CHAR, + + /** + * Integer as the discriminator type. + */ + INTEGER +} Index: 3rdParty_sources/persistence-api/javax/persistence/DiscriminatorValue.java =================================================================== diff -u --- 3rdParty_sources/persistence-api/javax/persistence/DiscriminatorValue.java (revision 0) +++ 3rdParty_sources/persistence-api/javax/persistence/DiscriminatorValue.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b) @@ -0,0 +1,81 @@ +/******************************************************************************* + * Copyright (c) 2008 - 2013 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 + * which accompanies this distribution. + * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html + * and the Eclipse Distribution License is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + * + * Contributors: + * Linda DeMichiel - Java Persistence 2.1 + * Linda DeMichiel - Java Persistence 2.0 + * + ******************************************************************************/ +package javax.persistence; + +import java.lang.annotation.Target; +import java.lang.annotation.Retention; +import static java.lang.annotation.ElementType.TYPE; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +/** + * Specifies the value of the discriminator column for + * entities of the given type. + * + *
The DiscriminatorValue
+ * annotation can only be specified on a concrete entity
+ * class.
+ *
+ *
If the DiscriminatorValue
annotation is not
+ * specified and a discriminator column is used, a provider-specific
+ * function will be used to generate a value representing the
+ * entity type. If the {@link DiscriminatorType} is
+ * STRING
, the discriminator value
+ * default is the entity name.
+ *
+ *
The inheritance strategy and the discriminator column + * are only specified in the root of an entity class hierarchy + * or subhierarchy in which a different inheritance strategy is + * applied. The discriminator value, if not defaulted, should be + * specified for each entity class in the hierarchy. + * + *
+ * + * Example: + * + * @Entity + * @Table(name="CUST") + * @Inheritance(strategy=SINGLE_TABLE) + * @DiscriminatorColumn(name="DISC", discriminatorType=STRING, length=20) + * @DiscriminatorValue("CUSTOMER") + * public class Customer { ... } + * + * @Entity + * @DiscriminatorValue("VCUSTOMER") + * public class ValuedCustomer extends Customer { ... } + *+ * + * @see DiscriminatorColumn + * + * @since Java Persistence 1.0 + */ +@Target({TYPE}) +@Retention(RUNTIME) + +public @interface DiscriminatorValue { + + /** + * (Optional) The value that indicates that the + * row is an entity of the annotated entity type. + * + *
If the DiscriminatorValue
annotation is not
+ * specified and a discriminator column is used, a
+ * provider-specific function will be used to generate a value
+ * representing the entity type. If the DiscriminatorType
is
+ * STRING
, the discriminator value default is the
+ * entity name.
+ */
+ String value();
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/ElementCollection.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/ElementCollection.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/ElementCollection.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.FetchType.LAZY;
+
+/**
+ * Specifies a collection of instances of a basic type or embeddable
+ * class.
+ * Must be specified if the collection is to be mapped by
+ * means of a collection table.
+ *
+ *
+ * Example: + * + * @Entity public class Person { + * @Id protected String ssn; + * protected String name; + * ... + * @ElementCollection + * protected Set<String> nickNames = new HashSet(); + * ... + * } + *+ * + * @since Java Persistence 2.0 + */ +@Target( { METHOD, FIELD }) +@Retention(RUNTIME) +public @interface ElementCollection { + + /** + * (Optional) The basic or embeddable class that is the element + * type of the collection. This element is optional only if the + * collection field or property is defined using Java generics, + * and must be specified otherwise. It defaults to the + * paramterized type of the collection when defined using + * generics. + */ + Class targetClass() default void.class; + + /** + * (Optional) Whether the collection should be lazily loaded or must be + * eagerly fetched. The EAGER strategy is a requirement on + * the persistence provider runtime that the collection elements + * must be eagerly fetched. The LAZY strategy is a hint to the + * persistence provider runtime. + */ + FetchType fetch() default LAZY; +} Index: 3rdParty_sources/persistence-api/javax/persistence/Embeddable.java =================================================================== diff -u --- 3rdParty_sources/persistence-api/javax/persistence/Embeddable.java (revision 0) +++ 3rdParty_sources/persistence-api/javax/persistence/Embeddable.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b) @@ -0,0 +1,80 @@ +/******************************************************************************* + * Copyright (c) 2008 - 2013 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 + * which accompanies this distribution. + * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html + * and the Eclipse Distribution License is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + * + * Contributors: + * Linda DeMichiel - Java Persistence 2.1 + * Linda DeMichiel - Java Persistence 2.0 + * + ******************************************************************************/ +package javax.persistence; + +import java.lang.annotation.Target; +import java.lang.annotation.Retention; +import java.lang.annotation.Documented; +import static java.lang.annotation.ElementType.TYPE; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +/** + * Specifies a class whose instances are stored as an intrinsic + * part of an owning entity and share the identity of the entity. + * Each of the persistent properties or fields of the embedded + * object is mapped to the database table for the entity. + * + *
Note that the {@link Transient} annotation may be used to + * designate the non-persistent state of an embeddable class. + * + *
+ * + * Example 1: + * + * @Embeddable public class EmploymentPeriod { + * @Temporal(DATE) java.util.Date startDate; + * @Temporal(DATE) java.util.Date endDate; + * ... + * } + * + * Example 2: + * + * @Embeddable public class PhoneNumber { + * protected String areaCode; + * protected String localNumber; + * @ManyToOne PhoneServiceProvider provider; + * ... + * } + * + * @Entity public class PhoneServiceProvider { + * @Id protected String name; + * ... + * } + * + * Example 3: + * + * @Embeddable public class Address { + * protected String street; + * protected String city; + * protected String state; + * @Embedded protected Zipcode zipcode; + * } + * + * @Embeddable public class Zipcode { + * protected String zip; + * protected String plusFour; + * } + + + *+ * + * @since Java Persistence 1.0 + */ +@Documented +@Target({TYPE}) +@Retention(RUNTIME) +public @interface Embeddable { +} Index: 3rdParty_sources/persistence-api/javax/persistence/Embedded.java =================================================================== diff -u --- 3rdParty_sources/persistence-api/javax/persistence/Embedded.java (revision 0) +++ 3rdParty_sources/persistence-api/javax/persistence/Embedded.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b) @@ -0,0 +1,57 @@ +/******************************************************************************* + * Copyright (c) 2008 - 2013 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 + * which accompanies this distribution. + * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html + * and the Eclipse Distribution License is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + * + * Contributors: + * Linda DeMichiel - Java Persistence 2.1 + * Linda DeMichiel - Java Persistence 2.0 + * + ******************************************************************************/ +package javax.persistence; + +import java.lang.annotation.Target; +import java.lang.annotation.Retention; +import static java.lang.annotation.ElementType.FIELD; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +/** + * Specifies a persistent field or property of an entity whose + * value is an instance of an embeddable class. The embeddable + * class must be annotated as {@link Embeddable}. + * + *
The AttributeOverride
, AttributeOverrides
,
+ * AssociationOverride
, and AssociationOverrides
+ * annotations may be used to override mappings declared or defaulted
+ * by the embeddable class.
+ *
+ *
+ * Example: + * + * @Embedded + * @AttributeOverrides({ + * @AttributeOverride(name="startDate", column=@Column("EMP_START")), + * @AttributeOverride(name="endDate", column=@Column("EMP_END")) + * }) + * public EmploymentPeriod getEmploymentPeriod() { ... } + *+ * + * @see Embeddable + * @see AttributeOverride + * @see AttributeOverrides + * @see AssociationOverride + * @see AssociationOverrides + * + * @since Java Persistence 1.0 + */ +@Target({METHOD, FIELD}) +@Retention(RUNTIME) + +public @interface Embedded { +} Index: 3rdParty_sources/persistence-api/javax/persistence/EmbeddedId.java =================================================================== diff -u --- 3rdParty_sources/persistence-api/javax/persistence/EmbeddedId.java (revision 0) +++ 3rdParty_sources/persistence-api/javax/persistence/EmbeddedId.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b) @@ -0,0 +1,81 @@ +/******************************************************************************* + * Copyright (c) 2008 - 2013 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 + * which accompanies this distribution. + * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html + * and the Eclipse Distribution License is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + * + * Contributors: + * Linda DeMichiel - Java Persistence 2.1 + * Linda DeMichiel - Java Persistence 2.0 + * + ******************************************************************************/ +package javax.persistence; + +import java.lang.annotation.Target; +import java.lang.annotation.Retention; +import static java.lang.annotation.ElementType.FIELD; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +/** + * Applied to a persistent field or property of an entity + * class or mapped superclass to denote a composite primary + * key that is an embeddable class. The embeddable class + * must be annotated as {@link Embeddable}. + * + *
There must be only one EmbeddedId
annotation and
+ * no Id
annotation when the EmbeddedId
annotation is used.
+ *
+ *
The {@link AttributeOverride} annotation may be used to override + * the column mappings declared within the embeddable class. + * + *
The {@link MapsId} annotation may be used in conjunction
+ * with the EmbeddedId
annotation to specify a derived
+ * primary key.
+ *
+ *
If the entity has a derived primary key, the
+ * AttributeOverride
annotation may only be used to
+ * override those attributes of the embedded id that do not correspond
+ * to the relationship to the parent entity.
+ *
+ *
Relationship mappings defined within an embedded id class are not supported. + * + *
+ * Example 1: + * + * @EmbeddedId + * protected EmployeePK empPK; + * + * + * Example 2: + * + * @Embeddable + * public class DependentId { + * String name; + * EmployeeId empPK; // corresponds to primary key type of Employee + * } + * + * @Entity + * public class Dependent { + * // default column name for "name" attribute is overridden + * @AttributeOverride(name="name", @Column(name="dep_name")) + * @EmbeddedId DependentId id; + * ... + * @MapsId("empPK") + * @ManyToOne Employee emp; + * } + *+ * + * @see Embeddable + * @see MapsId + * + * @since Java Persistence 1.0 + */ +@Target({METHOD, FIELD}) +@Retention(RUNTIME) + +public @interface EmbeddedId {} Index: 3rdParty_sources/persistence-api/javax/persistence/Entity.java =================================================================== diff -u --- 3rdParty_sources/persistence-api/javax/persistence/Entity.java (revision 0) +++ 3rdParty_sources/persistence-api/javax/persistence/Entity.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b) @@ -0,0 +1,42 @@ +/******************************************************************************* + * Copyright (c) 2008 - 2013 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 + * which accompanies this distribution. + * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html + * and the Eclipse Distribution License is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + * + * Contributors: + * Linda DeMichiel - Java Persistence 2.1 + * Linda DeMichiel - Java Persistence 2.0 + * + ******************************************************************************/ +package javax.persistence; + +import java.lang.annotation.Target; +import java.lang.annotation.Retention; +import java.lang.annotation.Documented; +import static java.lang.annotation.ElementType.TYPE; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +/** + * Specifies that the class is an entity. This annotation is applied to the + * entity class. + * + * @since Java Persistence 1.0 + */ +@Documented +@Target(TYPE) +@Retention(RUNTIME) +public @interface Entity { + + /** + * (Optional) The entity name. Defaults to the unqualified + * name of the entity class. This name is used to refer to the + * entity in queries. The name must not be a reserved literal + * in the Java Persistence query language. + */ + String name() default ""; +} Index: 3rdParty_sources/persistence-api/javax/persistence/EntityExistsException.java =================================================================== diff -u --- 3rdParty_sources/persistence-api/javax/persistence/EntityExistsException.java (revision 0) +++ 3rdParty_sources/persistence-api/javax/persistence/EntityExistsException.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b) @@ -0,0 +1,77 @@ +/******************************************************************************* + * Copyright (c) 2008 - 2013 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 + * which accompanies this distribution. + * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html + * and the Eclipse Distribution License is available at + * http://www.eclipse.org/org/documents/edl-v10.php. + * + * Contributors: + * Linda DeMichiel - Java Persistence 2.1 + * Linda DeMichiel - Java Persistence 2.0 + * + ******************************************************************************/ +package javax.persistence; + +/** + * Thrown by the persistence provider when {@link EntityManager#persist(Object) + * EntityManager.persist(Object)} is called and the entity already exists. The + * current transaction, if one is active, will be marked for rollback. + *
+ * If the entity already exists, the EntityExistsException
may be thrown when
+ * the persist operation is invoked, or the EntityExistsException
or another
+ * PersistenceException
may be thrown at flush or commit time.
+ *
The current transaction, if one is active and the persistence context
+ * has been joined to it, will be marked for rollback.
+ *
+ * @see javax.persistence.EntityManager#persist(Object)
+ *
+ * @since Java Persistence 1.0
+ */
+public class EntityExistsException extends PersistenceException {
+
+ /**
+ * Constructs a new EntityExistsException
exception with
+ * null
as its detail message.
+ */
+ public EntityExistsException() {
+ super();
+ }
+
+ /**
+ * Constructs a new EntityExistsException
exception with the
+ * specified detail message.
+ *
+ * @param message
+ * the detail message.
+ */
+ public EntityExistsException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructs a new EntityExistsException
exception with the
+ * specified detail message and cause.
+ *
+ * @param message
+ * the detail message.
+ * @param cause
+ * the cause.
+ */
+ public EntityExistsException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Constructs a new EntityExistsException
exception with the
+ * specified cause.
+ *
+ * @param cause
+ * the cause.
+ */
+ public EntityExistsException(Throwable cause) {
+ super(cause);
+ }
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/EntityGraph.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/EntityGraph.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/EntityGraph.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,226 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/
+
+package javax.persistence;
+
+import javax.persistence.metamodel.Attribute;
+import java.util.List;
+
+/**
+ * This type represents the root of an entity graph that will be used
+ * as a template to define the attribute nodes and boundaries of a
+ * graph of entities and entity relationships. The root must be an
+ * entity type.
+ *
+ * The methods to add subgraphs implicitly create the
+ * corresponding attribute nodes as well; such attribute nodes
+ * should not be redundantly specified.
+ *
+ * @param An The set of entities that can be managed by a given
+ * If the entity is found within the persistence context and the
+ * lock mode type is pessimistic and the entity has a version
+ * attribute, the persistence provider must perform optimistic
+ * version checks when obtaining the database lock. If these
+ * checks fail, the If the lock mode type is pessimistic and the entity instance
+ * is found but cannot be locked:
+ * If the entity is found
+ * within the persistence context and the lock mode type
+ * is pessimistic and the entity has a version attribute, the
+ * persistence provider must perform optimistic version checks
+ * when obtaining the database lock. If these checks fail,
+ * the If the lock mode type is pessimistic and the entity instance
+ * is found but cannot be locked:
+ * If a vendor-specific property or hint is not recognized,
+ * it is silently ignored.
+ * Portable applications should not rely on the standard timeout
+ * hint. Depending on the database in use and the locking
+ * mechanisms used by the provider, the hint may or may not
+ * be observed.
+ * @param entityClass entity class
+ * @param primaryKey primary key
+ * @param lockMode lock mode
+ * @param properties standard and vendor-specific properties
+ * and hints
+ * @return the found entity instance or null if the entity does
+ * not exist
+ * @throws IllegalArgumentException if the first argument does
+ * not denote an entity type or the second argument is
+ * not a valid type for that entity's primary key or
+ * is null
+ * @throws TransactionRequiredException if there is no
+ * transaction and a lock mode other than If a pessimistic lock mode type is specified and the entity
+ * contains a version attribute, the persistence provider must
+ * also perform optimistic version checks when obtaining the
+ * database lock. If these checks fail, the
+ * If the lock mode type is pessimistic and the entity instance
+ * is found but cannot be locked:
+ * If a pessimistic lock mode type is specified and the entity
+ * contains a version attribute, the persistence provider must
+ * also perform optimistic version checks when obtaining the
+ * database lock. If these checks fail, the
+ * If the lock mode type is pessimistic and the entity instance
+ * is found but cannot be locked:
+ * If a vendor-specific property or hint is not recognized,
+ * it is silently ignored.
+ * Portable applications should not rely on the standard timeout
+ * hint. Depending on the database in use and the locking
+ * mechanisms used by the provider, the hint may or may not
+ * be observed.
+ * @param entity entity instance
+ * @param lockMode lock mode
+ * @param properties standard and vendor-specific properties
+ * and hints
+ * @throws IllegalArgumentException if the instance is not an
+ * entity or is a detached entity
+ * @throws TransactionRequiredException if there is no
+ * transaction or if invoked on an entity manager which
+ * has not been joined to the current transaction
+ * @throws EntityNotFoundException if the entity does not exist
+ * in the database when pessimistic locking is
+ * performed
+ * @throws OptimisticLockException if the optimistic version
+ * check fails
+ * @throws PessimisticLockException if pessimistic locking fails
+ * and the transaction is rolled back
+ * @throws LockTimeoutException if pessimistic locking fails and
+ * only the statement is rolled back
+ * @throws PersistenceException if an unsupported lock call
+ * is made
+ * @since Java Persistence 2.0
+ */
+ public void lock(Object entity, LockModeType lockMode,
+ Map If a vendor-specific property or hint is not recognized,
+ * it is silently ignored.
+ * @param entity entity instance
+ * @param properties standard and vendor-specific properties
+ * and hints
+ * @throws IllegalArgumentException if the instance is not
+ * an entity or the entity is not managed
+ * @throws TransactionRequiredException if there is no
+ * transaction when invoked on a container-managed
+ * entity manager of type If the lock mode type is pessimistic and the entity instance
+ * is found but cannot be locked:
+ * If the lock mode type is pessimistic and the entity instance
+ * is found but cannot be locked:
+ * If a vendor-specific property or hint is not recognized,
+ * it is silently ignored.
+ * Portable applications should not rely on the standard timeout
+ * hint. Depending on the database in use and the locking
+ * mechanisms used by the provider, the hint may or may not
+ * be observed.
+ * @param entity entity instance
+ * @param lockMode lock mode
+ * @param properties standard and vendor-specific properties
+ * and hints
+ * @throws IllegalArgumentException if the instance is not
+ * an entity or the entity is not managed
+ * @throws TransactionRequiredException if invoked on a
+ * container-managed entity manager of type
+ * Parameters must be registered before the stored procedure can
+ * be executed.
+ * If the stored procedure returns one or more result sets,
+ * any result set will be returned as a list of type Object[].
+ * @param name name assigned to the stored procedure query
+ * in metadata
+ * @return the new stored procedure query instance
+ * @throws IllegalArgumentException if a query has not been
+ * defined with the given name
+ * @since Java Persistence 2.1
+ */
+ public StoredProcedureQuery createNamedStoredProcedureQuery(String name);
+
+ /**
+ * Create an instance of Parameters must be registered before the stored procedure can
+ * be executed.
+ * If the stored procedure returns one or more result sets,
+ * any result set will be returned as a list of type Object[].
+ * @param procedureName name of the stored procedure in the
+ * database
+ * @return the new stored procedure query instance
+ * @throws IllegalArgumentException if a stored procedure of the
+ * given name does not exist (or the query execution will
+ * fail)
+ * @since Java Persistence 2.1
+ */
+ public StoredProcedureQuery createStoredProcedureQuery(String procedureName);
+
+ /**
+ * Create an instance of Parameters must be registered before the stored procedure can
+ * be executed.
+ * The Parameters must be registered before the stored procedure can
+ * be executed.
+ * The This method should be called on a JTA application
+ * managed entity manager that was created outside the scope
+ * of the active transaction or on an entity manager of type
+ * The When the application has finished using the entity manager
+ * factory, and/or at application shutdown, the application should
+ * close the entity manager factory. Once an
+ * Any configuration of the query object (except for actual
+ * parameter binding) in effect when the named query is added
+ * is retained as part of the named query definition.
+ * This includes configuration information such as max results,
+ * hints, flush mode, lock mode, result set mapping information,
+ * and information about stored procedure parameters.
+ * When the query is executed, information that can be set
+ * by means of the query APIs can be overridden. Information
+ * that is overridden does not affect the named query as
+ * registered with the entity manager factory, and thus does
+ * not affect subsequent query objects created from it by
+ * means of the If a named query of the same name has been previously
+ * defined, either statically via metadata or via this method,
+ * that query definition is replaced.
+ *
+ * @param name name for the query
+ * @param query Query, TypedQuery, or StoredProcedureQuery object
+ *
+ * @since Java Persistence 2.1
+ */
+ public void addNamedQuery(String name, Query query);
+
+ /**
+ * Return an object of the specified type to allow access to the
+ * provider-specific API. If the provider's EntityManagerFactory
+ * implementation does not support the specified class, the
+ * PersistenceException is thrown.
+ * @param cls the class of the object to be returned. This is
+ * normally either the underlying EntityManagerFactory
+ * implementation class or an interface that it implements.
+ * @return an instance of the specified class
+ * @throws PersistenceException if the provider does not
+ * support the call
+ * @since Java Persistence 2.1
+ */
+ public The current transaction, if one is active and the persistence context
+ * has been joined to it, will be marked for rollback.
+ *
+ * @see EntityManager#getReference(Class,Object)
+ * @see EntityManager#refresh(Object)
+ * @see EntityManager#refresh(Object, LockModeType)
+ * @see EntityManager#refresh(Object, java.util.Map)
+ * @see EntityManager#refresh(Object, LockModeType, java.util.Map)
+ * @see EntityManager#lock(Object, LockModeType)
+ * @see EntityManager#lock(Object, LockModeType, java.util.Map)
+ *
+ * @since Java Persistence 1.0
+ */
+public class EntityNotFoundException extends PersistenceException {
+
+ /**
+ * Constructs a new If this annotation is used, the SQL statement should select
+ * all of the columns that are mapped to the entity object.
+ * This should include foreign key columns to related entities.
+ * The results obtained when insufficient data is available
+ * are undefined.
+ *
+ * When queries are executed within a transaction, if
+ * If If there is no transaction active or the persistence context is not
+ * joined to the current transaction, the persistence provider must not flush
+ * to the database.
+ *
+ * @since Java Persistence 1.0
+ */
+public enum FlushModeType {
+
+ /** Flushing to occur at transaction commit. The provider may flush
+ * at other times, but is not required to.
+ */
+ COMMIT,
+
+ /** (Default) Flushing to occur at query execution. */
+ AUTO
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/ForeignKey.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/ForeignKey.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/ForeignKey.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,94 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2017 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+import static javax.persistence.ConstraintMode.CONSTRAINT;
+
+/**
+ * Used to specify the handling of foreign key constraints when schema
+ * generation is in effect. If this annotation is not specified, the
+ * persistence provider's default foreign key strategy will be used.
+ *
+ * The
+ * The syntax used in the
+ * A value of
+ * A value of
+ * A value of The Defaults to the id generator supplied by persistence provider.
+ */
+ String generator() default "";
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/GenerationType.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/GenerationType.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/GenerationType.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * Defines the types of primary key generation strategies.
+ *
+ * @see GeneratedValue
+ *
+ * @since Java Persistence 1.0
+ */
+public enum GenerationType {
+
+ /**
+ * Indicates that the persistence provider must assign
+ * primary keys for the entity using an underlying
+ * database table to ensure uniqueness.
+ */
+ TABLE,
+
+ /**
+ * Indicates that the persistence provider must assign
+ * primary keys for the entity using a database sequence.
+ */
+ SEQUENCE,
+
+ /**
+ * Indicates that the persistence provider must assign
+ * primary keys for the entity using a database identity column.
+ */
+ IDENTITY,
+
+ /**
+ * Indicates that the persistence provider should pick an
+ * appropriate strategy for the particular database. The
+ * The mapped column for the primary key of the entity is assumed
+ * to be the primary key of the primary table. If no The names of the fields or properties in the primary key
+ * class and the primary key fields or properties of the entity
+ * must correspond and their types must be the same.
+ *
+ *
+ * Note that it is not necessary to specify an index for a primary key,
+ * as the primary key index will be created automatically.
+ *
+ *
+ * The syntax of the If Default (only applies if a single join column is used):
+ * The concatenation of the following: the name of the
+ * referencing relationship property or field of the referencing
+ * entity or embeddable class; "_"; the name of the referenced
+ * primary key column.
+ * If there is no such referencing relationship property or
+ * field in the entity, or if the join is for an element collection,
+ * the join column name is formed as the
+ * concatenation of the following: the name of the entity; "_";
+ * the name of the referenced primary key column.
+ */
+ String name() default "";
+
+ /**
+ * (Optional) The name of the column referenced by this foreign
+ * key column.
+ * Default (only applies if single join column is being
+ * used): The same name as the primary key column of the
+ * referenced table.
+ */
+ String referencedColumnName() default "";
+
+ /**
+ * (Optional) Whether the property is a unique key. This is a
+ * shortcut for the Defaults to the generated SQL for the column.
+ */
+ String columnDefinition() default "";
+
+ /**
+ * (Optional) The name of the table that contains
+ * the column. If a table is not specified, the column
+ * is assumed to be in the primary table of the
+ * applicable entity.
+ *
+ * Default:
+ * When the A join table is typically used in the mapping of many-to-many
+ * and unidirectional one-to-many associations. It may also be used to
+ * map bidirectional many-to-one/one-to-many associations,
+ * unidirectional many-to-one relationships, and one-to-one
+ * associations (both bidirectional and unidirectional).
+ *
+ * When a join table is used in mapping a relationship with an
+ *embeddable class on the owning side of the relationship, the
+ *containing entity rather than the embeddable class is considered the
+ *owner of the relationship.
+ *
+ * If the Defaults to the concatenated names of
+ * the two associated primary entity tables,
+ * separated by an underscore.
+ */
+ String name() default "";
+
+ /** (Optional) The catalog of the table.
+ * Defaults to the default catalog.
+ */
+ String catalog() default "";
+
+ /** (Optional) The schema of the table.
+ * Defaults to the default schema for user.
+ */
+ String schema() default "";
+
+ /**
+ * (Optional) The foreign key columns
+ * of the join table which reference the
+ * primary table of the entity owning the
+ * association. (I.e. the owning side of
+ * the association).
+ *
+ * Uses the same defaults as for {@link JoinColumn}.
+ */
+ JoinColumn[] joinColumns() default {};
+
+ /**
+ * (Optional) The foreign key columns
+ * of the join table which reference the
+ * primary table of the entity that does
+ * not own the association. (I.e. the
+ * inverse side of the association).
+ *
+ * Uses the same defaults as for {@link JoinColumn}.
+ */
+ JoinColumn[] inverseJoinColumns() default {};
+
+ /**
+ * (Optional) Used to specify or control the generation of a
+ * foreign key constraint for the columns corresponding to the
+ * Defaults to no additional constraints.
+ */
+ UniqueConstraint[] uniqueConstraints() default {};
+
+ /**
+ * (Optional) Indexes for the table. These are only used if
+ * table generation is in effect.
+ *
+ * @since Java Persistence 2.1
+ */
+ Index[] indexes() default {};
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/Lob.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/Lob.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/Lob.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,62 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies that a persistent property or field should be persisted
+ * as a large object to a database-supported large object type.
+ *
+ * Portable applications should use the The Lock modes can be used to specify either optimistic or pessimistic locks.
+ *
+ * Optimistic locks are specified using {@link
+ * LockModeType#OPTIMISTIC LockModeType.OPTIMISTIC} and {@link
+ * LockModeType#OPTIMISTIC_FORCE_INCREMENT
+ * LockModeType.OPTIMISTIC_FORCE_INCREMENT}. The lock mode type
+ * values {@link LockModeType#READ LockModeType.READ} and
+ * {@link LockModeType#WRITE LockModeType.WRITE} are
+ * synonyms of The semantics of requesting locks of type
+ * If transaction T1 calls for a lock of type
+ * Lock modes must always prevent the phenomena P1 and P2.
+ *
+ * In addition, calling a lock of type
+ * The persistence implementation is not required to support
+ * the use of optimistic lock modes on non-versioned objects. When it
+ * cannot support a such lock call, it must throw the {@link
+ * PersistenceException}.
+ *
+ * The lock modes {@link LockModeType#PESSIMISTIC_READ
+ * LockModeType.PESSIMISTIC_READ}, {@link
+ * LockModeType#PESSIMISTIC_WRITE LockModeType.PESSIMISTIC_WRITE}, and
+ * {@link LockModeType#PESSIMISTIC_FORCE_INCREMENT
+ * LockModeType.PESSIMISTIC_FORCE_INCREMENT} are used to immediately
+ * obtain long-term database locks.
+ *
+ * The semantics of requesting locks of type
+ * If transaction T1 calls for a lock of type
+ * A lock with The persistence implementation must support use of locks of type
+ * When the lock cannot be obtained, and the database locking
+ * failure results in transaction-level rollback, the provider must
+ * throw the {@link PessimisticLockException} and ensure that the JTA
+ * transaction or When the lock cannot be obtained, and the database locking
+ * failure results in only statement-level rollback, the provider must
+ * throw the {@link LockTimeoutException} (and must not mark the transaction
+ * for rollback).
+ *
+ * @since Java Persistence 1.0
+ *
+ */
+public enum LockModeType
+{
+ /**
+ * Synonymous with Every many-to-many association has two sides, the owning side
+ * and the non-owning, or inverse, side. The join table is specified
+ * on the owning side. If the association is bidirectional, either
+ * side may be designated as the owning side. If the relationship is
+ * bidirectional, the non-owning side must use the The join table for the relationship, if not defaulted, is
+ * specified on the owning side.
+ *
+ * The Defaults to the parameterized type of
+ * the collection when defined using generics.
+ */
+ Class targetEntity() default void.class;
+
+ /**
+ * (Optional) The operations that must be cascaded to the target
+ * of the association.
+ *
+ * When the target collection is a {@link java.util.Map
+ * java.util.Map}, the Defaults to no operations being cascaded.
+ */
+ CascadeType[] cascade() default {};
+
+ /** (Optional) Whether the association should be lazily loaded or
+ * must be eagerly fetched. The EAGER strategy is a requirement on
+ * the persistence provider runtime that the associated entities
+ * must be eagerly fetched. The LAZY strategy is a hint to the
+ * persistence provider runtime.
+ */
+ FetchType fetch() default LAZY;
+
+ /**
+ * The field that owns the relationship. Required unless
+ * the relationship is unidirectional.
+ */
+ String mappedBy() default "";
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/ManyToOne.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/ManyToOne.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/ManyToOne.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import javax.persistence.CascadeType;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.FetchType.EAGER;
+
+/**
+ * Specifies a single-valued association to another entity class that
+ * has many-to-one multiplicity. It is not normally necessary to
+ * specify the target entity explicitly since it can usually be
+ * inferred from the type of the object being referenced. If the
+ * relationship is bidirectional, the non-owning
+ * The Defaults to the type of the field or property
+ * that stores the association.
+ */
+ Class targetEntity() default void.class;
+
+ /**
+ * (Optional) The operations that must be cascaded to
+ * the target of the association.
+ *
+ * By default no operations are cascaded.
+ */
+ CascadeType[] cascade() default {};
+
+ /**
+ * (Optional) Whether the association should be lazily
+ * loaded or must be eagerly fetched. The EAGER
+ * strategy is a requirement on the persistence provider runtime that
+ * the associated entity must be eagerly fetched. The LAZY
+ * strategy is a hint to the persistence provider runtime.
+ */
+ FetchType fetch() default EAGER;
+
+ /**
+ * (Optional) Whether the association is optional. If set
+ * to false then a non-null relationship must always exist.
+ */
+ boolean optional() default true;
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/MapKey.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/MapKey.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/MapKey.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,99 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies the map key for associations of type
+ * {@link java.util.Map java.util.Map} when the map key is itself the primary
+ * key or a persistent field or property of the entity that is
+ * the value of the map.
+ *
+ * If a persistent field or property other than the primary
+ * key is used as a map key then it is expected to have a
+ * uniqueness constraint associated with it.
+ *
+ * The {@link MapKeyClass} annotation is not used when
+ * Default: If the
+ * The Defaults to the concatenation of the following: the name of
+ * the referencing relationship field or property; "_"; " Defaults to the generated SQL to create a
+ * column of the inferred type.
+ *
+ */
+ String columnDefinition() default "";
+
+ /** (Optional) The name of the table that contains the column.
+ *
+ * Defaults: If the map key is for an element collection,
+ * the name of the collection table for the map value. If the
+ * map key is for a OneToMany or ManyToMany entity
+ * relationship using a join table, the name of the join table
+ * for the map. If the map key is for a OneToMany entity
+ * relationship using a foreign key mapping strategy, the name
+ * of the primary table of the entity that is the value of the
+ * map.
+ */
+ String table() default "";
+
+ /**
+ * (Optional) The column length. (Applies only if a string-valued column is
+ * used.)
+ */
+ int length() default 255;
+
+ /**
+ * (Optional) The precision for a decimal (exact numeric) column. (Applies
+ * only if a decimal column is used.)
+ *
+ * Default: 0. (The value must be set by the developer.)
+ */
+ int precision() default 0; // decimal precision
+
+ /**
+ * (Optional) The scale for a decimal (exact numeric) column. (Applies only
+ * if a decimal column is used.)
+ */
+ int scale() default 0; // decimal scale
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/MapKeyEnumerated.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/MapKeyEnumerated.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/MapKeyEnumerated.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.EnumType.ORDINAL;
+
+/**
+ * Specifies the enum type for a map key whose basic type is an enumerated type.
+ *
+ * The Default (only applies if a single join column is used.)
+ * The concatenation of the following: the name of the
+ * referencing relationship property or field of the
+ * referencing entity or embeddable class; "_"; "KEY".
+ */
+ String name() default "";
+
+ /**
+ * (Optional) The name of the column referenced by this foreign key column.
+ * The referenced column is in the table of the target entity.
+ *
+ * Default (only applies if single join column is being
+ * used.) The same name as the primary key column of the
+ * referenced table
+ */
+ String referencedColumnName() default "";
+
+ /**
+ * (Optional) Whether the property is a unique key. This is a
+ * shortcut for the Default:
+ * The The A class designated with the The value of this element is the name of the subgraph as
+ * specified by the The value of this element is the name of the key subgraph as
+ * specified by the The following is an example of the definition of a named query
+ * in the Java Persistence query language:
+ *
+ * The following is an example of the use of a named query:
+ *
+ * The The The The parameters of the stored procedure are specified by the
+ * The If there are multiple result sets, it is assumed that they will be
+ * mapped using the same mechanism — e.g., either all via a set of
+ * result class mappings or all via a set of result set mappings. The
+ * order of the specification of these mappings must be the same as
+ * the order in which the result sets will be returned by the stored
+ * procedure invocation. If the stored procedure returns one or more
+ * result sets and no The All parameters of a named stored procedure query must be specified
+ * using the If the collection is defined using generics to specify the
+ * element type, the associated target entity type need not be
+ * specified; otherwise the target entity class must be specified.
+ * If the relationship is bidirectional, the
+ * The Defaults to the parameterized type of
+ * the collection when defined using generics.
+ */
+ Class targetEntity() default void.class;
+
+ /**
+ * (Optional) The operations that must be cascaded to
+ * the target of the association.
+ * Defaults to no operations being cascaded.
+ *
+ * When the target collection is a {@link java.util.Map
+ * java.util.Map}, the The Defaults to the type of the field or property
+ * that stores the association.
+ */
+ Class targetEntity() default void.class;
+
+ /**
+ * (Optional) The operations that must be cascaded to
+ * the target of the association.
+ *
+ * By default no operations are cascaded.
+ */
+ CascadeType[] cascade() default {};
+
+ /**
+ * (Optional) Whether the association should be lazily
+ * loaded or must be eagerly fetched. The EAGER
+ * strategy is a requirement on the persistence provider runtime that
+ * the associated entity must be eagerly fetched. The LAZY
+ * strategy is a hint to the persistence provider runtime.
+ */
+ FetchType fetch() default EAGER;
+
+ /**
+ * (Optional) Whether the association is optional. If set
+ * to false then a non-null relationship must always exist.
+ */
+ boolean optional() default true;
+
+ /** (Optional) The field that owns the relationship. This
+ * element is only specified on the inverse (non-owning)
+ * side of the association.
+ */
+ String mappedBy() default "";
+
+
+ /**
+ * (Optional) Whether to apply the remove operation to entities that have
+ * been removed from the relationship and to cascade the remove operation to
+ * those entities.
+ * @since Java Persistence 2.0
+ */
+ boolean orphanRemoval() default false;
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/OptimisticLockException.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/OptimisticLockException.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/OptimisticLockException.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,117 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * Thrown by the persistence provider when an optimistic locking conflict
+ * occurs. This exception may be thrown as part of an API call, a flush or at
+ * commit time. The current transaction, if one is active, will be marked for
+ * rollback.
+ *
+ * @see EntityManager#find(Class, Object, LockModeType)
+ * @see EntityManager#find(Class, Object, LockModeType, java.util.Map)
+ * @see EntityManager#lock(Object, LockModeType)
+ * @see EntityManager#lock(Object, LockModeType, java.util.Map)
+ *
+ * @since Java Persistence 1.0
+ */
+public class OptimisticLockException extends PersistenceException {
+
+ /**
+ * The object that caused the exception
+ */
+ Object entity;
+
+ /**
+ * Constructs a new The syntax of the If If the ordering element is not specified for an entity association,
+ * ordering by the primary key of the associated entity is assumed.
+ *
+ * The property or field name must correspond to that of a
+ * persistent property or field of the associated class or embedded class
+ * within it. The properties or fields used in the ordering must correspond to
+ * columns for which comparison operators are supported.
+ *
+ * The dot (".") notation is used to refer to an attribute within an
+ * embedded attribute. The value of each identifier used with the dot
+ * notation is the name of the respective embedded field or property.
+ *
+ * The The If If the ordering element is not specified, ordering by
+ * the primary key of the associated entity is assumed.
+ */
+ String value() default "";
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/OrderColumn.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/OrderColumn.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/OrderColumn.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies a column that is used to maintain the persistent order of
+ * a list. The persistence provider is responsible for maintaining the
+ * order upon retrieval and in the database. The persistence provider
+ * is responsible for updating the ordering upon flushing to the
+ * database to reflect any insertion, deletion, or reordering
+ * affecting the list.
+ *
+ * The The {@link OrderBy} annotation should be used for ordering that
+ * is visible as persistent state and maintained by the
+ * application. The The order column must be of integral type. The persistence
+ * provider maintains a contiguous (non-sparse) ordering of the values
+ * of the order column when updating the association or element collection.
+ * The order column value for the first element is 0.
+ *
+ * The The
+ * Called when schema generation is to occur as a separate phase
+ * from creation of the entity manager factory.
+ *
+ * @param persistenceUnitName the name of the persistence unit
+ * @param map properties for schema generation; these may
+ * also contain provider-specific properties. The
+ * value of these properties override any values that
+ * may have been configured elsewhere..
+ * @throws PersistenceException if insufficient or inconsistent
+ * configuration information is provided or if schema
+ * generation otherwise fails.
+ *
+ * @since Java Persistence 2.1
+ */
+ public static void generateSchema(String persistenceUnitName, Map map) {
+ PersistenceProviderResolver resolver = PersistenceProviderResolverHolder.getPersistenceProviderResolver();
+ List Vendor specific properties may be included in the set of
+ * properties, and are passed to the persistence provider by the
+ * container when the entity manager is created. Properties that
+ * are not recognized by a vendor will be ignored.
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({})
+@Retention(RUNTIME)
+public @interface PersistenceProperty {
+
+ /** The name of the property */
+ String name();
+
+ /** The value of the property */
+ String value();
+
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/PersistenceUnit.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/PersistenceUnit.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/PersistenceUnit.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * 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;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * Expresses a dependency on an {@link EntityManagerFactory} and its
+ * associated persistence unit.
+ *
+ * @since Java Persistence 1.0
+ */
+@Repeatable(PersistenceUnits.class)
+@Target({TYPE, METHOD, FIELD})
+@Retention(RUNTIME)
+public @interface PersistenceUnit {
+
+ /**
+ * (Optional) The name by which the entity manager factory is to be accessed
+ * in the environment referencing context; not needed when
+ * dependency injection is used.
+ */
+ String name() default "";
+
+ /**
+ * (Optional) The name of the persistence unit as defined in the
+ * The methods of this interface should only be invoked on entity
+ * instances obtained from or managed by entity managers for this
+ * persistence unit or on new entity instances.
+ *
+ * @since Java Persistence 2.0
+ */
+public interface PersistenceUnitUtil extends PersistenceUtil {
+
+ /**
+ * Determine the load state of a given persistent attribute
+ * of an entity belonging to the persistence unit.
+ * @param entity entity instance containing the attribute
+ * @param attributeName name of attribute whose load state is
+ * to be determined
+ * @return false if entity's state has not been loaded or if
+ * the attribute state has not been loaded, else true
+ */
+ public boolean isLoaded(Object entity, String attributeName);
+
+ /**
+ * Determine the load state of an entity belonging to the
+ * persistence unit. This method can be used to determine the
+ * load state of an entity passed as a reference. An entity is
+ * considered loaded if all attributes for which
+ * The The The The persistence provider must lock the database row(s) that
+ * correspond to the non-collection-valued persistent state of
+ * that instance. If a joined inheritance strategy is used, or if
+ * the entity is otherwise mapped to a secondary table, this
+ * entails locking the row(s) for the entity instance in the
+ * additional table(s). Entity relationships for which the locked
+ * entity contains the foreign key will also be locked, but not
+ * the state of the referenced entities (unless those entities are
+ * explicitly locked). Element collections and relationships for
+ * which the entity does not contain the foreign key (such as
+ * relationships that are mapped to join tables or unidirectional
+ * one-to-many relationships for which the target entity contains
+ * the foreign key) will not be locked by default.
+ */
+ NORMAL,
+
+ /**
+ * In addition to the behavior for
+ * It is used to join the primary table of an entity subclass
+ * in the {@link InheritanceType#JOINED JOINED} mapping strategy
+ * to the primary table of its superclass; it is used within a
+ * {@link SecondaryTable} annotation to join a secondary table
+ * to a primary table; and it may be used in a {@link OneToOne}
+ * mapping in which the primary key of the referencing entity
+ * is used as a foreign key to the referenced entity.
+ *
+ * If no Defaults to the same name as the primary key column
+ * of the primary table of the superclass ( Defaults to the same name as the primary
+ * key column of the primary table of the superclass
+ * ( Defaults to the generated SQL to create a column of the
+ * inferred type.
+ */
+ String columnDefinition() default "";
+
+ /**
+ * (Optional) Used to specify or control the generation of a
+ * foreign key constraint for the primary key join column
+ * when table generation is in effect. If
+ * this element is not specified, the persistence provider's
+ * default foreign key strategy will apply.
+ *
+ * @since Java Persistence 2.1
+ */
+ ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT);
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/PrimaryKeyJoinColumns.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/PrimaryKeyJoinColumns.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/PrimaryKeyJoinColumns.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.ConstraintMode.PROVIDER_DEFAULT;
+
+/**
+ * Groups {@link PrimaryKeyJoinColumn} annotations.
+ * It is used to map composite foreign keys.
+ *
+ * Vendor-specific hints that are not recognized by a provider are ignored.
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({})
+@Retention(RUNTIME)
+public @interface QueryHint {
+
+ /** Name of the hint. */
+ String name();
+
+ /** Value of the hint. */
+ String value();
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/QueryTimeoutException.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/QueryTimeoutException.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/QueryTimeoutException.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,98 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * Thrown by the persistence provider when a query times out
+ * and only the statement is rolled back.
+ * The current transaction, if one is active, will be not
+ * be marked for rollback.
+ *
+ * @since Java Persistence 2.0
+ */
+public class QueryTimeoutException extends PersistenceException {
+
+ /** The query object that caused the exception */
+ Query query;
+
+ /**
+ * Constructs a new If no Defaults to the default catalog.
+ */
+ String catalog() default "";
+
+ /** (Optional) The schema of the table.
+ * Defaults to the default schema for user.
+ */
+ String schema() default "";
+
+ /**
+ * (Optional) The columns that are used to join with
+ * the primary table.
+ * Defaults to the column(s) of the same name(s)
+ * as the primary key column(s) in the primary table.
+ */
+ PrimaryKeyJoinColumn[] pkJoinColumns() default {};
+
+ /**
+ * (Optional) Used to specify or control the generation of a
+ * foreign key constraint for the columns corresponding to the
+ * Defaults to no additional constraints.
+ */
+ UniqueConstraint[] uniqueConstraints() default {};
+
+ /**
+ * (Optional) Indexes for the table. These are only used if
+ * table generation is in effect.
+ *
+ * @since Java Persistence 2.1
+ */
+ Index[] indexes() default {};
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/SecondaryTables.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/SecondaryTables.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/SecondaryTables.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,60 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies multiple secondary tables for an entity.
+ *
+ * Defaults to a provider-chosen value.
+ */
+ String sequenceName() default "";
+
+ /** (Optional) The catalog of the sequence generator.
+ *
+ * @since Java Persistence 2.0
+ */
+ String catalog() default "";
+
+ /** (Optional) The schema of the sequence generator.
+ *
+ * @since Java Persistence 2.0
+ */
+ String schema() default "";
+
+ /**
+ * (Optional) The value from which the sequence object
+ * is to start generating.
+ */
+ int initialValue() default 1;
+
+ /**
+ * (Optional) The amount to increment by when allocating
+ * sequence numbers from the sequence.
+ */
+ int allocationSize() default 50;
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/SequenceGenerators.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/SequenceGenerators.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/SequenceGenerators.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2017 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Lukas Jungmann - Java Persistence 2.2
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Used to group
+ * Stored procedure query execution may be controlled in accordance with
+ * the following:
+ * If no Defaults to the entity name.
+ */
+ String name() default "";
+
+ /** (Optional) The catalog of the table.
+ * Defaults to the default catalog.
+ */
+ String catalog() default "";
+
+ /** (Optional) The schema of the table.
+ * Defaults to the default schema for user.
+ */
+ String schema() default "";
+
+ /**
+ * (Optional) Unique constraints that are to be placed on
+ * the table. These are only used if table generation is in
+ * effect. These constraints apply in addition to any constraints
+ * specified by the Defaults to no additional constraints.
+ */
+ UniqueConstraint[] uniqueConstraints() default {};
+
+ /**
+ * (Optional) Indexes for the table. These are only used if
+ * table generation is in effect. Note that it is not necessary
+ * to specify an index for a primary key, as the primary key
+ * index will be created automatically.
+ *
+ * @since Java Persistence 2.1
+ */
+ Index[] indexes() default {};
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/TableGenerator.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/TableGenerator.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/TableGenerator.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,152 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2017 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Lukas Jungmann - Java Persistence 2.2
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Repeatable;
+
+/**
+ * Defines a primary key generator that may be
+ * referenced by name when a generator element is specified for
+ * the {@link GeneratedValue} annotation. A table generator
+ * may be specified on the entity class or on the primary key
+ * field or property. The scope of the generator name is global
+ * to the persistence unit (across all generator types).
+ *
+ * Defaults to a name chosen by persistence provider.
+ */
+ String table() default "";
+
+ /** (Optional) The catalog of the table.
+ * Defaults to the default catalog.
+ */
+ String catalog() default "";
+
+ /** (Optional) The schema of the table.
+ * Defaults to the default schema for user.
+ */
+ String schema() default "";
+
+ /**
+ * (Optional) Name of the primary key column in the table.
+ * Defaults to a provider-chosen name.
+ */
+ String pkColumnName() default "";
+
+ /**
+ * (Optional) Name of the column that stores the last value generated.
+ * Defaults to a provider-chosen name.
+ */
+ String valueColumnName() default "";
+
+ /**
+ * (Optional) The primary key value in the generator table
+ * that distinguishes this set of generated values from others
+ * that may be stored in the table.
+ * Defaults to a provider-chosen value to store in the
+ * primary key column of the generator table
+ */
+ String pkColumnValue() default "";
+
+ /**
+ * (Optional) The initial value to be used to initialize the column
+ * that stores the last value generated.
+ */
+ int initialValue() default 0;
+
+ /**
+ * (Optional) The amount to increment by when allocating id
+ * numbers from the generator.
+ */
+ int allocationSize() default 50;
+
+ /**
+ * (Optional) Unique constraints that are to be placed on the
+ * table. These are only used if table generation is in effect.
+ * These constraints apply in addition to primary key constraints.
+ * Defaults to no additional constraints.
+ */
+ UniqueConstraint[] uniqueConstraints() default {};
+
+ /**
+ * (Optional) Indexes for the table. These are only used if
+ * table generation is in effect. Note that it is not necessary
+ * to specify an index for a primary key, as the primary key
+ * index will be created automatically.
+ *
+ * @since Java Persistence 2.1
+ */
+ Index[] indexes() default {};
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/TableGenerators.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/TableGenerators.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/TableGenerators.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,36 @@
+/*******************************************************************************
+ * Copyright (c) 2017 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Lukas Jungmann - Java Persistence 2.2
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Used to group The Only a single The The following types are supported for version properties:
+ * All queries must have:
+ * a set of root entities (which may in turn own joins).
+ * All queries may have:
+ * a conjunction of restrictions.
+ *
+ * @param Note that criteria queries and criteria update and delete operations
+ * are typed differently.
+ * Criteria queries are typed according to the query result type.
+ * Update and delete operations are typed according to the target of the
+ * update or delete.
+ *
+ * @since Java Persistence 2.1
+ */
+public interface CommonAbstractCriteria {
+
+ /**
+ * Create a subquery of the query.
+ * @param type the subquery result type
+ * @return subquery
+ */
+ Subquery subquery(Class type);
+
+ /**
+ * Return the predicate that corresponds to the where clause
+ * restriction(s), or null if no restrictions have been
+ * specified.
+ * @return where clause predicate
+ */
+ Predicate getRestriction();
+
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/criteria/CompoundSelection.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/criteria/CompoundSelection.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/criteria/CompoundSelection.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence.criteria;
+
+/**
+ * The Note that NamedEntityGraph
+ * annotation, XML descriptor element, or added by means of the
+ * addNamedEntityGraph
method. Returns null if the
+ * EntityGraph is not a named EntityGraph.
+ */
+ public String getName();
+
+ /**
+ * Add one or more attribute nodes to the entity graph.
+ *
+ * @param attributeName name of the attribute
+ * @throws IllegalArgumentException if the attribute is not an
+ * attribute of this entity.
+ * @throws IllegalStateException if the EntityGraph has been
+ * statically defined
+ */
+ public void addAttributeNodes(String ... attributeName);
+
+ /**
+ * Add one or more attribute nodes to the entity graph.
+ *
+ * @param attribute attribute
+ * @throws IllegalStateException if the EntityGraph has been
+ * statically defined
+ */
+ public void addAttributeNodes(AttributeEntityManager
instance is associated with
+ * a persistence context. A persistence context is a set of entity
+ * instances in which for any persistent entity identity there is
+ * a unique entity instance. Within the persistence context, the
+ * entity instances and their lifecycle are managed.
+ * The EntityManager
API is used
+ * to create and remove persistent entity instances, to find entities
+ * by their primary key, and to query over entities.
+ *
+ * EntityManager
instance is defined by a persistence
+ * unit. A persistence unit defines the set of all classes that are
+ * related or grouped by the application, and which must be
+ * colocated in their mapping to a single database.
+ *
+ * @see Query
+ * @see TypedQuery
+ * @see CriteriaQuery
+ * @see PersistenceContext
+ * @see StoredProcedureQuery
+ *
+ * @since Java Persistence 1.0
+ */
+public interface EntityManager {
+
+ /**
+ * Make an instance managed and persistent.
+ * @param entity entity instance
+ * @throws EntityExistsException if the entity already exists.
+ * (If the entity already exists, the EntityExistsException
may
+ * be thrown when the persist operation is invoked, or the
+ * EntityExistsException
or another PersistenceException
may be
+ * thrown at flush or commit time.)
+ * @throws IllegalArgumentException if the instance is not an
+ * entity
+ * @throws TransactionRequiredException if there is no transaction when
+ * invoked on a container-managed entity manager of that is of type
+ * PersistenceContextType.TRANSACTION
+ */
+ public void persist(Object entity);
+
+ /**
+ * Merge the state of the given entity into the
+ * current persistence context.
+ * @param entity entity instance
+ * @return the managed instance that the state was merged to
+ * @throws IllegalArgumentException if instance is not an
+ * entity or is a removed entity
+ * @throws TransactionRequiredException if there is no transaction when
+ * invoked on a container-managed entity manager of that is of type
+ * PersistenceContextType.TRANSACTION
+ */
+ public PersistenceContextType.TRANSACTION
and there is
+ * no transaction
+ */
+ public void remove(Object entity);
+
+ /**
+ * Find by primary key.
+ * Search for an entity of the specified class and primary key.
+ * If the entity instance is contained in the persistence context,
+ * it is returned from there.
+ * @param entityClass entity class
+ * @param primaryKey primary key
+ * @return the found entity instance or null if the entity does
+ * not exist
+ * @throws IllegalArgumentException if the first argument does
+ * not denote an entity type or the second argument is
+ * is not a valid type for that entity's primary key or
+ * is null
+ */
+ public OptimisticLockException
will be thrown.
+ *
+ *
+ * @param entityClass entity class
+ * @param primaryKey primary key
+ * @param lockMode lock mode
+ * @return the found entity instance or null if the entity does
+ * not exist
+ * @throws IllegalArgumentException if the first argument does
+ * not denote an entity type or the second argument is
+ * not a valid type for that entity's primary key or
+ * is null
+ * @throws TransactionRequiredException if there is no
+ * transaction and a lock mode other than PessimisticLockException
will be thrown if the database
+ * locking failure causes transaction-level rollback
+ * LockTimeoutException
will be thrown if the database
+ * locking failure causes only statement-level rollback
+ * NONE
is
+ * specified or if invoked on an entity manager which has
+ * not been joined to the current transaction and a lock
+ * mode other than NONE
is specified
+ * @throws OptimisticLockException if the optimistic version
+ * check fails
+ * @throws PessimisticLockException if pessimistic locking
+ * fails and the transaction is rolled back
+ * @throws LockTimeoutException if pessimistic locking fails and
+ * only the statement is rolled back
+ * @throws PersistenceException if an unsupported lock call
+ * is made
+ * @since Java Persistence 2.0
+ */
+ public OptimisticLockException
will be thrown.
+ *
+ *
+ * PessimisticLockException
will be thrown if the database
+ * locking failure causes transaction-level rollback
+ * LockTimeoutException
will be thrown if the database
+ * locking failure causes only statement-level rollback
+ * NONE
is
+ * specified or if invoked on an entity manager which has
+ * not been joined to the current transaction and a lock
+ * mode other than NONE
is specified
+ * @throws OptimisticLockException if the optimistic version
+ * check fails
+ * @throws PessimisticLockException if pessimistic locking
+ * fails and the transaction is rolled back
+ * @throws LockTimeoutException if pessimistic locking fails and
+ * only the statement is rolled back
+ * @throws PersistenceException if an unsupported lock call
+ * is made
+ * @since Java Persistence 2.0
+ */
+ public EntityNotFoundException
is thrown when the instance
+ * state is first accessed. (The persistence provider runtime is
+ * permitted to throw the EntityNotFoundException
when
+ * getReference
is called.)
+ * The application should not expect that the instance state will
+ * be available upon detachment, unless it was accessed by the
+ * application while the entity manager was open.
+ * @param entityClass entity class
+ * @param primaryKey primary key
+ * @return the found entity instance
+ * @throws IllegalArgumentException if the first argument does
+ * not denote an entity type or the second argument is
+ * not a valid type for that entity's primary key or
+ * is null
+ * @throws EntityNotFoundException if the entity state
+ * cannot be accessed
+ */
+ public OptimisticLockException
will be thrown.
+ *
+ *
+ * @param entity entity instance
+ * @param lockMode lock mode
+ * @throws IllegalArgumentException if the instance is not an
+ * entity or is a detached entity
+ * @throws TransactionRequiredException if there is no
+ * transaction or if invoked on an entity manager which
+ * has not been joined to the current transaction
+ * @throws EntityNotFoundException if the entity does not exist
+ * in the database when pessimistic locking is
+ * performed
+ * @throws OptimisticLockException if the optimistic version
+ * check fails
+ * @throws PessimisticLockException if pessimistic locking fails
+ * and the transaction is rolled back
+ * @throws LockTimeoutException if pessimistic locking fails and
+ * only the statement is rolled back
+ * @throws PersistenceException if an unsupported lock call
+ * is made
+ */
+ public void lock(Object entity, LockModeType lockMode);
+
+ /**
+ * Lock an entity instance that is contained in the persistence
+ * context with the specified lock mode type and with specified
+ * properties.
+ * PessimisticLockException
will be thrown if the database
+ * locking failure causes transaction-level rollback
+ * LockTimeoutException
will be thrown if the database
+ * locking failure causes only statement-level rollback
+ * OptimisticLockException
will be thrown.
+ *
+ *
+ * PessimisticLockException
will be thrown if the database
+ * locking failure causes transaction-level rollback
+ * LockTimeoutException
will be thrown if the database
+ * locking failure causes only statement-level rollback
+ * PersistenceContextType.TRANSACTION
+ * @throws EntityNotFoundException if the entity no longer
+ * exists in the database
+ */
+ public void refresh(Object entity);
+
+ /**
+ * Refresh the state of the instance from the database, using
+ * the specified properties, and overwriting changes made to
+ * the entity, if any.
+ * PersistenceContextType.TRANSACTION
+ * @throws EntityNotFoundException if the entity no longer
+ * exists in the database
+ * @since Java Persistence 2.0
+ */
+ public void refresh(Object entity,
+ Map
+ *
+ * @param entity entity instance
+ * @param lockMode lock mode
+ * @throws IllegalArgumentException if the instance is not
+ * an entity or the entity is not managed
+ * @throws TransactionRequiredException if invoked on a
+ * container-managed entity manager of type
+ * PessimisticLockException
will be thrown if the database
+ * locking failure causes transaction-level rollback
+ * LockTimeoutException
will be thrown if the
+ * database locking failure causes only statement-level
+ * rollback.
+ * PersistenceContextType.TRANSACTION
when there is
+ * no transaction; if invoked on an extended entity manager when
+ * there is no transaction and a lock mode other than NONE
+ * has been specified; or if invoked on an extended entity manager
+ * that has not been joined to the current transaction and a
+ * lock mode other than NONE
has been specified
+ * @throws EntityNotFoundException if the entity no longer exists
+ * in the database
+ * @throws PessimisticLockException if pessimistic locking fails
+ * and the transaction is rolled back
+ * @throws LockTimeoutException if pessimistic locking fails and
+ * only the statement is rolled back
+ * @throws PersistenceException if an unsupported lock call
+ * is made
+ * @since Java Persistence 2.0
+ */
+ public void refresh(Object entity, LockModeType lockMode);
+
+ /**
+ * Refresh the state of the instance from the database,
+ * overwriting changes made to the entity, if any, and
+ * lock it with respect to given lock mode type and with
+ * specified properties.
+ *
+ *
+ * PessimisticLockException
will be thrown if the database
+ * locking failure causes transaction-level rollback
+ * LockTimeoutException
will be thrown if the database
+ * locking failure causes only statement-level rollback
+ * PersistenceContextType.TRANSACTION
when there is
+ * no transaction; if invoked on an extended entity manager when
+ * there is no transaction and a lock mode other than NONE
+ * has been specified; or if invoked on an extended entity manager
+ * that has not been joined to the current transaction and a
+ * lock mode other than NONE
has been specified
+ * @throws EntityNotFoundException if the entity no longer exists
+ * in the database
+ * @throws PessimisticLockException if pessimistic locking fails
+ * and the transaction is rolled back
+ * @throws LockTimeoutException if pessimistic locking fails and
+ * only the statement is rolled back
+ * @throws PersistenceException if an unsupported lock call
+ * is made
+ * @since Java Persistence 2.0
+ */
+ public void refresh(Object entity, LockModeType lockMode,
+ MapQuery
for executing a
+ * Java Persistence query language statement.
+ * @param qlString a Java Persistence query string
+ * @return the new query instance
+ * @throws IllegalArgumentException if the query string is
+ * found to be invalid
+ */
+ public Query createQuery(String qlString);
+
+ /**
+ * Create an instance of TypedQuery
for executing a
+ * criteria query.
+ * @param criteriaQuery a criteria query object
+ * @return the new query instance
+ * @throws IllegalArgumentException if the criteria query is
+ * found to be invalid
+ * @since Java Persistence 2.0
+ */
+ public Query
for executing a criteria
+ * update query.
+ * @param updateQuery a criteria update query object
+ * @return the new query instance
+ * @throws IllegalArgumentException if the update query is
+ * found to be invalid
+ * @since Java Persistence 2.1
+ */
+ public Query createQuery(CriteriaUpdate updateQuery);
+
+ /**
+ * Create an instance of Query
for executing a criteria
+ * delete query.
+ * @param deleteQuery a criteria delete query object
+ * @return the new query instance
+ * @throws IllegalArgumentException if the delete query is
+ * found to be invalid
+ * @since Java Persistence 2.1
+ */
+ public Query createQuery(CriteriaDelete deleteQuery);
+
+ /**
+ * Create an instance of TypedQuery
for executing a
+ * Java Persistence query language statement.
+ * The select list of the query must contain only a single
+ * item, which must be assignable to the type specified by
+ * the resultClass
argument.
+ * @param qlString a Java Persistence query string
+ * @param resultClass the type of the query result
+ * @return the new query instance
+ * @throws IllegalArgumentException if the query string is found
+ * to be invalid or if the query result is found to
+ * not be assignable to the specified type
+ * @since Java Persistence 2.0
+ */
+ public Query
for executing a named query
+ * (in the Java Persistence query language or in native SQL).
+ * @param name the name of a query defined in metadata
+ * @return the new query instance
+ * @throws IllegalArgumentException if a query has not been
+ * defined with the given name or if the query string is
+ * found to be invalid
+ */
+ public Query createNamedQuery(String name);
+
+ /**
+ * Create an instance of TypedQuery
for executing a
+ * Java Persistence query language named query.
+ * The select list of the query must contain only a single
+ * item, which must be assignable to the type specified by
+ * the resultClass
argument.
+ * @param name the name of a query defined in metadata
+ * @param resultClass the type of the query result
+ * @return the new query instance
+ * @throws IllegalArgumentException if a query has not been
+ * defined with the given name or if the query string is
+ * found to be invalid or if the query result is found to
+ * not be assignable to the specified type
+ * @since Java Persistence 2.0
+ */
+ public Query
for executing
+ * a native SQL statement, e.g., for update or delete.
+ * If the query is not an update or delete query, query
+ * execution will result in each row of the SQL result
+ * being returned as a result of type Object[] (or a result
+ * of type Object if there is only one column in the select
+ * list.) Column values are returned in the order of their
+ * appearance in the select list and default JDBC type
+ * mappings are applied.
+ * @param sqlString a native SQL query string
+ * @return the new query instance
+ */
+ public Query createNativeQuery(String sqlString);
+
+ /**
+ * Create an instance of Query
for executing
+ * a native SQL query.
+ * @param sqlString a native SQL query string
+ * @param resultClass the class of the resulting instance(s)
+ * @return the new query instance
+ */
+ public Query createNativeQuery(String sqlString, Class resultClass);
+
+ /**
+ * Create an instance of Query
for executing
+ * a native SQL query.
+ * @param sqlString a native SQL query string
+ * @param resultSetMapping the name of the result set mapping
+ * @return the new query instance
+ */
+ public Query createNativeQuery(String sqlString, String resultSetMapping);
+
+ /**
+ * Create an instance of StoredProcedureQuery
for executing a
+ * stored procedure in the database.
+ * StoredProcedureQuery
for executing a
+ * stored procedure in the database.
+ * StoredProcedureQuery
for executing a
+ * stored procedure in the database.
+ * resultClass
arguments must be specified in the order in
+ * which the result sets will be returned by the stored procedure
+ * invocation.
+ * @param procedureName name of the stored procedure in the
+ * database
+ * @param resultClasses classes to which the result sets
+ * produced by the stored procedure are to
+ * be mapped
+ * @return the new stored procedure query instance
+ * @throws IllegalArgumentException if a stored procedure of the
+ * given name does not exist (or the query execution will
+ * fail)
+ * @since Java Persistence 2.1
+ */
+ public StoredProcedureQuery createStoredProcedureQuery(
+ String procedureName, Class... resultClasses);
+
+ /**
+ * Create an instance of StoredProcedureQuery
for executing a
+ * stored procedure in the database.
+ * resultSetMapping
arguments must be specified in the order
+ * in which the result sets will be returned by the stored
+ * procedure invocation.
+ * @param procedureName name of the stored procedure in the
+ * database
+ * @param resultSetMappings the names of the result set mappings
+ * to be used in mapping result sets
+ * returned by the stored procedure
+ * @return the new stored procedure query instance
+ * @throws IllegalArgumentException if a stored procedure or
+ * result set mapping of the given name does not exist
+ * (or the query execution will fail)
+ */
+ public StoredProcedureQuery createStoredProcedureQuery(
+ String procedureName, String... resultSetMappings);
+
+ /**
+ * Indicate to the entity manager that a JTA transaction is
+ * active and join the persistence context to it.
+ * SynchronizationType.UNSYNCHRONIZED
to associate
+ * it with the current JTA transaction.
+ * @throws TransactionRequiredException if there is
+ * no transaction
+ */
+ public void joinTransaction();
+
+ /**
+ * Determine whether the entity manager is joined to the
+ * current transaction. Returns false if the entity manager
+ * is not joined to the current transaction or if no
+ * transaction is active
+ * @return boolean
+ * @since Java Persistence 2.1
+ */
+ public boolean isJoinedToTransaction();
+
+ /**
+ * Return an object of the specified type to allow access to the
+ * provider-specific API. If the provider's EntityManager
+ * implementation does not support the specified class, the
+ * PersistenceException
is thrown.
+ * @param cls the class of the object to be returned. This is
+ * normally either the underlying EntityManager
implementation
+ * class or an interface that it implements.
+ * @return an instance of the specified class
+ * @throws PersistenceException if the provider does not
+ * support the call
+ * @since Java Persistence 2.0
+ */
+ public EntityManager
,
+ * if available. The result of this method is implementation
+ * specific.
+ * unwrap
method is to be preferred for new applications.
+ * @return underlying provider object for EntityManager
+ */
+ public Object getDelegate();
+
+ /**
+ * Close an application-managed entity manager.
+ * After the close method has been invoked, all methods
+ * on the EntityManager
instance and any
+ * Query
, TypedQuery
, and
+ * StoredProcedureQuery
objects obtained from
+ * it will throw the IllegalStateException
+ * except for getProperties
,
+ * getTransaction
, and isOpen
(which will return false).
+ * If this method is called when the entity manager is
+ * joined to an active transaction, the persistence
+ * context remains managed until the transaction completes.
+ * @throws IllegalStateException if the entity manager
+ * is container-managed
+ */
+ public void close();
+
+ /**
+ * Determine whether the entity manager is open.
+ * @return true until the entity manager has been closed
+ */
+ public boolean isOpen();
+
+ /**
+ * Return the resource-level EntityTransaction
object.
+ * The EntityTransaction
instance may be used serially to
+ * begin and commit multiple transactions.
+ * @return EntityTransaction instance
+ * @throws IllegalStateException if invoked on a JTA
+ * entity manager
+ */
+ public EntityTransaction getTransaction();
+
+ /**
+ * Return the entity manager factory for the entity manager.
+ * @return EntityManagerFactory instance
+ * @throws IllegalStateException if the entity manager has
+ * been closed
+ * @since Java Persistence 2.0
+ */
+ public EntityManagerFactory getEntityManagerFactory();
+
+ /**
+ * Return an instance of CriteriaBuilder
for the creation of
+ * CriteriaQuery
objects.
+ * @return CriteriaBuilder instance
+ * @throws IllegalStateException if the entity manager has
+ * been closed
+ * @since Java Persistence 2.0
+ */
+ public CriteriaBuilder getCriteriaBuilder();
+
+ /**
+ * Return an instance of Metamodel
interface for access to the
+ * metamodel of the persistence unit.
+ * @return Metamodel instance
+ * @throws IllegalStateException if the entity manager has
+ * been closed
+ * @since Java Persistence 2.0
+ */
+ public Metamodel getMetamodel();
+
+ /**
+ * Return a mutable EntityGraph that can be used to dynamically create an
+ * EntityGraph.
+ * @param rootType class of entity graph
+ * @return entity graph
+ * @since Java Persistence 2.1
+ */
+ public EntityManagerFactory
has been closed, all its entity managers
+ * are considered to be in the closed state.
+ *
+ * @since Java Persistence 1.0
+ */
+public interface EntityManagerFactory {
+
+ /**
+ * Create a new application-managed EntityManager
.
+ * This method returns a new EntityManager
instance each time
+ * it is invoked.
+ * The isOpen
method will return true on the returned instance.
+ * @return entity manager instance
+ * @throws IllegalStateException if the entity manager factory
+ * has been closed
+ */
+ public EntityManager createEntityManager();
+
+ /**
+ * Create a new application-managed EntityManager
with the
+ * specified Map of properties.
+ * This method returns a new EntityManager
instance each time
+ * it is invoked.
+ * The isOpen
method will return true on the returned instance.
+ * @param map properties for entity manager
+ * @return entity manager instance
+ * @throws IllegalStateException if the entity manager factory
+ * has been closed
+ */
+ public EntityManager createEntityManager(Map map);
+
+ /**
+ * Create a new JTA application-managed EntityManager
with the
+ * specified synchronization type.
+ * This method returns a new EntityManager
instance each time
+ * it is invoked.
+ * The isOpen
method will return true on the returned instance.
+ * @param synchronizationType how and when the entity manager should be
+ * synchronized with the current JTA transaction
+ * @return entity manager instance
+ * @throws IllegalStateException if the entity manager factory
+ * has been configured for resource-local entity managers or is closed
+ *
+ * @since Java Persistence 2.1
+ */
+ public EntityManager createEntityManager(SynchronizationType synchronizationType);
+
+ /**
+ * Create a new JTA application-managed EntityManager
with the
+ * specified synchronization type and map of properties.
+ * This method returns a new EntityManager
instance each time
+ * it is invoked.
+ * The isOpen
method will return true on the returned instance.
+ * @param synchronizationType how and when the entity manager should be
+ * synchronized with the current JTA transaction
+ * @param map properties for entity manager
+ * @return entity manager instance
+ * @throws IllegalStateException if the entity manager factory
+ * has been configured for resource-local entity managers or is closed
+ *
+ * @since Java Persistence 2.1
+ */
+ public EntityManager createEntityManager(SynchronizationType synchronizationType, Map map);
+
+ /**
+ * Return an instance of CriteriaBuilder
for the creation of
+ * CriteriaQuery
objects.
+ * @return CriteriaBuilder instance
+ * @throws IllegalStateException if the entity manager factory
+ * has been closed
+ *
+ * @since Java Persistence 2.0
+ */
+ public CriteriaBuilder getCriteriaBuilder();
+
+ /**
+ * Return an instance of Metamodel
interface for access to the
+ * metamodel of the persistence unit.
+ * @return Metamodel instance
+ * @throws IllegalStateException if the entity manager factory
+ * has been closed
+ *
+ * @since Java Persistence 2.0
+ */
+ public Metamodel getMetamodel();
+
+ /**
+ * Indicates whether the factory is open. Returns true
+ * until the factory has been closed.
+ * @return boolean indicating whether the factory is open
+ */
+ public boolean isOpen();
+
+ /**
+ * Close the factory, releasing any resources that it holds.
+ * After a factory instance has been closed, all methods invoked
+ * on it will throw the IllegalStateException
, except
+ * for isOpen
, which will return false. Once an
+ * EntityManagerFactory
has been closed, all its
+ * entity managers are considered to be in the closed state.
+ * @throws IllegalStateException if the entity manager factory
+ * has been closed
+ */
+ public void close();
+
+ /**
+ * Get the properties and associated values that are in effect
+ * for the entity manager factory. Changing the contents of the
+ * map does not change the configuration in effect.
+ * @return properties
+ * @throws IllegalStateException if the entity manager factory
+ * has been closed
+ *
+ * @since Java Persistence 2.0
+ */
+ public MapCache
interface or null if
+ * no cache is in use
+ * @throws IllegalStateException if the entity manager factory
+ * has been closed
+ *
+ * @since Java Persistence 2.0
+ */
+ public Cache getCache();
+
+ /**
+ * Return interface providing access to utility methods
+ * for the persistence unit.
+ * @return PersistenceUnitUtil
interface
+ * @throws IllegalStateException if the entity manager factory
+ * has been closed
+ *
+ * @since Java Persistence 2.0
+ */
+ public PersistenceUnitUtil getPersistenceUnitUtil();
+
+ /**
+ * Define the query, typed query, or stored procedure query as
+ * a named query such that future query objects can be created
+ * from it using the createNamedQuery
or
+ * createNamedStoredProcedureQuery
method.
+ * createNamedQuery
or
+ * createNamedStoredProcedureQuery
method.
+ * EntityNotFoundException
exception with
+ * null
as its detail message.
+ */
+ public EntityNotFoundException() {
+ super();
+ }
+
+ /**
+ * Constructs a new EntityNotFoundException
exception with the
+ * specified detail message.
+ *
+ * @param message
+ * the detail message.
+ */
+ public EntityNotFoundException(String message) {
+ super(message);
+ }
+
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/EntityResult.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/EntityResult.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/EntityResult.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2014 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Used in conjunction with the {@link SqlResultSetMapping} annotation to map the SELECT
+ * clause of a SQL query to an entity result.
+ *
+ *
+ * Example:
+ *
+ * Query q = em.createNativeQuery(
+ * "SELECT o.id, o.quantity, o.item, i.id, i.name, i.description "+
+ * "FROM Order o, Item i " +
+ * "WHERE (o.quantity > 25) AND (o.item = i.id)",
+ * "OrderItemResults");
+ * @SqlResultSetMapping(name="OrderItemResults",
+ * entities={
+ * @EntityResult(entityClass=com.acme.Order.class),
+ * @EntityResult(entityClass=com.acme.Item.class)
+ * })
+ *
+ *
+ * @see SqlResultSetMapping
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({})
+@Retention(RUNTIME)
+public @interface EntityResult {
+
+ /** The class of the result. */
+ Class entityClass();
+
+ /**
+ * Maps the columns specified in the SELECT list of the
+ * query to the properties or fields of the entity class.
+ */
+ FieldResult[] fields() default {};
+
+ /**
+ * Specifies the column name (or alias) of the column in
+ * the SELECT list that is used to determine the type of
+ * the entity instance.
+ */
+ String discriminatorColumn() default "";
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/EntityTransaction.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/EntityTransaction.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/EntityTransaction.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,76 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * Interface used to control transactions on resource-local entity
+ * managers. The {@link EntityManager#getTransaction
+ * EntityManager.getTransaction()} method returns the
+ * EntityTransaction
interface.
+
+ *
+ * @since Java Persistence 1.0
+ */
+public interface EntityTransaction {
+
+ /**
+ * Start a resource transaction.
+ * @throws IllegalStateException if isActive()
is true
+ */
+ public void begin();
+
+ /**
+ * Commit the current resource transaction, writing any
+ * unflushed changes to the database.
+ * @throws IllegalStateException if isActive()
is false
+ * @throws RollbackException if the commit fails
+ */
+ public void commit();
+
+ /**
+ * Roll back the current resource transaction.
+ * @throws IllegalStateException if isActive()
is false
+ * @throws PersistenceException if an unexpected error
+ * condition is encountered
+ */
+ public void rollback();
+
+ /**
+ * Mark the current resource transaction so that the only
+ * possible outcome of the transaction is for the transaction
+ * to be rolled back.
+ * @throws IllegalStateException if isActive()
is false
+ */
+ public void setRollbackOnly();
+
+ /**
+ * Determine whether the current resource transaction has been
+ * marked for rollback.
+ * @return boolean indicating whether the transaction has been
+ * marked for rollback
+ * @throws IllegalStateException if isActive()
is false
+ */
+ public boolean getRollbackOnly();
+
+ /**
+ * Indicate whether a resource transaction is in progress.
+ * @return boolean indicating whether transaction is
+ * in progress
+ * @throws PersistenceException if an unexpected error
+ * condition is encountered
+ */
+ public boolean isActive();
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/EnumType.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/EnumType.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/EnumType.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,31 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * Defines mapping for enumerated types. The constants of this
+ * enumerated type specify how a persistent property or
+ * field of an enumerated type should be persisted.
+ *
+ * @since Java Persistence 1.0
+ */
+public enum EnumType {
+ /** Persist enumerated type property or field as an integer. */
+ ORDINAL,
+
+ /** Persist enumerated type property or field as a string. */
+ STRING
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/Enumerated.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/Enumerated.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/Enumerated.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2014 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.EnumType.ORDINAL;
+
+/**
+ * Specifies that a persistent property or field should be persisted
+ * as a enumerated type. The Enumerated
annotation may
+ * be used in conjunction with the Basic
annotation, or in
+ * conjunction with the ElementCollection
annotation when the
+ * element collection value is of basic type. If the enumerated type
+ * is not specified or the Enumerated
annotation is not
+ * used, the EnumType
value is assumed to be ORDINAL
.
+ *
+ *
+ * Example:
+ *
+ * public enum EmployeeStatus {FULL_TIME, PART_TIME, CONTRACT}
+ *
+ * public enum SalaryRate {JUNIOR, SENIOR, MANAGER, EXECUTIVE}
+ *
+ * @Entity public class Employee {
+ * public EmployeeStatus getStatus() {...}
+ * ...
+ * @Enumerated(STRING)
+ * public SalaryRate getPayScale() {...}
+ * ...
+ * }
+ *
+ *
+ * @see Basic
+ * @see ElementCollection
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({METHOD, FIELD})
+@Retention(RUNTIME)
+public @interface Enumerated {
+
+ /** (Optional) The type used in mapping an enum type. */
+ EnumType value() default ORDINAL;
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/ExcludeDefaultListeners.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/ExcludeDefaultListeners.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/ExcludeDefaultListeners.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies that the invocation of default listeners is
+ * to be excluded for the entity class (or mapped superclass)
+ * and its subclasses.
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({TYPE})
+@Retention(RUNTIME)
+public @interface ExcludeDefaultListeners {
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/ExcludeSuperclassListeners.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/ExcludeSuperclassListeners.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/ExcludeSuperclassListeners.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies that the invocation of superclass listeners is
+ * to be excluded for the entity class (or mapped superclass)
+ * and its subclasses.
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({TYPE})
+@Retention(RUNTIME)
+
+public @interface ExcludeSuperclassListeners {
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/FetchType.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/FetchType.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/FetchType.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * Defines strategies for fetching data from the database.
+ * The EAGER
strategy is a requirement on the persistence
+ * provider runtime that data must be eagerly fetched. The
+ * LAZY
strategy is a hint to the persistence provider
+ * runtime that data should be fetched lazily when it is
+ * first accessed. The implementation is permitted to eagerly
+ * fetch data for which the LAZY
strategy hint has been
+ * specified.
+ *
+ *
+ * Example:
+ * @Basic(fetch=LAZY)
+ * protected String getName() { return name; }
+ *
+ *
+ * @see Basic
+ * @see ElementCollection
+ * @see ManyToMany
+ * @see OneToMany
+ * @see ManyToOne
+ * @see OneToOne
+ * @since Java Persistence 1.0
+ */
+public enum FetchType {
+
+ /** Defines that data can be lazily fetched. */
+ LAZY,
+
+ /** Defines that data must be eagerly fetched. */
+ EAGER
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/FieldResult.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/FieldResult.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/FieldResult.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,63 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2014 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Used in conjunction with the {@link EntityResult} annotation to map columns specified
+ * in the SELECT list of a SQL query to the properties or fields of an entity class.
+ *
+ *
+ *
+ * Example:
+ * Query q = em.createNativeQuery(
+ * "SELECT o.id AS order_id, " +
+ * "o.quantity AS order_quantity, " +
+ * "o.item AS order_item, " +
+ * "FROM Order o, Item i " +
+ * "WHERE (order_quantity > 25) AND (order_item = i.id)",
+ * "OrderResults");
+ *
+ * @SqlResultSetMapping(name="OrderResults",
+ * entities={
+ * @EntityResult(entityClass=com.acme.Order.class, fields={
+ * @FieldResult(name="id", column="order_id"),
+ * @FieldResult(name="quantity", column="order_quantity"),
+ * @FieldResult(name="item", column="order_item")})
+ * })
+ *
+ *
+ * @see EntityResult
+ * @see SqlResultSetMapping
+ * @since Java Persistence 1.0
+ */
+@Target({})
+@Retention(RUNTIME)
+
+public @interface FieldResult {
+
+ /** Name of the persistent field or property of the class. */
+ String name();
+
+ /**
+ * Name of the column in the SELECT clause - i.e., column
+ * aliases, if applicable.
+ */
+ String column();
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/FlushModeType.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/FlushModeType.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/FlushModeType.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * Flush mode setting.
+ *
+ * FlushModeType.AUTO
is set on the {@link
+ * javax.persistence.Query Query} or {@link javax.persistence.TypedQuery
+ * TypedQuery} object, or if the flush mode setting for the
+ * persistence context is AUTO
(the default) and a flush
+ * mode setting has not been specified for the Query
or
+ * TypedQuery
object, the persistence provider is
+ * responsible for ensuring that all updates to the state of all
+ * entities in the persistence context which could potentially affect
+ * the result of the query are visible to the processing of the
+ * query. The persistence provider implementation may achieve this by
+ * flushing those entities to the database or by some other means.
+ * FlushModeType.COMMIT
is set, the effect of
+ * updates made to entities in the persistence context upon queries is
+ * unspecified.
+ *
+ * ConstraintMode
value is used to specify whether foreign
+ * key constraints should be generated.
+ * foreignKeyDefinition
element
+ * should follow the SQL syntax used by the target database for foreign
+ * key constraints. For example, this may be similar the following:
+ *
+ * FOREIGN KEY ( <COLUMN expression> {, <COLUMN expression>}... )
+ * REFERENCES <TABLE identifier> [
+ * (<COLUMN expression> {, <COLUMN expression>}... ) ]
+ * [ ON UPDATE <referential action> ]
+ * [ ON DELETE <referential action> ]
+ *
+ *
+ * When the ConstraintMode
value is
+ * CONSTRAINT
, but the foreignKeyDefinition
+ * element is not specified, the provider will generate foreign key
+ * constraints whose update and delete actions it determines most
+ * appropriate for the join column(s) to which the foreign key
+ * annotation is applied.
+ *
+ * @see JoinColumn
+ * @see JoinColumns
+ * @see MapKeyJoinColumn
+ * @see MapKeyJoinColumns
+ * @see PrimaryKeyJoinColumn
+ * @see JoinTable
+ * @see CollectionTable
+ * @see SecondaryTable
+ * @see AssociationOverride
+ *
+ * @since Java Persistence 2.1
+ */
+@Target({})
+@Retention(RUNTIME)
+public @interface ForeignKey {
+
+ /**
+ * (Optional) The name of the foreign key constraint. If this
+ * is not specified, it defaults to a provider-generated name.
+ */
+ String name() default "";
+
+ /**
+ * (Optional) Used to specify whether a foreign key constraint should be
+ * generated when schema generation is in effect.
+ * CONSTRAINT
will cause the persistence
+ * provider to generate a foreign key constraint. If the
+ * foreignKeyDefinition
element is not specified, the
+ * provider will generate a constraint whose update
+ * and delete actions it determines most appropriate for the
+ * join column(s) to which the foreign key annotation is applied.
+ * NO_CONSTRAINT
will result in no
+ * constraint being generated.
+ * PROVIDER_DEFAULT
will result in the
+ * provider's default behavior (which may or may not result
+ * in the generation of a constraint for the given join column(s).
+ */
+ ConstraintMode value() default CONSTRAINT;
+
+ /**
+ * (Optional) The foreign key constraint definition.
+ */
+ String foreignKeyDefinition() default "";
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/GeneratedValue.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/GeneratedValue.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/GeneratedValue.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,79 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.GenerationType.AUTO;
+
+/**
+ * Provides for the specification of generation strategies for the
+ * values of primary keys.
+ *
+ * GeneratedValue
annotation
+ * may be applied to a primary key property or field of an entity or
+ * mapped superclass in conjunction with the {@link Id} annotation.
+ * The use of the GeneratedValue
annotation is only
+ * required to be supported for simple primary keys. Use of the
+ * GeneratedValue
annotation is not supported for derived
+ * primary keys.
+ *
+ *
+ *
+ * Example 1:
+ *
+ * @Id
+ * @GeneratedValue(strategy=SEQUENCE, generator="CUST_SEQ")
+ * @Column(name="CUST_ID")
+ * public Long getId() { return id; }
+ *
+ * Example 2:
+ *
+ * @Id
+ * @GeneratedValue(strategy=TABLE, generator="CUST_GEN")
+ * @Column(name="CUST_ID")
+ * Long id;
+ *
+ *
+ * @see Id
+ * @see TableGenerator
+ * @see SequenceGenerator
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({METHOD, FIELD})
+@Retention(RUNTIME)
+
+public @interface GeneratedValue {
+
+ /**
+ * (Optional) The primary key generation strategy
+ * that the persistence provider must use to
+ * generate the annotated entity primary key.
+ */
+ GenerationType strategy() default AUTO;
+
+ /**
+ * (Optional) The name of the primary key generator
+ * to use as specified in the {@link SequenceGenerator}
+ * or {@link TableGenerator} annotation.
+ * AUTO
generation strategy may expect a database
+ * resource to exist, or it may attempt to create one. A vendor
+ * may provide documentation on how to create such resources
+ * in the event that it does not support schema generation
+ * or cannot create the schema resource at runtime.
+ */
+ AUTO
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/Id.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/Id.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/Id.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies the primary key of an entity.
+ * The field or property to which the Id
annotation is applied
+ * should be one of the following types: any Java primitive type;
+ * any primitive wrapper type;
+ * String
;
+ * java.util.Date
;
+ * java.sql.Date
;
+ * java.math.BigDecimal
;
+ * java.math.BigInteger
.
+ *
+ * Column
annotation
+ * is specified, the primary key column name is assumed to be the name
+ * of the primary key property or field.
+ *
+ *
+ * Example:
+ *
+ * @Id
+ * public Long getId() { return id; }
+ *
+ *
+ * @see Column
+ * @see GeneratedValue
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({METHOD, FIELD})
+@Retention(RUNTIME)
+
+public @interface Id {}
Index: 3rdParty_sources/persistence-api/javax/persistence/IdClass.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/IdClass.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/IdClass.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,53 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies a composite primary key class that is mapped to
+ * multiple fields or properties of the entity.
+ *
+ *
+ *
+ * Example:
+ *
+ * @IdClass(com.acme.EmployeePK.class)
+ * @Entity
+ * public class Employee {
+ * @Id String empName;
+ * @Id Date birthDay;
+ * ...
+ * }
+ *
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({TYPE})
+@Retention(RUNTIME)
+
+public @interface IdClass {
+
+ /** Primary key class */
+ Class value();
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/Index.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/Index.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/Index.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,68 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Target;
+
+/**
+ * Used in schema generation to specify creation of an index.
+ * columnList
element is a
+ * column_list
, as follows:
+ *
+ *
+ * column::= index_column [,index_column]*
+ * index_column::= column_name [ASC | DESC]
+ *
+ *
+ * ASC
or DESC
is not specified,
+ * ASC
(ascending order) is assumed.
+ *
+ * @see Table
+ * @see SecondaryTable
+ * @see CollectionTable
+ * @see JoinTable
+ * @see TableGenerator
+ *
+ * @since Java Persistence 2.1
+ *
+ */
+@Target({})
+@Retention(RUNTIME)
+public @interface Index {
+
+ /**
+ * (Optional) The name of the index; defaults to a provider-generated name.
+ */
+ String name() default "";
+
+ /**
+ * (Required) The names of the columns to be included in the index,
+ * in order.
+ */
+ String columnList();
+
+ /**
+ * (Optional) Whether the index is unique.
+ */
+ boolean unique() default false;
+
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/Inheritance.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/Inheritance.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/Inheritance.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,52 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2014 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.InheritanceType.SINGLE_TABLE;
+
+/**
+ * Specifies the inheritance strategy to be used for an entity class
+ * hierarchy. It is specified on the entity class that is the root of
+ * the entity class hierarchy. If the Inheritance
annotation is not
+ * specified or if no inheritance type is specified for an entity
+ * class hierarchy, the SINGLE_TABLE
mapping strategy is used.
+ *
+ *
+ *
+ * Example:
+ *
+ * @Entity
+ * @Inheritance(strategy=JOINED)
+ * public class Customer { ... }
+ *
+ * @Entity
+ * public class ValuedCustomer extends Customer { ... }
+ *
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({TYPE})
+@Retention(RUNTIME)
+
+public @interface Inheritance {
+
+ /** The strategy to be used for the entity inheritance hierarchy. */
+ InheritanceType strategy() default SINGLE_TABLE;
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/InheritanceType.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/InheritanceType.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/InheritanceType.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * Defines inheritance strategy options.
+ *
+ * @since Java Persistence 1.0
+ */
+public enum InheritanceType {
+
+ /** A single table per class hierarchy. */
+ SINGLE_TABLE,
+
+ /** A table per concrete entity class. */
+ TABLE_PER_CLASS,
+
+ /**
+ * A strategy in which fields that are specific to a
+ * subclass are mapped to a separate table than the fields
+ * that are common to the parent class, and a join is
+ * performed to instantiate the subclass.
+ */
+ JOINED
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/JoinColumn.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/JoinColumn.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/JoinColumn.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,185 @@
+/*******************************************************************************
+ * 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * 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;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.ConstraintMode.PROVIDER_DEFAULT;
+
+/**
+ * Specifies a column for joining an entity association or element
+ * collection. If the JoinColumn
annotation itself is
+ * defaulted, a single join column is assumed and the default values
+ * apply.
+ *
+ *
+ * Example:
+ *
+ * @ManyToOne
+ * @JoinColumn(name="ADDR_ID")
+ * public Address getAddress() { return address; }
+ *
+ *
+ * Example: unidirectional one-to-many association using a foreign key mapping
+ *
+ * // In Customer class
+ * @OneToMany
+ * @JoinColumn(name="CUST_ID") // join column is in table for Order
+ * public Set<Order> getOrders() {return orders;}
+ *
+ *
+ * @see ManyToOne
+ * @see OneToMany
+ * @see OneToOne
+ * @see JoinTable
+ * @see CollectionTable
+ * @see ForeignKey
+ *
+ * @since Java Persistence 1.0
+ */
+@Repeatable(JoinColumns.class)
+@Target({METHOD, FIELD})
+@Retention(RUNTIME)
+public @interface JoinColumn {
+
+ /**
+ * (Optional) The name of the foreign key column.
+ * The table in which it is found depends upon the
+ * context.
+ *
+ *
+ *
+ *
+ *
+ *
+ * JoinTable
annotation,
+ * the referenced key column is in the entity table of the owning
+ * entity, or inverse entity if the join is part of the inverse
+ * join definition.
+ * CollectionTable
mapping, the
+ * referenced column is in the table of the entity containing the
+ * collection.
+ * UniqueConstraint
annotation at
+ * the table level and is useful for when the unique key
+ * constraint is only a single field. It is not necessary to
+ * explicitly specify this for a join column that corresponds to a
+ * primary key that is part of a foreign key.
+ */
+ boolean unique() default false;
+
+ /** (Optional) Whether the foreign key column is nullable. */
+ boolean nullable() default true;
+
+ /**
+ * (Optional) Whether the column is included in
+ * SQL INSERT statements generated by the persistence
+ * provider.
+ */
+ boolean insertable() default true;
+
+ /**
+ * (Optional) Whether the column is included in
+ * SQL UPDATE statements generated by the persistence
+ * provider.
+ */
+ boolean updatable() default true;
+
+ /**
+ * (Optional) The SQL fragment that is used when
+ * generating the DDL for the column.
+ *
+ *
+ */
+ String table() default "";
+
+ /**
+ * (Optional) Used to specify or control the generation of a
+ * foreign key constraint when table generation is in effect. If
+ * this element is not specified, the persistence provider's
+ * default foreign key strategy will apply.
+ *
+ * @since Java Persistence 2.1
+ */
+ ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT);
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/JoinColumns.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/JoinColumns.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/JoinColumns.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,70 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.ConstraintMode.PROVIDER_DEFAULT;
+
+/**
+ * Specifies the mapping for composite foreign keys. This annotation
+ * groups JoinColumn
annotations for the same relationship.
+ *
+ * JoinColumns
annotation is used,
+ * both the name
and the referencedColumnName
elements
+ * must be specified in each such JoinColumn
annotation.
+ *
+ *
+ *
+ * Example:
+ * @ManyToOne
+ * @JoinColumns({
+ * @JoinColumn(name="ADDR_ID", referencedColumnName="ID"),
+ * @JoinColumn(name="ADDR_ZIP", referencedColumnName="ZIP")
+ * })
+ * public Address getAddress() { return address; }
+ *
+ *
+ * @see JoinColumn
+ * @see ForeignKey
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({METHOD, FIELD})
+@Retention(RUNTIME)
+public @interface JoinColumns {
+
+ /**
+ * The join columns that map the relationship.
+ */
+ JoinColumn[] value();
+
+ /**
+ * (Optional) Used to specify or control the generation of a
+ * foreign key constraint when table generation is in effect.
+ * If both this element and the foreignKey
element
+ * of any of the JoinColumn
elements are specified,
+ * the behavior is undefined. If no foreign key annotation element
+ * is specified in either location, the persistence provider's
+ * default foreign key strategy will apply.
+ *
+ * @since Java Persistence 2.1
+ */
+ ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT);
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/JoinTable.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/JoinTable.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/JoinTable.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,155 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.ConstraintMode.PROVIDER_DEFAULT;
+
+/**
+ * Specifies the mapping of associations. It is applied to the
+ * owning side of an association.
+ *
+ * JoinTable
annotation is missing, the
+ * default values of the annotation elements apply.
+ * The name of the join table is assumed to be the table names of the
+ * associated primary tables concatenated together (owning side
+ * first) using an underscore.
+ *
+ *
+ *
+ * Example:
+ *
+ * @JoinTable(
+ * name="CUST_PHONE",
+ * joinColumns=
+ * @JoinColumn(name="CUST_ID", referencedColumnName="ID"),
+ * inverseJoinColumns=
+ * @JoinColumn(name="PHONE_ID", referencedColumnName="ID")
+ * )
+ *
+ *
+ * @see JoinColumn
+ * @see JoinColumns
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({METHOD, FIELD})
+@Retention(RUNTIME)
+
+public @interface JoinTable {
+
+ /**
+ * (Optional) The name of the join table.
+ *
+ * joinColumns
element when table generation is in
+ * effect. If both this element and the foreignKey
+ * element of any of the joinColumns
elements are
+ * specified, the behavior is undefined. If no foreign key
+ * annotation element is specified in either location, the
+ * persistence provider's default foreign key strategy will
+ * apply.
+ *
+ * @since Java Persistence 2.1
+ */
+ ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT);
+
+ /**
+ * (Optional) Used to specify or control the generation of a
+ * foreign key constraint for the columns corresponding to the
+ * inverseJoinColumns
element when table generation
+ * is in effect. If both this element and the
+ * foreignKey
element of any of the
+ * inverseJoinColumns
elements are specified, the
+ * behavior is undefined. If no foreign key annotation element
+ * is specified in either location, the persistence provider's
+ * default foreign key strategy will apply.
+ *
+ * @since Java Persistence 2.1
+ */
+ ForeignKey inverseForeignKey() default @ForeignKey(PROVIDER_DEFAULT);
+
+ /**
+ * (Optional) Unique constraints that are
+ * to be placed on the table. These are
+ * only used if table generation is in effect.
+ * Lob
annotation
+ * when mapping to a database Lob type. The Lob
+ * annotation may be used in conjunction with the {@link Basic}
+ * annotation or the {@link ElementCollection} annotation when the
+ * element collection value is of basic type. A Lob
may
+ * be either a binary or character type.
+ *
+ * Lob
type is inferred from the type of the
+ * persistent field or property, and except for string and
+ * character-based types defaults to Blob.
+ *
+ *
+ * Example 1:
+ *
+ * @Lob @Basic(fetch=LAZY)
+ * @Column(name="REPORT")
+ * protected String report;
+ *
+ * Example 2:
+ *
+ * @Lob @Basic(fetch=LAZY)
+ * @Column(name="EMP_PIC", columnDefinition="BLOB NOT NULL")
+ * protected byte[] pic;
+ *
+ *
+ *
+ * @see Basic
+ * @see ElementCollection
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({METHOD, FIELD})
+@Retention(RUNTIME)
+public @interface Lob {
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/LockModeType.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/LockModeType.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/LockModeType.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,188 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2014 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * Lock modes can be specified by means of passing a LockModeType
+ * argument to one of the {@link javax.persistence.EntityManager} methods that take locks
+ * (lock
, find
, or refresh
) or
+ * to the {@link Query#setLockMode Query.setLockMode()} or
+ * {@link TypedQuery#setLockMode TypedQuery.setLockMode()} method.
+ *
+ * OPTIMISTIC
and
+ * OPTIMISTIC_FORCE_INCREMENT
respectively. The latter
+ * are to be preferred for new applications.
+ *
+ * LockModeType.OPTIMISTIC
and
+ * LockModeType.OPTIMISTIC_FORCE_INCREMENT
are the
+ * following.
+ *
+ * LockModeType.OPTIMISTIC
on a versioned object,
+ * the entity manager must ensure that neither of the following
+ * phenomena can occur:
+ *
+ *
+ *
+ * LockModeType.OPTIMISTIC_FORCE_INCREMENT
on a versioned object,
+ * will also force an update (increment) to the entity's version
+ * column.
+ *
+ * LockModeType.PESSIMISTIC_READ
, LockModeType.PESSIMISTIC_WRITE
, and
+ * LockModeType.PESSIMISTIC_FORCE_INCREMENT
are the following.
+ *
+ * LockModeType.PESSIMISTIC_READ
or
+ * LockModeType.PESSIMISTIC_WRITE
on an object, the entity
+ * manager must ensure that neither of the following phenomena can
+ * occur:
+ *
+ *
+ *
+ * LockModeType.PESSIMISTIC_WRITE
can be obtained on
+ * an entity instance to force serialization among transactions
+ * attempting to update the entity data. A lock with
+ * LockModeType.PESSIMISTIC_READ
can be used to query data using
+ * repeatable-read semantics without the need to reread the data at
+ * the end of the transaction to obtain a lock, and without blocking
+ * other transactions reading the data. A lock with
+ * LockModeType.PESSIMISTIC_WRITE
can be used when querying data and
+ * there is a high likelihood of deadlock or update failure among
+ * concurrent updating transactions.
+ *
+ * LockModeType.PESSIMISTIC_READ
+ * LockModeType.PESSIMISTIC_WRITE
on a non-versioned entity as well as
+ * on a versioned entity.
+ *
+ * EntityTransaction
has been marked for rollback.
+ *
+ * OPTIMISTIC
.
+ * OPTIMISTIC
is to be preferred for new
+ * applications.
+ *
+ */
+ READ,
+
+ /**
+ * Synonymous with OPTIMISTIC_FORCE_INCREMENT
.
+ * OPTIMISTIC_FORCE_IMCREMENT
is to be preferred for new
+ * applications.
+ *
+ */
+ WRITE,
+
+ /**
+ * Optimistic lock.
+ *
+ * @since Java Persistence 2.0
+ */
+ OPTIMISTIC,
+
+ /**
+ * Optimistic lock, with version update.
+ *
+ * @since Java Persistence 2.0
+ */
+ OPTIMISTIC_FORCE_INCREMENT,
+
+ /**
+ *
+ * Pessimistic read lock.
+ *
+ * @since Java Persistence 2.0
+ */
+ PESSIMISTIC_READ,
+
+ /**
+ * Pessimistic write lock.
+ *
+ * @since Java Persistence 2.0
+ */
+ PESSIMISTIC_WRITE,
+
+ /**
+ * Pessimistic write lock, with version update.
+ *
+ * @since Java Persistence 2.0
+ */
+ PESSIMISTIC_FORCE_INCREMENT,
+
+ /**
+ * No lock.
+ *
+ * @since Java Persistence 2.0
+ */
+ NONE
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/LockTimeoutException.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/LockTimeoutException.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/LockTimeoutException.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * Thrown by the persistence provider when an pessimistic locking
+ * conflict occurs that does not result in transaction rollback. This
+ * exception may be thrown as part of an API call, at, flush or at
+ * commit time. The current transaction, if one is active, will be not
+ * be marked for rollback.
+ *
+ * @since Java Persistence 2.0
+ */
+public class LockTimeoutException extends PersistenceException {
+ /** The object that caused the exception */
+ Object entity;
+
+ /**
+ * Constructs a new LockTimeoutException
exception
+ * with null
as its detail message.
+ */
+ public LockTimeoutException() {
+ super();
+ }
+
+ /**
+ * Constructs a new LockTimeoutException
exception
+ * with the specified detail message.
+ * @param message the detail message.
+ */
+ public LockTimeoutException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructs a new LockTimeoutException
exception
+ * with the specified detail message and cause.
+ * @param message the detail message.
+ * @param cause the cause.
+ */
+ public LockTimeoutException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Constructs a new LockTimeoutException
exception
+ * with the specified cause.
+ * @param cause the cause.
+ */
+ public LockTimeoutException(Throwable cause) {
+ super(cause);
+ }
+
+ /**
+ * Constructs a new LockTimeoutException
exception
+ * with the specified object.
+ * @param entity the entity.
+ */
+ public LockTimeoutException(Object entity) {
+ this.entity = entity;
+ }
+
+ /**
+ * Constructs a new LockTimeoutException
exception
+ * with the specified detail message, cause, and entity.
+ * @param message the detail message.
+ * @param cause the cause.
+ * @param entity the entity.
+ */
+ public LockTimeoutException(String message, Throwable cause, Object entity) {
+ super(message, cause);
+ this.entity = entity;
+ }
+
+ /**
+ * Returns the object that caused this exception.
+ * @return the entity
+ */
+ public Object getObject() {
+ return this.entity;
+ }
+}
+
+
Index: 3rdParty_sources/persistence-api/javax/persistence/ManyToMany.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/ManyToMany.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/ManyToMany.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,143 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import javax.persistence.CascadeType;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.FetchType.LAZY;
+
+/**
+ * Specifies a many-valued association with many-to-many multiplicity.
+ *
+ * mappedBy
element of
+ * the ManyToMany
annotation to specify the relationship field or
+ * property of the owning side.
+ *
+ * ManyToMany
annotation may be used within an
+ * embeddable class contained within an entity class to specify a
+ * relationship to a collection of entities. If the relationship is
+ * bidirectional and the entity containing the embeddable class is the
+ * owner of the relationship, the non-owning side must use the
+ * mappedBy
element of the ManyToMany
+ * annotation to specify the relationship field or property of the
+ * embeddable class. The dot (".") notation syntax must be used in the
+ * mappedBy
element to indicate the relationship
+ * attribute within the embedded attribute. The value of each
+ * identifier used with the dot notation is the name of the respective
+ * embedded field or property.
+ *
+ *
+ *
+ * Example 1:
+ *
+ * // In Customer class:
+ *
+ * @ManyToMany
+ * @JoinTable(name="CUST_PHONES")
+ * public Set<PhoneNumber> getPhones() { return phones; }
+ *
+ * // In PhoneNumber class:
+ *
+ * @ManyToMany(mappedBy="phones")
+ * public Set<Customer> getCustomers() { return customers; }
+ *
+ * Example 2:
+ *
+ * // In Customer class:
+ *
+ * @ManyToMany(targetEntity=com.acme.PhoneNumber.class)
+ * public Set getPhones() { return phones; }
+ *
+ * // In PhoneNumber class:
+ *
+ * @ManyToMany(targetEntity=com.acme.Customer.class, mappedBy="phones")
+ * public Set getCustomers() { return customers; }
+ *
+ * Example 3:
+ *
+ * // In Customer class:
+ *
+ * @ManyToMany
+ * @JoinTable(name="CUST_PHONE",
+ * joinColumns=
+ * @JoinColumn(name="CUST_ID", referencedColumnName="ID"),
+ * inverseJoinColumns=
+ * @JoinColumn(name="PHONE_ID", referencedColumnName="ID")
+ * )
+ * public Set<PhoneNumber> getPhones() { return phones; }
+ *
+ * // In PhoneNumberClass:
+ *
+ * @ManyToMany(mappedBy="phones")
+ * public Set<Customer> getCustomers() { return customers; }
+ *
+ *
+ * @see JoinTable
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({METHOD, FIELD})
+@Retention(RUNTIME)
+public @interface ManyToMany {
+
+ /**
+ * (Optional) The entity class that is the target of the
+ * association. Optional only if the collection-valued
+ * relationship property is defined using Java generics. Must be
+ * specified otherwise.
+ *
+ * cascade
element applies to the
+ * map value.
+ *
+ * OneToMany
entity side must used the
+ * mappedBy
element to specify the relationship field or
+ * property of the entity that is the owner of the relationship.
+ *
+ * ManyToOne
annotation may be used within an
+ * embeddable class to specify a relationship from the embeddable
+ * class to an entity class. If the relationship is bidirectional, the
+ * non-owning OneToMany
entity side must use the mappedBy
+ * element of the OneToMany
annotation to specify the
+ * relationship field or property of the embeddable field or property
+ * on the owning side of the relationship. The dot (".") notation
+ * syntax must be used in the mappedBy
element to indicate the
+ * relationship attribute within the embedded attribute. The value of
+ * each identifier used with the dot notation is the name of the
+ * respective embedded field or property.
+ *
+ *
+ * Example 1:
+ *
+ * @ManyToOne(optional=false)
+ * @JoinColumn(name="CUST_ID", nullable=false, updatable=false)
+ * public Customer getCustomer() { return customer; }
+ *
+ *
+ * Example 2:
+ *
+ * @Entity
+ * public class Employee {
+ * @Id int id;
+ * @Embedded JobInfo jobInfo;
+ * ...
+ * }
+ *
+ * @Embeddable
+ * public class JobInfo {
+ * String jobDescription;
+ * @ManyToOne ProgramManager pm; // Bidirectional
+ * }
+ *
+ * @Entity
+ * public class ProgramManager {
+ * @Id int id;
+ * @OneToMany(mappedBy="jobInfo.pm")
+ * Collection<Employee> manages;
+ * }
+ *
+ *
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({METHOD, FIELD})
+@Retention(RUNTIME)
+
+public @interface ManyToOne {
+
+ /**
+ * (Optional) The entity class that is the target of
+ * the association.
+ *
+ * MapKey
is specified and vice versa.
+ *
+ *
+ *
+ * Example 1:
+ *
+ * @Entity
+ * public class Department {
+ * ...
+ * @OneToMany(mappedBy="department")
+ * @MapKey // map key is primary key
+ * public Map<Integer, Employee> getEmployees() {... }
+ * ...
+ * }
+ *
+ * @Entity
+ * public class Employee {
+ * ...
+ * @Id Integer getEmpId() { ... }
+ * @ManyToOne
+ * @JoinColumn(name="dept_id")
+ * public Department getDepartment() { ... }
+ * ...
+ * }
+ *
+ * Example 2:
+ *
+ * @Entity
+ * public class Department {
+ * ...
+ * @OneToMany(mappedBy="department")
+ * @MapKey(name="name")
+ * public Map<String, Employee> getEmployees() {... }
+ * ...
+ * }
+ *
+ * @Entity
+ * public class Employee {
+ * @Id public Integer getEmpId() { ... }
+ * ...
+ * @ManyToOne
+ * @JoinColumn(name="dept_id")
+ * public Department getDepartment() { ... }
+ * ...
+ * }
+ *
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({METHOD, FIELD})
+@Retention(RUNTIME)
+public @interface MapKey {
+
+ /**
+ * (Optional) The name of the persistent field or property of the
+ * associated entity that is used as the map key.
+ * name
element is not specified, the primary key of the
+ * associated entity is used as the map key. If the
+ * primary key is a composite primary key and is mapped
+ * as IdClass
, an instance of the primary key
+ * class is used as the key.
+ */
+ String name() default "";
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/MapKeyClass.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/MapKeyClass.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/MapKeyClass.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,99 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies the type of the map key for associations of type
+ * java.util.Map
. The map key can be a basic type, an
+ * embeddable class, or an entity. If the map is specified using Java
+ * generics, the MapKeyClass
annotation and associated
+ * type need not be specified; otherwise they must be specified.
+ *
+ * MapKeyClass
annotation is used in conjunction
+ * with ElementCollection
or one of the collection-valued
+ * relationship annotations (OneToMany
or ManyToMany
).
+ * The MapKey
annotation is not used when
+ * MapKeyClass
is specified and vice versa.
+ *
+ *
+ *
+ * Example 1:
+ *
+ * @Entity
+ * public class Item {
+ * @Id int id;
+ * ...
+ * @ElementCollection(targetClass=String.class)
+ * @MapKeyClass(String.class)
+ * Map images; // map from image name to image filename
+ * ...
+ * }
+ *
+ * Example 2:
+ *
+ * // MapKeyClass and target type of relationship can be defaulted
+ *
+ * @Entity
+ * public class Item {
+ * @Id int id;
+ * ...
+ * @ElementCollection
+ * Map<String, String> images;
+ * ...
+ * }
+ *
+ * Example 3:
+ *
+ * @Entity
+ * public class Company {
+ * @Id int id;
+ * ...
+ * @OneToMany(targetEntity=com.example.VicePresident.class)
+ * @MapKeyClass(com.example.Division.class)
+ * Map organization;
+ * }
+ *
+ * Example 4:
+ *
+ * // MapKeyClass and target type of relationship are defaulted
+ *
+ * @Entity
+ * public class Company {
+ * @Id int id;
+ * ...
+ * @OneToMany
+ * Map<Division, VicePresident> organization;
+ * }
+ *
+ *
+ * @see ElementCollection
+ * @see OneToMany
+ * @see ManyToMany
+ * @since Java Persistence 2.0
+ */
+
+@Target( { METHOD, FIELD })
+@Retention(RUNTIME)
+public @interface MapKeyClass {
+ /**(Required) The type of the map key.*/
+ Class value();
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/MapKeyColumn.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/MapKeyColumn.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/MapKeyColumn.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,132 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies the mapping for the key column of a map whose
+ * map key is a basic type. If the name
element is not specified, it
+ * defaults to the concatenation of the following: the name of the
+ * referencing relationship field or property; "_"; "KEY".
+ *
+ *
+ * Example:
+ *
+ * @Entity
+ * public class Item {
+ * @Id int id;
+ * ...
+ * @ElementCollection
+ * @MapKeyColumn(name="IMAGE_NAME")
+ * @Column(name="IMAGE_FILENAME")
+ * @CollectionTable(name="IMAGE_MAPPING")
+ * Map<String, String> images; // map from image name to filename
+ * ...
+ * }
+ *
+ * @since Java Persistence 2.0
+ */
+@Target( { METHOD, FIELD })
+@Retention(RUNTIME)
+public @interface MapKeyColumn {
+
+ /**
+ * (Optional) The name of the map key column. The table in which it is found
+ * depends upon the context. If the map key is for an element collection,
+ * the map key column is in the collection table for the map value. If the
+ * map key is for a ManyToMany entity relationship or for a OneToMany entity
+ * relationship using a join table, the map key column is in a join table.
+ * If the map key is for a OneToMany entity relationship using a foreign key
+ * mapping strategy, the map key column is in the table of the entity that
+ * is the value of the map.
+ * KEY
".
+ */
+ String name() default "";
+
+ /**
+ * (Optional) Whether the column is a unique key. This is a
+ * shortcut for the UniqueConstraint
annotation
+ * at the table level and is useful for when the unique key
+ * constraint corresponds to only a single column. This
+ * constraint applies in addition to any constraint entailed
+ * by primary key mapping and to constraints specified at the
+ * table level.
+ */
+ boolean unique() default false;
+
+ /** (Optional) Whether the database column is nullable. */
+ boolean nullable() default false;
+
+ /**
+ * (Optional) Whether the column is included in SQL INSERT statements
+ * generated by the persistence provider.
+ */
+ boolean insertable() default true;
+
+ /**
+ * (Optional) Whether the column is included in SQL UPDATE statements
+ * generated by the persistence provider.
+ */
+ boolean updatable() default true;
+
+ /**
+ * (Optional) The SQL fragment that is used when generating the DDL for the
+ * column.
+ * MapKeyEnumerated
annotation can be applied to an
+ * element collection or relationship of type java.util.Map
, in
+ * conjunction with the ElementCollection
, OneToMany
, or
+ * ManyToMany
annotation.
+ * If the enumerated type is not specified or the MapKeyEnumerated
+ * annotation is not used, the enumerated type is assumed to be
+ * ORDINAL
.
+ *
+ *
+ * Example:
+ *
+ * public enum ProjectStatus {COMPLETE, DELAYED, CANCELLED, IN_PROGRESS}
+ *
+ * public enum SalaryRate {JUNIOR, SENIOR, MANAGER, EXECUTIVE}
+ *
+ * @Entity public class Employee {
+ * @ManyToMany
+ * public Projects<ProjectStatus, Project> getProjects() {...}
+ *
+ * @OneToMany
+ * @MapKeyEnumerated(STRING)
+ * public Map<SalaryRate, Employee> getEmployees() {...}
+ * ...
+ * }
+ *
+ *
+ * @see ElementCollection
+ * @see OneToMany
+ * @see ManyToMany
+ *
+ * @since Java Persistence 2.0
+ */
+@Target({METHOD, FIELD}) @Retention(RUNTIME)
+public @interface MapKeyEnumerated {
+
+ /** (Optional) The type used in mapping a map key enum type. */
+ EnumType value() default ORDINAL;
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/MapKeyJoinColumn.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/MapKeyJoinColumn.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/MapKeyJoinColumn.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,197 @@
+/*******************************************************************************
+ * 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * 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;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.ConstraintMode.PROVIDER_DEFAULT;
+
+/**
+ * Specifies a mapping to an entity that is a map key. The map key
+ * join column is in the collection table, join table, or table of the
+ * target entity that is used to represent the map. If no
+ * MapKeyJoinColumn
annotation is specified, a single
+ * join column is assumed and the default values apply.
+ *
+ *
+ *
+ * Example 1:
+ *
+ * @Entity
+ * public class Company {
+ * @Id int id;
+ * ...
+ * @OneToMany // unidirectional
+ * @JoinTable(name="COMPANY_ORGANIZATION",
+ * joinColumns=@JoinColumn(name="COMPANY"),
+ * inverseJoinColumns=@JoinColumn(name="VICEPRESIDENT"))
+ * @MapKeyJoinColumn(name="DIVISION")
+ * Map<Division, VicePresident> organization;
+ * }
+ *
+ * Example 2:
+ *
+ * @Entity
+ * public class VideoStore {
+ * @Id int id;
+ * String name;
+ * Address location;
+ * ...
+ * @ElementCollection
+ * @CollectionTable(name="INVENTORY",
+ * joinColumns=@JoinColumn(name="STORE"))
+ * @Column(name="COPIES_IN_STOCK")
+ * @MapKeyJoinColumn(name="MOVIE", referencedColumnName="ID")
+ * Map<Movie, Integer> videoInventory;
+ * ...
+ * }
+ *
+ * @Entity
+ * public class Movie {
+ * @Id long id;
+ * String title;
+ * ...
+ * }
+ *
+ * Example 3:
+ *
+ * @Entity
+ * public class Student {
+ * @Id int studentId;
+ * ...
+ * @ManyToMany // students and courses are also many-many
+ * @JoinTable(name="ENROLLMENTS",
+ * joinColumns=@JoinColumn(name="STUDENT"),
+ * inverseJoinColumns=@JoinColumn(name="SEMESTER"))
+ * @MapKeyJoinColumn(name="COURSE")
+ * Map<Course, Semester> enrollment;
+ * ...
+ * }
+ *
+ *
+ * @see ForeignKey
+ *
+ * @since Java Persistence 2.0
+ */
+@Repeatable(MapKeyJoinColumns.class)
+@Target( { METHOD, FIELD })
+@Retention(RUNTIME)
+public @interface MapKeyJoinColumn {
+ /**
+ * (Optional) The name of the foreign key column for the map
+ * key. The table in which it is found depends upon the
+ * context.
+ *
+ *
+ *
+ * UniqueConstraint
annotation
+ * at the table level and is useful for when the unique key
+ * constraint is only a single field.
+ */
+ boolean unique() default false;
+
+ /**
+ * (Optional) Whether the foreign key column is nullable.
+ */
+ boolean nullable() default false;
+
+ /**
+ * (Optional) Whether the column is included in SQL INSERT statements
+ * generated by the persistence provider.
+ */
+ boolean insertable() default true;
+
+ /**
+ * (Optional) Whether the column is included in SQL UPDATE statements
+ * generated by the persistence provider.
+ */
+ boolean updatable() default true;
+
+ /**
+ * (Optional) The SQL fragment that is used when generating the DDL for the
+ * column.
+ * Defaults to SQL generated by the provider for the column.
+ */
+ String columnDefinition() default "";
+
+ /**
+ * (Optional) The name of the table that contains the foreign key column.
+ *
+ *
+ *
+ *
+ */
+ String table() default "";
+
+ /**
+ * (Optional) Used to specify or control the generation of a
+ * foreign key constraint when table generation is in effect. If
+ * this element is not specified, the persistence provider's
+ * default foreign key strategy will apply.
+ *
+ * @since Java Persistence 2.1
+ */
+ ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT);
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/MapKeyJoinColumns.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/MapKeyJoinColumns.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/MapKeyJoinColumns.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.ConstraintMode.PROVIDER_DEFAULT;
+
+/**
+ * Supports composite map keys that reference entities.
+ * MapKeyJoinColumns
annotation groups
+ * MapKeyJoinColumn
annotations. When the
+ * MapKeyJoinColumns
annotation is used, both the
+ * name
and the referencedColumnName
+ * elements must be specified in each of the grouped
+ * MapKeyJoinColumn
annotations.
+ *
+ * @see MapKeyJoinColumn
+ * @see ForeignKey
+ *
+ * @since Java Persistence 2.0
+ */
+@Target( { METHOD, FIELD })
+@Retention(RUNTIME)
+public @interface MapKeyJoinColumns {
+ /**
+ * (Required) The map key join columns that are used to map to the entity
+ * that is the map key.
+ */
+ MapKeyJoinColumn[] value();
+
+ /**
+ * (Optional) Used to specify or control the generation of a
+ * foreign key constraint when table generation is in effect.
+ * If both this element and the foreignKey
+ * element of any of the MapKeyJoinColumn
+ * elements are specified, the behavior is undefined. If no
+ * foreign key annotation element is specified in either
+ * location, the persistence provider's default foreign key
+ * strategy will apply.
+ *
+ * @since Java Persistence 2.1
+ */
+ ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT);
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/MapKeyTemporal.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/MapKeyTemporal.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/MapKeyTemporal.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * This annotation must be specified for persistent map keys of type
+ * {@link java.util.Date} and {@link java.util.Calendar}. It may only be
+ * specified for map keys of these types.
+ *
+ * MapKeyTemporal
annotation can be applied to an
+ * element collection or relationship of type java.util.Map
+ * in conjunction with the ElementCollection
,
+ * OneToMany
, or ManyToMany
annotation.
+ *
+ *
+ * Example:
+ *
+ * @OneToMany
+ * @MapKeyTemporal(DATE)
+ * protected java.util.Map<java.util.Date, Employee> employees;
+ *
+ *
+ * @since Java Persistence 2.0
+ */
+@Target({METHOD, FIELD})
+@Retention(RUNTIME)
+public @interface MapKeyTemporal {
+
+ /** (Required) The type used in mapping
+ * java.util.Date
or
+ * java.util.Calendar
.
+ */
+ TemporalType value();
+}
+
Index: 3rdParty_sources/persistence-api/javax/persistence/MappedSuperclass.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/MappedSuperclass.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/MappedSuperclass.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,100 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import java.lang.annotation.Documented;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Designates a class whose mapping information is applied
+ * to the entities that inherit from it. A mapped superclass
+ * has no separate table defined for it.
+ *
+ * MappedSuperclass
+ * annotation can be mapped in the same way as an entity except that the
+ * mappings will apply only to its subclasses since no table
+ * exists for the mapped superclass itself. When applied to the
+ * subclasses the inherited mappings will apply in the context
+ * of the subclass tables. Mapping information may be overridden
+ * in such subclasses by using the AttributeOverride
and
+ * AssociationOverride
annotations or corresponding XML elements.
+ *
+ *
+ * Example: Concrete class as a mapped superclass
+ *
+ * @MappedSuperclass
+ * public class Employee {
+ *
+ * @Id protected Integer empId;
+ * @Version protected Integer version;
+ * @ManyToOne @JoinColumn(name="ADDR")
+ * protected Address address;
+ *
+ * public Integer getEmpId() { ... }
+ * public void setEmpId(Integer id) { ... }
+ * public Address getAddress() { ... }
+ * public void setAddress(Address addr) { ... }
+ * }
+ *
+ * // Default table is FTEMPLOYEE table
+ * @Entity
+ * public class FTEmployee extends Employee {
+ *
+ * // Inherited empId field mapped to FTEMPLOYEE.EMPID
+ * // Inherited version field mapped to FTEMPLOYEE.VERSION
+ * // Inherited address field mapped to FTEMPLOYEE.ADDR fk
+ *
+ * // Defaults to FTEMPLOYEE.SALARY
+ * protected Integer salary;
+ *
+ * public FTEmployee() {}
+ *
+ * public Integer getSalary() { ... }
+ *
+ * public void setSalary(Integer salary) { ... }
+ * }
+ *
+ * @Entity @Table(name="PT_EMP")
+ * @AssociationOverride(
+ * name="address",
+ * joincolumns=@JoinColumn(name="ADDR_ID"))
+ * public class PartTimeEmployee extends Employee {
+ *
+ * // Inherited empId field mapped to PT_EMP.EMPID
+ * // Inherited version field mapped to PT_EMP.VERSION
+ * // address field mapping overridden to PT_EMP.ADDR_ID fk
+ * @Column(name="WAGE")
+ * protected Float hourlyWage;
+ *
+ * public PartTimeEmployee() {}
+ *
+ * public Float getHourlyWage() { ... }
+ * public void setHourlyWage(Float wage) { ... }
+ * }
+ *
+ *
+ * @see AttributeOverride
+ * @see AssociationOverride
+ * @since Java Persistence 1.0
+ */
+@Documented
+@Target({TYPE})
+@Retention(RUNTIME)
+public @interface MappedSuperclass {
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/MapsId.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/MapsId.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/MapsId.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,77 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Designates a ManyToOne
or
+ * OneToOne
relationship attribute that provides the
+ * mapping for an {@link EmbeddedId} primary key, an attribute within
+ * an EmbeddedId
primary key, or a simple primary key of
+ * the parent entity. The value
element specifies the
+ * attribute within a composite key to which the relationship
+ * attribute corresponds. If the entity's primary key is of the same
+ * Java type as the primary key of the entity referenced by the
+ * relationship, the value attribute is not specified.
+ *
+ *
+ * Example:
+ *
+ * // parent entity has simple primary key
+ *
+ * @Entity
+ * public class Employee {
+ * @Id long empId;
+ * String name;
+ * ...
+ * }
+ *
+ * // dependent entity uses EmbeddedId for composite key
+ *
+ * @Embeddable
+ * public class DependentId {
+ * String name;
+ * long empid; // corresponds to primary key type of Employee
+ * }
+ *
+ * @Entity
+ * public class Dependent {
+ * @EmbeddedId DependentId id;
+ * ...
+ * @MapsId("empid") // maps the empid attribute of embedded id
+ * @ManyToOne Employee emp;
+ * }
+ *
+ *
+ * @since Java Persistence 2.0
+ */
+@Target( { METHOD, FIELD })
+@Retention(RUNTIME)
+public @interface MapsId {
+
+ /**
+ * (Optional) The name of the attribute within the composite key
+ * to which the relationship attribute corresponds. If not
+ * supplied, the relationship maps the entity's primary
+ * key.
+ */
+ String value() default ""; }
Index: 3rdParty_sources/persistence-api/javax/persistence/NamedAttributeNode.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/NamedAttributeNode.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/NamedAttributeNode.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,75 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/
+
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * A NamedAttributeNode
is a member element of a
+ * NamedEntityGraph
.
+ *
+ * @see NamedEntityGraph
+ * @see NamedSubgraph
+ *
+ * @since Java Persistence 2.1
+ */
+@Target({})
+@Retention(RUNTIME)
+public @interface NamedAttributeNode {
+
+ /**
+ * (Required) The name of the attribute that must be included in the graph.
+ */
+ String value();
+
+ /**
+ * (Optional) If the attribute references a managed type that has
+ * its own AttributeNodes, this element is used to refer to that
+ * NamedSubgraph definition.
+ * If the target type has inheritance, multiple subgraphs can
+ * be specified. These additional subgraphs are intended to add
+ * subclass-specific attributes. Superclass subgraph entries will
+ * be merged into subclass subgraphs.
+ *
+ * name
element of the corresponding
+ * NamedSubgraph
element. If multiple subgraphs are
+ * specified due to inheritance, they are referenced by this name.
+ */
+ String subgraph() default "";
+
+ /**
+ * (Optional) If the attribute references a Map type, this element
+ * can be used to specify a subgraph for the Key in the case of an
+ * Entity key type. A keySubgraph can not be specified without the
+ * Map attribute also being specified. If the target type has
+ * inheritance, multiple subgraphs can be specified. These
+ * additional subgraphs are intended to add subclass-specific
+ * attributes. Superclass subgraph entries will be merged into
+ * subclass subgraphs.
+ *
+ * name
element of the corresponding
+ * NamedSubgraph
element. If multiple key subgraphs
+ * are specified due to inheritance, they are referenced by this
+ * name.
+ */
+ String keySubgraph() default "";
+}
+
+
Index: 3rdParty_sources/persistence-api/javax/persistence/NamedEntityGraph.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/NamedEntityGraph.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/NamedEntityGraph.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,71 @@
+/*******************************************************************************
+ * 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * 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;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Used to specify the path and boundaries for a find operation or query.
+ *
+ * @since Java Persistence 2.1
+ */
+@Repeatable(NamedEntityGraphs.class)
+@Target({TYPE})
+@Retention(RUNTIME)
+public @interface NamedEntityGraph {
+
+ /**
+ * (Optional) The name of the entity graph.
+ * Defaults to the entity name of the root entity.
+ */
+ String name() default "";
+
+ /**
+ * (Optional) A list of attributes of the entity that are included in
+ * this graph.
+ */
+ NamedAttributeNode[] attributeNodes() default {};
+
+ /**
+ * (Optional) Includes all of the attributes of the annotated
+ * entity class as attribute nodes in the NamedEntityGraph without
+ * the need to explicitly list them. Included attributes can
+ * still be fully specified by an attribute node referencing a
+ * subgraph.
+ */
+ boolean includeAllAttributes() default false;
+
+ /**
+ * (Optional) A list of subgraphs that are included in the
+ * entity graph. These are referenced by name from NamedAttributeNode
+ * definitions.
+ */
+ NamedSubgraph[] subgraphs() default {};
+
+ /**
+ * (Optional) A list of subgraphs that will add additional
+ * attributes for subclasses of the annotated entity class to the
+ * entity graph. Specified attributes from superclasses are
+ * included in subclasses.
+ */
+ NamedSubgraph[] subclassSubgraphs() default {};
+}
+
Index: 3rdParty_sources/persistence-api/javax/persistence/NamedEntityGraphs.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/NamedEntityGraphs.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/NamedEntityGraphs.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,33 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/
+
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Used to group NamedEntityGraph
annotations.
+ *
+ * @see NamedEntityGraph
+ * @since Java Persistence 2.1
+ */
+@Target({TYPE})
+@Retention(RUNTIME)
+public @interface NamedEntityGraphs{
+ NamedEntityGraph[] value();
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/NamedNativeQueries.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/NamedNativeQueries.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/NamedNativeQueries.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies multiple native SQL named queries. Query names
+ * are scoped to the persistence unit. The NamedNativeQueries
+ * annotation can be applied to an entity or mapped superclass.
+ *
+ * @see NamedNativeQuery
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({TYPE})
+@Retention(RUNTIME)
+public @interface NamedNativeQueries {
+
+ /** (Required) Array of NamedNativeQuery
annotations. */
+ NamedNativeQuery[] value ();
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/NamedNativeQuery.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/NamedNativeQuery.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/NamedNativeQuery.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,55 @@
+/*******************************************************************************
+ * 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * 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;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies a named native SQL query.
+ * Query names are scoped to the persistence unit.
+ * The NamedNativeQuery
annotation can be applied to an
+ * entity or mapped superclass.
+ *
+ * @since Java Persistence 1.0
+ */
+@Repeatable(NamedNativeQueries.class)
+@Target({TYPE})
+@Retention(RUNTIME)
+public @interface NamedNativeQuery {
+
+ /**
+ * The name used to refer to the query with the {@link EntityManager}
+ * methods that create query objects.
+ */
+ String name();
+
+ /** The SQL query string. */
+ String query();
+
+ /** Query properties and hints. (May include vendor-specific query hints.) */
+ QueryHint[] hints() default {};
+
+ /** The class of the result. */
+ Class resultClass() default void.class;
+
+ /** The name of a {@link SqlResultSetMapping}, as defined in metadata. */
+ String resultSetMapping() default "";
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/NamedQueries.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/NamedQueries.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/NamedQueries.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,38 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies multiple named Java Persistence query language queries.
+ * Query names are scoped to the persistence unit.
+ * The NamedQueries
annotation can be applied to an entity or mapped superclass.
+ *
+ * @see NamedQuery
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({TYPE})
+@Retention(RUNTIME)
+public @interface NamedQueries {
+
+ /** (Required) An array of NamedQuery
annotations. */
+ NamedQuery [] value ();
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/NamedQuery.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/NamedQuery.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/NamedQuery.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * 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;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies a static, named query in the Java Persistence query language.
+ * Query names are scoped to the persistence unit.
+ * The NamedQuery
annotation can be applied to an entity or mapped superclass.
+ *
+ *
+ * @NamedQuery(
+ * name="findAllCustomersWithName",
+ * query="SELECT c FROM Customer c WHERE c.name LIKE :custName"
+ * )
+ *
+ *
+ *
+ * @PersistenceContext
+ * public EntityManager em;
+ * ...
+ * customers = em.createNamedQuery("findAllCustomersWithName")
+ * .setParameter("custName", "Smith")
+ * .getResultList();
+ *
+ *
+ * @since Java Persistence 1.0
+ */
+@Repeatable(NamedQueries.class)
+@Target({TYPE})
+@Retention(RUNTIME)
+public @interface NamedQuery {
+
+ /**
+ * (Required) The name used to refer to the query with the {@link EntityManager}
+ * methods that create query objects.
+ */
+ String name();
+
+ /** (Required)
+ * The query string in the Java Persistence query language.
+ */
+ String query();
+
+ /**
+ * (Optional) The lock mode type to use in query execution. If a lockMode
+ * other than LockModeType.NONE
is specified, the query must be executed in
+ * a transaction and the persistence context joined to the transaction.
+ * @since Java Persistence 2.0
+ */
+ LockModeType lockMode() default NONE;
+
+ /** (Optional) Query properties and hints. May include
+ * vendor-specific query hints.
+ */
+ QueryHint[] hints() default {};
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/NamedStoredProcedureQueries.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/NamedStoredProcedureQueries.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/NamedStoredProcedureQueries.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies multiple named stored procedure queries. Query names
+ * are scoped to the persistence unit. The NamedStoredProcedureQueries
+ * annotation can be applied to an entity or mapped superclass.
+ *
+ * @see NamedStoredProcedureQuery
+ *
+ * @since Java Persistence 2.1
+ */
+@Target({TYPE})
+@Retention(RUNTIME)
+public @interface NamedStoredProcedureQueries {
+
+ /** (Required) Array of NamedStoredProcedureQuery
annotations. */
+ NamedStoredProcedureQuery[] value ();
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/NamedStoredProcedureQuery.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/NamedStoredProcedureQuery.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/NamedStoredProcedureQuery.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,101 @@
+/*******************************************************************************
+ * 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * 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;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies and names a stored procedure, its parameters, and its result type.
+ *
+ * NamedStoredProcedureQuery
annotation can be applied to an
+ * entity or mapped superclass.
+ *
+ * name
element is the name that is passed as an argument to the
+ * {@link EntityManager#createNamedStoredProcedureQuery}
+ * method to create an executable StoredProcedureQuery
object.
+ * Names are scoped to the persistence unit.
+ *
+ * procedureName
element is the name of the stored procedure in
+ * the database.
+ *
+ * parameters
element. All parameters must be specified in the order in
+ * which they occur in the parameter list of the stored procedure.
+ *
+ * resultClasses
element refers to the class (or classes) that are
+ * used to map the results. The resultSetMappings
element names one or
+ * more result set mappings, as defined by the {@link SqlResultSetMapping}
+ * annotation.
+ *
+ * resultClasses
or resultSetMappings
+ * element is specified, any result set will be returned as a list of type
+ * Object[]. The combining of different strategies for the mapping of
+ * stored procedure result sets is undefined.
+ *
+ * hints
element may be used to specify query properties and
+ * hints. Properties defined by this specification must be observed by
+ * the provider. Vendor-specific hints that are not recognized by a
+ * provider must be ignored.
+ *
+ * StoredProcedureParameter
annotation.
+ *
+ * @see StoredProcedureQuery
+ * @see StoredProcedureParameter
+ *
+ * @since Java Persistence 2.1
+ */
+@Repeatable(NamedStoredProcedureQueries.class)
+@Target({TYPE})
+@Retention(RUNTIME)
+public @interface NamedStoredProcedureQuery {
+
+ /**
+ * The name used to refer to the query with the {@link EntityManager}
+ * methods that create stored procedure query objects.
+ */
+ String name();
+
+ /** The name of the stored procedure in the database. */
+ String procedureName();
+
+ /**
+ * Information about all parameters of the stored procedure.
+ * All parameters must be specified in the order in which they
+ * occur in the parameter list of the stored procedure.
+ */
+ StoredProcedureParameter[] parameters() default {};
+
+ /** The class or classes that are used to map the results. */
+ Class[] resultClasses() default {};
+
+ /** The names of one or more result set mappings, as defined in metadata. */
+ String[] resultSetMappings() default {};
+
+ /** Query properties and hints. (May include vendor-specific query hints.) */
+ QueryHint[] hints() default {};
+
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/NamedSubgraph.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/NamedSubgraph.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/NamedSubgraph.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,61 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/
+
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * A NamedSubgraph
is a member element of a
+ * NamedEntityGraph
. The NamedSubgraph
is
+ * only referenced from within a NamedEntityGraph and can not be
+ * referenced independently. It is referenced by its name
+ * from a NamedAttributeNode
element of the
+ * NamedEntityGraph
.
+ *
+ * @see NamedEntityGraph
+ * @see NamedAttributeNode
+ *
+ * @since Java Persistence 2.1
+ */
+@Target({})
+@Retention(RUNTIME)
+public @interface NamedSubgraph {
+
+ /**
+ * (Required) The name of the subgraph as referenced from a
+ * NamedAttributeNode element.
+ */
+ String name();
+
+ /**
+ * (Optional) The type represented by this subgraph. The element
+ * must be specified when this subgraph is extending a definition
+ * on behalf of a subclass.
+ */
+ Class type() default void.class;
+
+ /**
+ * (Required) The list of the attributes of the class that must
+ * be included. If the named subgraph corresponds to a subclass
+ * of the class referenced by the corresponding attribute node,
+ * then only subclass-specific attributes are listed.
+ */
+ NamedAttributeNode[] attributeNodes();
+}
+
+
Index: 3rdParty_sources/persistence-api/javax/persistence/NoResultException.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/NoResultException.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/NoResultException.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * Thrown by the persistence provider when {@link
+ * Query#getSingleResult Query.getSingleResult()} or {@link
+ * TypedQuery#getSingleResult TypedQuery.getSingleResult()}is executed on a query
+ * and there is no result to return. This exception will not cause
+ * the current transaction, if one is active, to be marked for
+ * rollback.
+ *
+ * @see Query#getSingleResult()
+ * @see TypedQuery#getSingleResult()
+ *
+ * @since Java Persistence 1.0
+ */
+public class NoResultException extends PersistenceException {
+
+ /**
+ * Constructs a new NoResultException
exception with
+ * null
as its detail message.
+ */
+ public NoResultException() {
+ super();
+ }
+
+ /**
+ * Constructs a new NoResultException
exception with the
+ * specified detail message.
+ *
+ * @param message
+ * the detail message.
+ */
+ public NoResultException(String message) {
+ super(message);
+ }
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/NonUniqueResultException.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/NonUniqueResultException.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/NonUniqueResultException.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * Thrown by the persistence provider when {@link
+ * Query#getSingleResult Query.getSingleResult()} or {@link
+ * TypedQuery#getSingleResult TypedQuery.getSingleResult()} is executed on a
+ * query and there is more than one result from the query. This
+ * exception will not cause the current transaction, if one is active,
+ * to be marked for rollback.
+ *
+ * @see Query#getSingleResult()
+ * @see TypedQuery#getSingleResult()
+ *
+ * @since Java Persistence 1.0
+ */
+public class NonUniqueResultException extends PersistenceException {
+
+ /**
+ * Constructs a new NonUniqueResultException
exception
+ * with null
as its detail message.
+ */
+ public NonUniqueResultException() {
+ super();
+ }
+
+ /**
+ * Constructs a new NonUniqueResultException
exception
+ * with the specified detail message.
+ * @param message the detail message.
+ */
+ public NonUniqueResultException(String message) {
+ super(message);
+ }
+}
+
Index: 3rdParty_sources/persistence-api/javax/persistence/OneToMany.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/OneToMany.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/OneToMany.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,136 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import javax.persistence.CascadeType;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.FetchType.LAZY;
+
+/**
+ * Specifies a many-valued association with one-to-many multiplicity.
+ *
+ * mappedBy
element must be used to specify the relationship field or
+ * property of the entity that is the owner of the relationship.
+ *
+ * OneToMany
annotation may be used within an embeddable class
+ * contained within an entity class to specify a relationship to a
+ * collection of entities. If the relationship is bidirectional, the
+ * mappedBy
element must be used to specify the relationship field or
+ * property of the entity that is the owner of the relationship.
+ *
+ * When the collection is a java.util.Map
, the cascade
+ * element and the orphanRemoval
element apply to the map value.
+ *
+ *
+ *
+ * Example 1: One-to-Many association using generics
+ *
+ * // In Customer class:
+ *
+ * @OneToMany(cascade=ALL, mappedBy="customer")
+ * public Set<Order> getOrders() { return orders; }
+ *
+ * In Order class:
+ *
+ * @ManyToOne
+ * @JoinColumn(name="CUST_ID", nullable=false)
+ * public Customer getCustomer() { return customer; }
+ *
+ *
+ * Example 2: One-to-Many association without using generics
+ *
+ * // In Customer class:
+ *
+ * @OneToMany(targetEntity=com.acme.Order.class, cascade=ALL,
+ * mappedBy="customer")
+ * public Set getOrders() { return orders; }
+ *
+ * // In Order class:
+ *
+ * @ManyToOne
+ * @JoinColumn(name="CUST_ID", nullable=false)
+ * public Customer getCustomer() { return customer; }
+ *
+ *
+ * Example 3: Unidirectional One-to-Many association using a foreign key mapping
+ *
+ * // In Customer class:
+ *
+ * @OneToMany(orphanRemoval=true)
+ * @JoinColumn(name="CUST_ID") // join column is in table for Order
+ * public Set<Order> getOrders() {return orders;}
+ *
+ *
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({METHOD, FIELD})
+@Retention(RUNTIME)
+
+public @interface OneToMany {
+
+ /**
+ * (Optional) The entity class that is the target
+ * of the association. Optional only if the collection
+ * property is defined using Java generics.
+ * Must be specified otherwise.
+ *
+ * cascade
element applies to the
+ * map value.
+ */
+ CascadeType[] cascade() default {};
+
+ /** (Optional) Whether the association should be lazily loaded or
+ * must be eagerly fetched. The EAGER strategy is a requirement on
+ * the persistence provider runtime that the associated entities
+ * must be eagerly fetched. The LAZY strategy is a hint to the
+ * persistence provider runtime.
+ */
+ FetchType fetch() default LAZY;
+
+ /**
+ * The field that owns the relationship. Required unless
+ * the relationship is unidirectional.
+ */
+ String mappedBy() default "";
+
+ /**
+ * (Optional) Whether to apply the remove operation to entities that have
+ * been removed from the relationship and to cascade the remove operation to
+ * those entities.
+ * @since Java Persistence 2.0
+ */
+ boolean orphanRemoval() default false;
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/OneToOne.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/OneToOne.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/OneToOne.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,164 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import javax.persistence.CascadeType;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.FetchType.EAGER;
+
+/**
+ * Specifies a single-valued association to another entity that has
+ * one-to-one multiplicity. It is not normally necessary to specify
+ * the associated target entity explicitly since it can usually be
+ * inferred from the type of the object being referenced. If the relationship is
+ * bidirectional, the non-owning side must use the mappedBy
element of
+ * the OneToOne
annotation to specify the relationship field or
+ * property of the owning side.
+ *
+ * OneToOne
annotation may be used within an
+ * embeddable class to specify a relationship from the embeddable
+ * class to an entity class. If the relationship is bidirectional and
+ * the entity containing the embeddable class is on the owning side of
+ * the relationship, the non-owning side must use the
+ * mappedBy
element of the OneToOne
+ * annotation to specify the relationship field or property of the
+ * embeddable class. The dot (".") notation syntax must be used in the
+ * mappedBy
element to indicate the relationship attribute within the
+ * embedded attribute. The value of each identifier used with the dot
+ * notation is the name of the respective embedded field or property.
+ *
+ *
+ * Example 1: One-to-one association that maps a foreign key column
+ *
+ * // On Customer class:
+ *
+ * @OneToOne(optional=false)
+ * @JoinColumn(
+ * name="CUSTREC_ID", unique=true, nullable=false, updatable=false)
+ * public CustomerRecord getCustomerRecord() { return customerRecord; }
+ *
+ * // On CustomerRecord class:
+ *
+ * @OneToOne(optional=false, mappedBy="customerRecord")
+ * public Customer getCustomer() { return customer; }
+ *
+ *
+ * Example 2: One-to-one association that assumes both the source and target share the same primary key values.
+ *
+ * // On Employee class:
+ *
+ * @Entity
+ * public class Employee {
+ * @Id Integer id;
+ *
+ * @OneToOne @MapsId
+ * EmployeeInfo info;
+ * ...
+ * }
+ *
+ * // On EmployeeInfo class:
+ *
+ * @Entity
+ * public class EmployeeInfo {
+ * @Id Integer id;
+ * ...
+ * }
+ *
+ *
+ * Example 3: One-to-one association from an embeddable class to another entity.
+ *
+ * @Entity
+ * public class Employee {
+ * @Id int id;
+ * @Embedded LocationDetails location;
+ * ...
+ * }
+ *
+ * @Embeddable
+ * public class LocationDetails {
+ * int officeNumber;
+ * @OneToOne ParkingSpot parkingSpot;
+ * ...
+ * }
+ *
+ * @Entity
+ * public class ParkingSpot {
+ * @Id int id;
+ * String garage;
+ * @OneToOne(mappedBy="location.parkingSpot") Employee assignedTo;
+ * ...
+ * }
+ *
+ *
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({METHOD, FIELD})
+@Retention(RUNTIME)
+
+public @interface OneToOne {
+
+ /**
+ * (Optional) The entity class that is the target of
+ * the association.
+ *
+ * OptimisticLockException
exception with
+ * null
as its detail message.
+ */
+ public OptimisticLockException() {
+ super();
+ }
+
+ /**
+ * Constructs a new OptimisticLockException
exception with the
+ * specified detail message.
+ *
+ * @param message
+ * the detail message.
+ */
+ public OptimisticLockException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructs a new OptimisticLockException
exception with the
+ * specified detail message and cause.
+ *
+ * @param message
+ * the detail message.
+ * @param cause
+ * the cause.
+ */
+ public OptimisticLockException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Constructs a new OptimisticLockException
exception with the
+ * specified cause.
+ *
+ * @param cause
+ * the cause.
+ */
+ public OptimisticLockException(Throwable cause) {
+ super(cause);
+ }
+
+ /**
+ * Constructs a new OptimisticLockException
exception with the
+ * specified entity.
+ *
+ * @param entity
+ * the entity.
+ */
+ public OptimisticLockException(Object entity) {
+ this.entity = entity;
+ }
+
+ /**
+ * Constructs a new OptimisticLockException
exception with the
+ * specified detail message, cause, and entity.
+ *
+ * @param message
+ * the detail message.
+ * @param cause
+ * the cause.
+ * @param entity
+ * the entity.
+ */
+ public OptimisticLockException(String message, Throwable cause, Object entity) {
+ super(message, cause);
+ this.entity = entity;
+ }
+
+ /**
+ * Returns the entity that caused this exception.
+ *
+ * @return the entity.
+ */
+ public Object getEntity() {
+ return this.entity;
+ }
+
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/OrderBy.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/OrderBy.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/OrderBy.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,137 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies the ordering of the elements of a collection valued
+ * association or element collection at the point when the association
+ * or collection is retrieved.
+ *
+ * value
ordering element is an
+ * orderby_list
, as follows:
+ *
+ *
+ * orderby_list::= orderby_item [,orderby_item]*
+ * orderby_item::= [property_or_field_name] [ASC | DESC]
+ *
+ *
+ * ASC
or DESC
is not specified,
+ * ASC
(ascending order) is assumed.
+ *
+ * OrderBy
annotation may be applied to an element
+ * collection. When OrderBy
is applied to an element collection of
+ * basic type, the ordering will be by value of the basic objects and
+ * the property or field name is not used. When specifying an ordering
+ * over an element collection of embeddable type, the dot notation
+ * must be used to specify the attribute or attributes that determine
+ * the ordering.
+ *
+ * OrderBy
annotation is not used when an order
+ * column is specified.
+ *
+ *
+ *
+ * Example 1:
+ *
+ * @Entity
+ * public class Course {
+ * ...
+ * @ManyToMany
+ * @OrderBy("lastname ASC")
+ * public List<Student> getStudents() {...};
+ * ...
+ * }
+ *
+ * Example 2:
+ *
+ * @Entity
+ * public class Student {
+ * ...
+ * @ManyToMany(mappedBy="students")
+ * @OrderBy // ordering by primary key is assumed
+ * public List<Course> getCourses() {...};
+ * ...
+ * }
+ *
+ * Example 3:
+ *
+ * @Entity
+ * public class Person {
+ * ...
+ * @ElementCollection
+ * @OrderBy("zipcode.zip, zipcode.plusFour")
+ * public Set<Address> getResidences() {...};
+ * ...
+ * }
+ *
+ * @Embeddable
+ * public class Address {
+ * protected String street;
+ * protected String city;
+ * protected String state;
+ * @Embedded protected Zipcode zipcode;
+ * }
+ *
+ * @Embeddable
+ * public class Zipcode {
+ * protected String zip;
+ * protected String plusFour;
+ * }
+ *
+ *
+ * @see OrderColumn
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({METHOD, FIELD})
+@Retention(RUNTIME)
+
+public @interface OrderBy {
+
+ /**
+ * An orderby_list
. Specified as follows:
+ *
+ *
+ * orderby_list::= orderby_item [,orderby_item]*
+ * orderby_item::= [property_or_field_name] [ASC | DESC]
+ *
+ *
+ * ASC
or DESC
is not specified,
+ * ASC
(ascending order) is assumed.
+ *
+ * OrderColumn
annotation is specified on a
+ * OneToMany or ManyToMany relationship or on an element
+ * collection. The OrderColumn
annotation is specified on
+ * the side of the relationship that references the collection that is
+ * to be ordered. The order column is not visible as part of the state
+ * of the entity or embeddable class.
+ *
+ * OrderBy
annotation is not used when
+ * OrderColumn
is specified.
+ *
+ *
+ *
+ * Example:
+ *
+ * @Entity
+ * public class CreditCard {
+ *
+ * @Id long ccNumber;
+ *
+ * @OneToMany // unidirectional
+ * @OrderColumn
+ * List<CardTransaction> transactionHistory;
+ * ...
+ * }
+ *
+ *
+ *
+ * @see OrderBy
+ *
+ * @since Java Persistence 2.0
+ */
+@Target( { METHOD, FIELD })
+@Retention(RUNTIME)
+public @interface OrderColumn {
+
+ /** (Optional) The name of the ordering column.
+ * Defaults to the concatenation of the name of the
+ * referencing property or field; "_"; "ORDER".
+ */
+ String name() default "";
+
+ /** (Optional) Whether the database column is nullable. */
+ boolean nullable() default true;
+
+ /**
+ * (Optional) Whether the column is included in SQL INSERT statements
+ * generated by the persistence provider.
+ */
+ boolean insertable() default true;
+
+ /**
+ * (Optional) Whether the column is included in SQL UPDATE statements
+ * generated by the persistence provider.
+ */
+ boolean updatable() default true;
+
+ /**
+ * (Optional) The SQL fragment that is used when generating the DDL for the
+ * column. Defaults to generated SQL to create a column of the inferred type.
+ */
+ String columnDefinition() default "";
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/Parameter.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/Parameter.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/Parameter.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,58 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * Type for query parameter objects.
+ * @param Persistence
class is available in a Java EE
+ * container environment as well; however, support for the Java SE
+ * bootstrapping APIs is not required in container environments.
+ *
+ * Persistence
class is used to obtain a {@link
+ * javax.persistence.PersistenceUtil PersistenceUtil} instance in both
+ * Java EE and Java SE environments.
+ *
+ * @since Java Persistence 1.0
+ */
+public class Persistence {
+
+ /**
+ * Create and return an EntityManagerFactory for the named
+ * persistence unit.
+ *
+ * @param persistenceUnitName
+ * the name of the persistence unit
+ * @return the factory that creates EntityManagers configured according to
+ * the specified persistence unit
+ */
+ public static EntityManagerFactory createEntityManagerFactory(String persistenceUnitName) {
+ return createEntityManagerFactory(persistenceUnitName, null);
+ }
+
+ /**
+ * Create and return an EntityManagerFactory for the named persistence unit
+ * using the given properties.
+ *
+ * @param persistenceUnitName
+ * the name of the persistence unit
+ * @param properties
+ * Additional properties to use when creating the factory.
+ * These properties may include properties to control
+ * schema generation. The values of these properties override
+ * any values that may have been configured elsewhere.
+ * @return the factory that creates EntityManagers configured according to
+ * the specified persistence unit.
+ */
+ public static EntityManagerFactory createEntityManagerFactory(String persistenceUnitName, Map properties) {
+
+ EntityManagerFactory emf = null;
+ PersistenceProviderResolver resolver = PersistenceProviderResolverHolder.getPersistenceProviderResolver();
+
+ Listpersistence.xml
file. If the unitName
element is
+ * specified, the persistence unit for the entity manager that is
+ * accessible in JNDI must have the same name.
+ */
+ String unitName() default "";
+
+ /**
+ * (Optional) Specifies whether a transaction-scoped persistence context
+ * or an extended persistence context is to be used.
+ */
+ PersistenceContextType type() default PersistenceContextType.TRANSACTION;
+
+ /**
+ * (Optional) Specifies whether the persistence context is always
+ * automatically synchronized with the current transaction or whether
+ * the persistence context must be explicitly joined to the current
+ * transaction by means of the EntityManager
+ * {@link EntityManager#joinTransaction joinTransaction} method.
+ * @since Java Persistence 2.1
+ */
+ SynchronizationType synchronization() default SynchronizationType.SYNCHRONIZED;
+
+ /**
+ * (Optional) Properties for the container or persistence
+ * provider. Vendor specific properties may be included in this
+ * set of properties. Properties that are not recognized by
+ * a vendor are ignored.
+ */
+ PersistenceProperty[] properties() default {};
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/PersistenceContextType.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/PersistenceContextType.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/PersistenceContextType.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,32 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * Specifies whether a transaction-scoped or extended
+ * persistence context is to be used in {@link PersistenceContext}.
+ * If not specified, a transaction-scoped persistence context is used.
+ *
+ * @since Java Persistence 1.0
+ */
+public enum PersistenceContextType {
+
+ /** Transaction-scoped persistence context */
+ TRANSACTION,
+
+ /** Extended persistence context */
+ EXTENDED
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/PersistenceContexts.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/PersistenceContexts.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/PersistenceContexts.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,39 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import static java.lang.annotation.ElementType.*;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * Declares one or more {@link PersistenceContext} annotations.
+ * It is used to express a dependency on container-managed
+ * entity manager persistence contexts.
+ *
+ *@see PersistenceContext
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({TYPE})
+@Retention(RUNTIME)
+public @interface PersistenceContexts {
+
+ /** (Required) One or more PersistenceContext
annotations. */
+ PersistenceContext[] value();
+
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/PersistenceException.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/PersistenceException.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/PersistenceException.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+
+/**
+ * Thrown by the persistence provider when a problem occurs.
+ * All instances of PersistenceException
except for instances of
+ * {@link NoResultException}, {@link NonUniqueResultException},
+ * {@link LockTimeoutException}, and {@link QueryTimeoutException} will cause
+ * the current transaction, if one is active and the persistence context has
+ * been joined to it, to be marked for rollback.
+ *
+ * @since Java Persistence 1.0
+ */
+public class PersistenceException extends RuntimeException {
+
+ /**
+ * Constructs a new PersistenceException
exception
+ * with null
as its detail message.
+ */
+ public PersistenceException() {
+ super();
+ }
+
+ /**
+ * Constructs a new PersistenceException
exception
+ * with the specified detail message.
+ * @param message the detail message.
+ */
+ public PersistenceException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructs a new PersistenceException
exception
+ * with the specified detail message and cause.
+ * @param message the detail message.
+ * @param cause the cause.
+ */
+ public PersistenceException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Constructs a new PersistenceException
exception
+ * with the specified cause.
+ * @param cause the cause.
+ */
+ public PersistenceException(Throwable cause) {
+ super(cause);
+ }
+}
+
Index: 3rdParty_sources/persistence-api/javax/persistence/PersistenceProperty.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/PersistenceProperty.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/PersistenceProperty.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,43 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.*;
+
+/**
+ * Describes a single container or persistence provider property. Used in {@link
+ * PersistenceContext}.
+ *
+ * persistence.xml
file. If specified, the
+ * persistence unit for the entity manager factory that is
+ * accessible in JNDI must have the same name.
+ */
+ String unitName() default "";
+
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/PersistenceUnitUtil.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/PersistenceUnitUtil.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/PersistenceUnitUtil.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,67 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * Utility interface between the application and the persistence
+ * provider managing the persistence unit.
+ *
+ * FetchType.EAGER
has been specified have been
+ * loaded.
+ * isLoaded(Object, String)
method
+ * should be used to determine the load state of an attribute.
+ * Not doing so might lead to unintended loading of state.
+ * @param entity entity instance whose load state is to be determined
+ * @return false if the entity has not been loaded, else true
+ */
+ public boolean isLoaded(Object entity);
+
+ /**
+ * Return the id of the entity.
+ * A generated id is not guaranteed to be available until after
+ * the database insert has occurred.
+ * Returns null if the entity does not yet have an id.
+ * @param entity entity instance
+ * @return id of the entity
+ * @throws IllegalArgumentException if the object is found not
+ * to be an entity
+ */
+ public Object getIdentifier(Object entity);
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/PersistenceUnits.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/PersistenceUnits.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/PersistenceUnits.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,37 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import static java.lang.annotation.ElementType.*;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.*;
+
+
+/**
+ * Declares one or more {@link PersistenceUnit} annotations.
+ *
+ * @since Java Persistence 1.0
+ */
+
+@Target({TYPE})
+@Retention(RUNTIME)
+public @interface PersistenceUnits {
+
+ /** (Required) One or more {@link PersistenceUnit} annotations. */
+ PersistenceUnit[] value();
+
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/PersistenceUtil.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/PersistenceUtil.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/PersistenceUtil.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,54 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * Utility interface between the application and the persistence
+ * provider(s).
+ *
+ * PersistenceUtil
interface instance obtained from the
+ * {@link Persistence} class is used to determine the load state of an
+ * entity or entity attribute regardless of which persistence
+ * provider in the environment created the entity.
+ *
+ * @since Java Persistence 2.0
+ */
+public interface PersistenceUtil {
+
+ /**
+ * Determine the load state of a given persistent attribute.
+ * @param entity entity containing the attribute
+ * @param attributeName name of attribute whose load state is
+ * to be determined
+ * @return false if entity's state has not been loaded or
+ * if the attribute state has not been loaded, else true
+ */
+ public boolean isLoaded(Object entity, String attributeName);
+
+ /**
+ * Determine the load state of an entity.
+ * This method can be used to determine the load state
+ * of an entity passed as a reference. An entity is
+ * considered loaded if all attributes for which
+ * FetchType.EAGER
has been specified have been loaded.
+ * isLoaded(Object, String)
method should be used to
+ * determine the load state of an attribute.
+ * Not doing so might lead to unintended loading of state.
+ * @param entity whose load state is to be determined
+ * @return false if the entity has not been loaded, else true
+ */
+ public boolean isLoaded(Object entity);
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/PessimisticLockException.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/PessimisticLockException.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/PessimisticLockException.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * Thrown by the persistence provider when an pessimistic locking conflict
+ * occurs. This exception may be thrown as part of an API call, a flush or at
+ * commit time. The current transaction, if one is active, will be marked for
+ * rollback.
+ *
+ * @since Java Persistence 2.0
+ */
+public class PessimisticLockException extends PersistenceException {
+ /** The object that caused the exception */
+ Object entity;
+
+ /**
+ * Constructs a new PessimisticLockException
exception
+ * with null
as its detail message.
+ */
+ public PessimisticLockException() {
+ super();
+ }
+
+ /**
+ * Constructs a new PessimisticLockException
exception
+ * with the specified detail message.
+ * @param message the detail message.
+ */
+ public PessimisticLockException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructs a new PessimisticLockException
exception
+ * with the specified detail message and cause.
+ * @param message the detail message.
+ * @param cause the cause.
+ */
+ public PessimisticLockException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Constructs a new PessimisticLockException
exception
+ * with the specified cause.
+ * @param cause the cause.
+ */
+ public PessimisticLockException(Throwable cause) {
+ super(cause);
+ }
+
+ /**
+ * Constructs a new PessimisticLockException
exception
+ * with the specified entity.
+ * @param entity the entity.
+ */
+ public PessimisticLockException(Object entity) {
+ this.entity = entity;
+ }
+
+ /**
+ * Constructs a new PessimisticLockException
exception
+ * with the specified detail message, cause, and entity.
+ * @param message the detail message.
+ * @param cause the cause.
+ * @param entity the entity.
+ */
+ public PessimisticLockException(String message, Throwable cause, Object entity) {
+ super(message, cause);
+ this.entity = entity;
+ }
+
+ /**
+ * Returns the entity that caused this exception.
+ * @return the entity.
+ */
+ public Object getEntity() {
+ return this.entity;
+ }
+}
+
+
+
Index: 3rdParty_sources/persistence-api/javax/persistence/PessimisticLockScope.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/PessimisticLockScope.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/PessimisticLockScope.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * Defines the values of the javax.persistence.lock.scope
+ * property for pessimistic locking. This property may be passed as
+ * an argument to the methods of the {@link EntityManager},
+ * {@link Query}, and {@link TypedQuery} interfaces that
+ * allow lock modes to be specified or used with the
+ * {@link NamedQuery} annotation.
+ *
+ * @since Java Persistence 2.0
+ */
+public enum PessimisticLockScope {
+
+ /**
+ * This value defines the default behavior for pessimistic locking.
+ *
+ * PessimisticLockScope.NORMAL
, element collections
+ * and relationships owned by the entity that are contained in
+ * join tables will be locked if the
+ * javax.persistence.lock.scope
property is specified
+ * with a value of PessimisticLockScope.EXTENDED
.
+ * The state of entities referenced by such relationships will not
+ * be locked (unless those entities are explicitly locked).
+ * Locking such a relationship or element collection generally locks only
+ * the rows in the join table or collection table for that
+ * relationship or collection. This means that phantoms will be
+ * possible.
+ */
+ EXTENDED
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/PostLoad.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/PostLoad.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/PostLoad.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies a callback method for the corresponding
+ * lifecycle event. This annotation may be applied to methods
+ * of an entity class, a mapped superclass, or a callback
+ * listener class.
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({METHOD})
+@Retention(RUNTIME)
+
+public @interface PostLoad {}
Index: 3rdParty_sources/persistence-api/javax/persistence/PostPersist.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/PostPersist.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/PostPersist.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies a callback method for the corresponding
+ * lifecycle event. This annotation may be applied to methods
+ * of an entity class, a mapped superclass, or a callback
+ * listener class.
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({METHOD})
+@Retention(RUNTIME)
+
+public @interface PostPersist {}
Index: 3rdParty_sources/persistence-api/javax/persistence/PostRemove.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/PostRemove.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/PostRemove.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies a callback method for the corresponding
+ * lifecycle event. This annotation may be applied to methods
+ * of an entity class, a mapped superclass, or a callback
+ * listener class.
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({METHOD})
+@Retention(RUNTIME)
+
+public @interface PostRemove {}
Index: 3rdParty_sources/persistence-api/javax/persistence/PostUpdate.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/PostUpdate.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/PostUpdate.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies a callback method for the corresponding
+ * lifecycle event. This annotation may be applied to methods
+ * of an entity class, a mapped superclass, or a callback
+ * listener class.
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({METHOD})
+@Retention(RUNTIME)
+
+public @interface PostUpdate {}
Index: 3rdParty_sources/persistence-api/javax/persistence/PrePersist.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/PrePersist.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/PrePersist.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies a callback method for the corresponding
+ * lifecycle event. This annotation may be applied to methods
+ * of an entity class, a mapped superclass, or a callback
+ * listener class.
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({METHOD})
+@Retention(RUNTIME)
+
+public @interface PrePersist {}
Index: 3rdParty_sources/persistence-api/javax/persistence/PreRemove.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/PreRemove.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/PreRemove.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies a callback method for the corresponding
+ * lifecycle event. This annotation may be applied to methods
+ * of an entity class, a mapped superclass, or a callback
+ * listener class.
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({METHOD})
+@Retention(RUNTIME)
+
+public @interface PreRemove {}
Index: 3rdParty_sources/persistence-api/javax/persistence/PreUpdate.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/PreUpdate.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/PreUpdate.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies a callback method for the corresponding
+ * lifecycle event. This annotation may be applied to methods
+ * of an entity class, a mapped superclass, or a callback
+ * listener class.
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({METHOD})
+@Retention(RUNTIME)
+
+public @interface PreUpdate {}
Index: 3rdParty_sources/persistence-api/javax/persistence/PrimaryKeyJoinColumn.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/PrimaryKeyJoinColumn.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/PrimaryKeyJoinColumn.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,118 @@
+/*******************************************************************************
+ * 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * 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;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.ConstraintMode.PROVIDER_DEFAULT;
+
+/**
+ * Specifies a primary key column that is used as a foreign key to
+ * join to another table.
+ *
+ * PrimaryKeyJoinColumn
annotation is
+ * specified for a subclass in the JOINED
+ * mapping strategy, the foreign key columns are assumed
+ * to have the same names as the primary key columns of the
+ * primary table of the superclass.
+ *
+ *
+ *
+ * Example: Customer and ValuedCustomer subclass
+ *
+ * @Entity
+ * @Table(name="CUST")
+ * @Inheritance(strategy=JOINED)
+ * @DiscriminatorValue("CUST")
+ * public class Customer { ... }
+ *
+ * @Entity
+ * @Table(name="VCUST")
+ * @DiscriminatorValue("VCUST")
+ * @PrimaryKeyJoinColumn(name="CUST_ID")
+ * public class ValuedCustomer extends Customer { ... }
+ *
+ *
+ * @see SecondaryTable
+ * @see Inheritance
+ * @see OneToOne
+ * @see ForeignKey
+ *
+ * @since Java Persistence 1.0
+ */
+@Repeatable(PrimaryKeyJoinColumns.class)
+@Target({TYPE, METHOD, FIELD})
+@Retention(RUNTIME)
+
+public @interface PrimaryKeyJoinColumn {
+
+ /**
+ * (Optional) The name of the primary key column of the current table.
+ * JOINED
mapping strategy); the same
+ * name as the primary key column of the primary table
+ * (SecondaryTable
mapping); or the same name as the
+ * primary key column for the table for the referencing entity
+ * (OneToOne
mapping).
+ */
+ String name() default "";
+
+ /**
+ * (Optional) The name of the primary key column of the table
+ * being joined to. JOINED
mapping strategy); the same name as the
+ * primary key column of the primary table
+ * (SecondaryTable
mapping); or the same name as the
+ * primary key column for the table for the referencing entity
+ * (OneToOne
mapping).
+ */
+ String referencedColumnName() default "";
+
+ /**
+ * (Optional) The SQL fragment that is used when generating the
+ * DDL for the column. This should not be specified for a
+ * OneToOne
primary key association.
+ *
+ * Example: ValuedCustomer subclass
+ *
+ * @Entity
+ * @Table(name="VCUST")
+ * @DiscriminatorValue("VCUST")
+ * @PrimaryKeyJoinColumns({
+ * @PrimaryKeyJoinColumn(name="CUST_ID",
+ * referencedColumnName="ID"),
+ * @PrimaryKeyJoinColumn(name="CUST_TYPE",
+ * referencedColumnName="TYPE")
+ * })
+ * public class ValuedCustomer extends Customer { ... }
+ *
+ *
+ * @see ForeignKey
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({TYPE, METHOD, FIELD})
+@Retention(RUNTIME)
+
+public @interface PrimaryKeyJoinColumns {
+
+ /** One or more PrimaryKeyJoinColumn
annotations. */
+ PrimaryKeyJoinColumn[] value();
+
+ /**
+ * (Optional) Used to specify or control the generation of a
+ * foreign key constraint when table generation is in effect.
+ * If both this element and the foreignKey
element
+ * of any of the PrimaryKeyJoinColumn
elements are specified,
+ * the behavior is undefined. If no foreign key annotation element
+ * is specified in either location, the persistence provider's
+ * default foreign key strategy will apply.
+ *
+ * @since Java Persistence 2.1
+ */
+ ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT);
+
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/Query.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/Query.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/Query.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,488 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2017 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Lukas Jungmann - Java Persistence 2.2
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+import java.util.Set;
+import java.util.Map;
+import java.util.stream.Stream;
+
+/**
+ * Interface used to control query execution.
+ *
+ * @see TypedQuery
+ * @see StoredProcedureQuery
+ * @see Parameter
+ *
+ * @since Java Persistence 1.0
+ */
+public interface Query {
+
+ /**
+ * Execute a SELECT query and return the query results
+ * as an untyped List.
+ * @return a list of the results
+ * @throws IllegalStateException if called for a Java
+ * Persistence query language UPDATE or DELETE statement
+ * @throws QueryTimeoutException if the query execution exceeds
+ * the query timeout value set and only the statement is
+ * rolled back
+ * @throws TransactionRequiredException if a lock mode other than
+ * NONE
has been set and there is no transaction
+ * or the persistence context has not been joined to the transaction
+ * @throws PessimisticLockException if pessimistic locking
+ * fails and the transaction is rolled back
+ * @throws LockTimeoutException if pessimistic locking
+ * fails and only the statement is rolled back
+ * @throws PersistenceException if the query execution exceeds
+ * the query timeout value set and the transaction
+ * is rolled back
+ */
+ List getResultList();
+
+ /**
+ * Execute a SELECT query and return the query results
+ * as an untyped java.util.stream.Stream
.
+ * By default this method delegates to getResultList().stream()
,
+ * however persistence provider may choose to override this method
+ * to provide additional capabilities.
+ *
+ * @return a stream of the results
+ * @throws IllegalStateException if called for a Java
+ * Persistence query language UPDATE or DELETE statement
+ * @throws QueryTimeoutException if the query execution exceeds
+ * the query timeout value set and only the statement is
+ * rolled back
+ * @throws TransactionRequiredException if a lock mode other than
+ * NONE
has been set and there is no transaction
+ * or the persistence context has not been joined to the transaction
+ * @throws PessimisticLockException if pessimistic locking
+ * fails and the transaction is rolled back
+ * @throws LockTimeoutException if pessimistic locking
+ * fails and only the statement is rolled back
+ * @throws PersistenceException if the query execution exceeds
+ * the query timeout value set and the transaction
+ * is rolled back
+ * @see Stream
+ * @see #getResultList()
+ * @since 2.2
+ */
+ default Stream getResultStream() {
+ return getResultList().stream();
+ }
+
+ /**
+ * Execute a SELECT query that returns a single untyped result.
+ * @return the result
+ * @throws NoResultException if there is no result
+ * @throws NonUniqueResultException if more than one result
+ * @throws IllegalStateException if called for a Java
+ * Persistence query language UPDATE or DELETE statement
+ * @throws QueryTimeoutException if the query execution exceeds
+ * the query timeout value set and only the statement is
+ * rolled back
+ * @throws TransactionRequiredException if a lock mode other than
+ * NONE
has been set and there is no transaction
+ * or the persistence context has not been joined to the transaction
+ * @throws PessimisticLockException if pessimistic locking
+ * fails and the transaction is rolled back
+ * @throws LockTimeoutException if pessimistic locking
+ * fails and only the statement is rolled back
+ * @throws PersistenceException if the query execution exceeds
+ * the query timeout value set and the transaction
+ * is rolled back
+ */
+ Object getSingleResult();
+
+ /**
+ * Execute an update or delete statement.
+ * @return the number of entities updated or deleted
+ * @throws IllegalStateException if called for a Java
+ * Persistence query language SELECT statement or for
+ * a criteria query
+ * @throws TransactionRequiredException if there is
+ * no transaction or the persistence context has not
+ * been joined to the transaction
+ * @throws QueryTimeoutException if the statement execution
+ * exceeds the query timeout value set and only
+ * the statement is rolled back
+ * @throws PersistenceException if the query execution exceeds
+ * the query timeout value set and the transaction
+ * is rolled back
+ */
+ int executeUpdate();
+
+ /**
+ * Set the maximum number of results to retrieve.
+ * @param maxResult maximum number of results to retrieve
+ * @return the same query instance
+ * @throws IllegalArgumentException if the argument is negative
+ */
+ Query setMaxResults(int maxResult);
+
+ /**
+ * The maximum number of results the query object was set to
+ * retrieve. Returns Integer.MAX_VALUE
if setMaxResults
was not
+ * applied to the query object.
+ * @return maximum number of results
+ * @since Java Persistence 2.0
+ */
+ int getMaxResults();
+
+ /**
+ * Set the position of the first result to retrieve.
+ * @param startPosition position of the first result,
+ * numbered from 0
+ * @return the same query instance
+ * @throws IllegalArgumentException if the argument is negative
+ */
+ Query setFirstResult(int startPosition);
+
+ /**
+ * The position of the first result the query object was set to
+ * retrieve. Returns 0 if setFirstResult
was not applied to the
+ * query object.
+ * @return position of the first result
+ * @since Java Persistence 2.0
+ */
+ int getFirstResult();
+
+ /**
+ * Set a query property or hint. The hints elements may be used
+ * to specify query properties and hints. Properties defined by
+ * this specification must be observed by the provider.
+ * Vendor-specific hints that are not recognized by a provider
+ * must be silently ignored. Portable applications should not
+ * rely on the standard timeout hint. Depending on the database
+ * in use and the locking mechanisms used by the provider,
+ * this hint may or may not be observed.
+ * @param hintName name of the property or hint
+ * @param value value for the property or hint
+ * @return the same query instance
+ * @throws IllegalArgumentException if the second argument is not
+ * valid for the implementation
+ */
+ Query setHint(String hintName, Object value);
+
+ /**
+ * Get the properties and hints and associated values that are
+ * in effect for the query instance.
+ * @return query properties and hints
+ * @since Java Persistence 2.0
+ */
+ MapParameter
object.
+ * @param param parameter object
+ * @param value parameter value
+ * @return the same query instance
+ * @throws IllegalArgumentException if the parameter
+ * does not correspond to a parameter of the
+ * query
+ * @since Java Persistence 2.0
+ */
+ java.util.Calendar
to a Parameter
object.
+ * @param param parameter object
+ * @param value parameter value
+ * @param temporalType temporal type
+ * @return the same query instance
+ * @throws IllegalArgumentException if the parameter does not
+ * correspond to a parameter of the query
+ * @since Java Persistence 2.0
+ */
+ Query setParameter(Parameterjava.util.Date
to a Parameter
object.
+ * @param param parameter object
+ * @param value parameter value
+ * @param temporalType temporal type
+ * @return the same query instance
+ * @throws IllegalArgumentException if the parameter does not
+ * correspond to a parameter of the query
+ * @since Java Persistence 2.0
+ */
+ Query setParameter(Parameterjava.util.Calendar
to a named parameter.
+ * @param name parameter name
+ * @param value parameter value
+ * @param temporalType temporal type
+ * @return the same query instance
+ * @throws IllegalArgumentException if the parameter name does
+ * not correspond to a parameter of the query or if
+ * the value argument is of incorrect type
+ */
+ Query setParameter(String name, Calendar value,
+ TemporalType temporalType);
+
+ /**
+ * Bind an instance of java.util.Date
to a named parameter.
+ * @param name parameter name
+ * @param value parameter value
+ * @param temporalType temporal type
+ * @return the same query instance
+ * @throws IllegalArgumentException if the parameter name does
+ * not correspond to a parameter of the query or if
+ * the value argument is of incorrect type
+ */
+ Query setParameter(String name, Date value,
+ TemporalType temporalType);
+
+ /**
+ * Bind an argument value to a positional parameter.
+ * @param position position
+ * @param value parameter value
+ * @return the same query instance
+ * @throws IllegalArgumentException if position does not
+ * correspond to a positional parameter of the
+ * query or if the argument is of incorrect type
+ */
+ Query setParameter(int position, Object value);
+
+ /**
+ * Bind an instance of java.util.Calendar
to a positional
+ * parameter.
+ * @param position position
+ * @param value parameter value
+ * @param temporalType temporal type
+ * @return the same query instance
+ * @throws IllegalArgumentException if position does not
+ * correspond to a positional parameter of the query or
+ * if the value argument is of incorrect type
+ */
+ Query setParameter(int position, Calendar value,
+ TemporalType temporalType);
+
+ /**
+ * Bind an instance of java.util.Date
to a positional parameter.
+ * @param position position
+ * @param value parameter value
+ * @param temporalType temporal type
+ * @return the same query instance
+ * @throws IllegalArgumentException if position does not
+ * correspond to a positional parameter of the query or
+ * if the value argument is of incorrect type
+ */
+ Query setParameter(int position, Date value,
+ TemporalType temporalType);
+
+ /**
+ * Get the parameter objects corresponding to the declared
+ * parameters of the query.
+ * Returns empty set if the query has no parameters.
+ * This method is not required to be supported for native
+ * queries.
+ * @return set of the parameter objects
+ * @throws IllegalStateException if invoked on a native
+ * query when the implementation does not support
+ * this use
+ * @since Java Persistence 2.0
+ */
+ SetPersistenceException
is thrown.
+ * @param cls the class of the object to be returned. This is
+ * normally either the underlying query
+ * implementation class or an interface that it
+ * implements.
+ * @return an instance of the specified class
+ * @throws PersistenceException if the provider does not support
+ * the call
+ * @since Java Persistence 2.0
+ */
+ QueryTimeoutException
exception
+ * with null
as its detail message.
+ */
+ public QueryTimeoutException() {
+ super();
+ }
+
+ /**
+ * Constructs a new QueryTimeoutException
exception
+ * with the specified detail message.
+ * @param message the detail message.
+ */
+ public QueryTimeoutException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructs a new QueryTimeoutException
exception
+ * with the specified detail message and cause.
+ * @param message the detail message.
+ * @param cause the cause.
+ */
+ public QueryTimeoutException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Constructs a new QueryTimeoutException
exception
+ * with the specified cause.
+ * @param cause the cause.
+ */
+ public QueryTimeoutException(Throwable cause) {
+ super(cause);
+ }
+
+
+ /**
+ * Constructs a new QueryTimeoutException
exception
+ * with the specified query.
+ * @param query the query.
+ */
+ public QueryTimeoutException(Query query) {
+ this.query = query;
+ }
+
+ /**
+ * Constructs a new QueryTimeoutException
exception
+ * with the specified detail message, cause, and query.
+ * @param message the detail message.
+ * @param cause the cause.
+ * @param query the query.
+ */
+ public QueryTimeoutException(String message, Throwable cause, Query query) {
+ super(message, cause);
+ this.query = query;
+ }
+
+ /**
+ * Returns the query that caused this exception.
+ * @return the query.
+ */
+ public Query getQuery() {
+ return this.query;
+ }
+}
+
+
Index: 3rdParty_sources/persistence-api/javax/persistence/RollbackException.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/RollbackException.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/RollbackException.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+/**
+ * Thrown by the persistence provider when
+ * {@link EntityTransaction#commit() EntityTransaction.commit()} fails.
+ *
+ * @see javax.persistence.EntityTransaction#commit()
+ *
+ * @since Java Persistence 1.0
+ */
+public class RollbackException extends PersistenceException {
+
+ /**
+ * Constructs a new RollbackException
exception
+ * with null
as its detail message.
+ */
+ public RollbackException() {
+ super();
+ }
+
+ /**
+ * Constructs a new RollbackException
exception
+ * with the specified detail message.
+ * @param message the detail message.
+ */
+ public RollbackException(String message) {
+ super(message);
+ }
+
+ /**
+ * Constructs a new RollbackException
exception
+ * with the specified detail message and cause.
+ * @param message the detail message.
+ * @param cause the cause.
+ */
+ public RollbackException(String message, Throwable cause) {
+ super(message, cause);
+ }
+
+ /**
+ * Constructs a new RollbackException
exception
+ * with the specified cause.
+ * @param cause the cause.
+ */
+ public RollbackException(Throwable cause) {
+ super(cause);
+ }
+}
+
+
Index: 3rdParty_sources/persistence-api/javax/persistence/SecondaryTable.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/SecondaryTable.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/SecondaryTable.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,121 @@
+/*******************************************************************************
+ * 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * 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;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+import static javax.persistence.ConstraintMode.PROVIDER_DEFAULT;
+
+/**
+ * Specifies a secondary table for the annotated entity
+ * class. Specifying one or more secondary tables indicates that the
+ * data for the entity class is stored across multiple tables.
+ *
+ * SecondaryTable
annotation is specified,
+ * it is assumed that all persistent fields or properties of the
+ * entity are mapped to the primary table. If no primary key join
+ * columns are specified, the join columns are assumed to reference
+ * the primary key columns of the primary table, and have the same
+ * names and types as the referenced primary key columns of the
+ * primary table.
+ *
+ *
+ * Example 1: Single secondary table with a single primary key column.
+ *
+ * @Entity
+ * @Table(name="CUSTOMER")
+ * @SecondaryTable(name="CUST_DETAIL",
+ * pkJoinColumns=@PrimaryKeyJoinColumn(name="CUST_ID"))
+ * public class Customer { ... }
+ *
+ *
+ * Example 2: Single secondary table with multiple primary key columns.
+ *
+ * @Entity
+ * @Table(name="CUSTOMER")
+ * @SecondaryTable(name="CUST_DETAIL",
+ * pkJoinColumns={
+ * @PrimaryKeyJoinColumn(name="CUST_ID"),
+ * @PrimaryKeyJoinColumn(name="CUST_TYPE")})
+ * public class Customer { ... }
+ *
+ *
+ * @since Java Persistence 1.0
+ */
+@Repeatable(SecondaryTables.class)
+@Target(TYPE)
+@Retention(RUNTIME)
+
+public @interface SecondaryTable {
+
+ /** (Required) The name of the table. */
+ String name();
+
+ /** (Optional) The catalog of the table.
+ * pkJoinColumns
element when table generation is
+ * in effect. If both this element and the
+ * foreignKey
element of any of the
+ * pkJoinColumns
elements are specified, the
+ * behavior is undefined. If no foreign key annotation element
+ * is specified in either location, the persistence provider's
+ * default foreign key strategy will apply.
+ *
+ * @since Java Persistence 2.1
+ */
+ ForeignKey foreignKey() default @ForeignKey(PROVIDER_DEFAULT);
+
+ /**
+ * (Optional) Unique constraints that are to be placed on the
+ * table. These are typically only used if table generation
+ * is in effect. These constraints apply in addition to any
+ * constraints specified by the Column
and JoinColumn
+ * annotations and constraints entailed by primary key mappings.
+ *
+ * Example 1: Multiple secondary tables assuming primary key columns are named the same in all tables.
+ *
+ * @Entity
+ * @Table(name="EMPLOYEE")
+ * @SecondaryTables({
+ * @SecondaryTable(name="EMP_DETAIL"),
+ * @SecondaryTable(name="EMP_HIST")
+ * })
+ * public class Employee { ... }
+ *
+ *
+ * Example 2: Multiple secondary tables with differently named primary key columns.
+ *
+ * @Entity
+ * @Table(name="EMPLOYEE")
+ * @SecondaryTables({
+ * @SecondaryTable(name="EMP_DETAIL",
+ * pkJoinColumns=@PrimaryKeyJoinColumn(name="EMPL_ID")),
+ * @SecondaryTable(name="EMP_HIST",
+ * pkJoinColumns=@PrimaryKeyJoinColumn(name="EMPLOYEE_ID"))
+ * })
+ * public class Employee { ... }
+ *
+ *
+ * @since Java Persistence 1.0
+ */
+@Target(TYPE)
+@Retention(RUNTIME)
+
+public @interface SecondaryTables {
+
+ /** (Required) The secondary tables for an entity. */
+ SecondaryTable[] value();
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/SequenceGenerator.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/SequenceGenerator.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/SequenceGenerator.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,86 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2017 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Lukas Jungmann - Java Persistence 2.2
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+import java.lang.annotation.Repeatable;
+
+/**
+ * Defines a primary key generator that may be referenced by name when
+ * a generator element is specified for the {@link GeneratedValue}
+ * annotation. A sequence generator may be specified on the entity
+ * class or on the primary key field or property. The scope of the
+ * generator name is global to the persistence unit (across all
+ * generator types).
+ *
+ *
+ * Example:
+ *
+ * @SequenceGenerator(name="EMP_SEQ", allocationSize=25)
+ *
+ *
+ * @since Java Persistence 1.0
+ */
+@Repeatable(SequenceGenerators.class)
+@Target({TYPE, METHOD, FIELD})
+@Retention(RUNTIME)
+public @interface SequenceGenerator {
+
+ /**
+ * (Required) A unique generator name that can be referenced
+ * by one or more classes to be the generator for primary key
+ * values.
+ */
+ String name();
+
+ /**
+ * (Optional) The name of the database sequence object from
+ * which to obtain primary key values.
+ * SequenceGenerator
annotations.
+ *
+ * @see SequenceGenerator
+ * @since Java Persistence 2.2
+ */
+@Target({TYPE, METHOD, FIELD})
+@Retention(RUNTIME)
+public @interface SequenceGenerators {
+
+ SequenceGenerator[] value();
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/SharedCacheMode.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/SharedCacheMode.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/SharedCacheMode.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2014 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * Specifies how the provider must use a second-level cache for the
+ * persistence unit. Corresponds to the value of the persistence.xml
+ * shared-cache-mode
element, and returned as the result of
+ * {@link javax.persistence.spi.PersistenceUnitInfo#getSharedCacheMode()}.
+ *
+ * @since Java Persistence 2.0
+ */
+public enum SharedCacheMode {
+
+ /**
+ * All entities and entity-related state and data are cached.
+ */
+ ALL,
+
+ /**
+ * Caching is disabled for the persistence unit.
+ */
+ NONE,
+
+ /**
+ * Caching is enabled for all entities for Cacheable(true)
+ * is specified. All other entities are not cached.
+ */
+ ENABLE_SELECTIVE,
+
+ /**
+ * Caching is enabled for all entities except those for which
+ * Cacheable(false)
is specified. Entities for which
+ * Cacheable(false)
is specified are not cached.
+ */
+ DISABLE_SELECTIVE,
+
+ /**
+ *
+ * Caching behavior is undefined: provider-specific defaults may apply.
+ */
+ UNSPECIFIED
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/SqlResultSetMapping.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/SqlResultSetMapping.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/SqlResultSetMapping.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,82 @@
+/*******************************************************************************
+ * 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * 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;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies the mapping of the result of a native SQL query or stored
+ * procedure.
+ *
+ *
+ * Example:
+ *
+ * Query q = em.createNativeQuery(
+ * "SELECT o.id AS order_id, " +
+ * "o.quantity AS order_quantity, " +
+ * "o.item AS order_item, " +
+ * "i.name AS item_name, " +
+ * "FROM Order o, Item i " +
+ * "WHERE (order_quantity > 25) AND (order_item = i.id)",
+ * "OrderResults");
+ *
+ * @SqlResultSetMapping(name="OrderResults",
+ * entities={
+ * @EntityResult(entityClass=com.acme.Order.class, fields={
+ * @FieldResult(name="id", column="order_id"),
+ * @FieldResult(name="quantity", column="order_quantity"),
+ * @FieldResult(name="item", column="order_item")})},
+ * columns={
+ * @ColumnResult(name="item_name")}
+ * )
+ *
+ *
+ * @see Query
+ * @see StoredProcedureQuery
+ * @see NamedNativeQuery
+ * @see NamedStoredProcedureQuery
+ *
+ * @since Java Persistence 1.0
+ */
+@Repeatable(SqlResultSetMappings.class)
+@Target({TYPE})
+@Retention(RUNTIME)
+public @interface SqlResultSetMapping {
+
+ /**
+ * The name given to the result set mapping, and used to refer
+ * to it in the methods of the {@link Query} and
+ * {@link StoredProcedureQuery} APIs.
+ */
+ String name();
+
+ /** Specifies the result set mapping to entities. */
+ EntityResult[] entities() default {};
+
+ /**
+ * Specifies the result set mapping to constructors.
+ * @since Java Persistence 2.1
+ */
+ ConstructorResult[] classes() default {};
+
+ /** Specifies the result set mapping to scalar values. */
+ ColumnResult[] columns() default {};
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/SqlResultSetMappings.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/SqlResultSetMappings.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/SqlResultSetMappings.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.TYPE;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Is used to define one or more {@link SqlResultSetMapping} annotations.
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({TYPE})
+@Retention(RUNTIME)
+public @interface SqlResultSetMappings {
+
+ /** One or more SqlResultSetMapping
annotations. */
+ SqlResultSetMapping[] value();
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/StoredProcedureParameter.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/StoredProcedureParameter.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/StoredProcedureParameter.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,51 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies a parameter of a named stored procedure query. All
+ * parameters of a named stored procedure query must be specified.
+ *
+ * @see NamedStoredProcedureQuery
+ * @see ParameterMode
+ *
+ * @since Java Persistence 2.1
+ */
+@Target({})
+@Retention(RUNTIME)
+public @interface StoredProcedureParameter {
+
+ /**
+ * The name of the parameter as defined by the stored procedure in the database.
+ * If a name is not specified, it is assumed that the stored procedure uses
+ * positional parameters.
+ */
+ String name() default "";
+
+ /**
+ * Specifies whether the parameter is an IN, INOUT, OUT, or REF_CURSOR parameter.
+ * REF_CURSOR parameters are used by some databases to return result sets from
+ * a stored procedure.
+ */
+ ParameterMode mode() default ParameterMode.IN;
+
+ /** JDBC type of the paramter. */
+ Class type();
+
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/StoredProcedureQuery.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/StoredProcedureQuery.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/StoredProcedureQuery.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,397 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2017 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.util.Calendar;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Interface used to control stored procedure query execution.
+ *
+ *
+ *
+ *
+ * @see Query
+ * @see Parameter
+ *
+ * @since Java Persistence 2.1
+ */
+public interface StoredProcedureQuery extends Query {
+
+ /**
+ * Set a query property or hint. The hints elements may be used
+ * to specify query properties and hints. Properties defined by
+ * this specification must be observed by the provider.
+ * Vendor-specific hints that are not recognized by a provider
+ * must be silently ignored. Portable applications should not
+ * rely on the standard timeout hint. Depending on the database
+ * in use, this hint may or may not be observed.
+ * @param hintName name of the property or hint
+ * @param value value for the property or hint
+ * @return the same query instance
+ * @throws IllegalArgumentException if the second argument is not
+ * valid for the implementation
+ */
+ StoredProcedureQuery setHint(String hintName, Object value);
+
+ /**
+ * Bind the value of a setParameter
methods are used to set the values of
+ * all required IN
and INOUT
parameters.
+ * It is not required to set the values of stored procedure parameters
+ * for which default values have been defined by the stored procedure.getResultList
and getSingleResult
are
+ * called on a StoredProcedureQuery
object, the provider
+ * will call execute
on an unexecuted stored procedure
+ * query before processing getResultList
or
+ * getSingleResult
.executeUpdate
is called on a
+ * StoredProcedureQuery
object, the provider will call
+ * execute
on an unexecuted stored procedure query
+ * followed by getUpdateCount
. The results of
+ * executeUpdate
will be those of getUpdateCount
.execute
method supports both the simple case where
+ * scalar results are passed back only via INOUT
and
+ * OUT
parameters as well as the most general case
+ * (multiple result sets and/or update counts, possibly also in
+ * combination with output parameter values).execute
method returns true if the first result is a
+ * result set, and false if it is an update count or there are no results
+ * other than through INOUT
and OUT
parameters,
+ * if any.execute
method returns true, the pending result set
+ * can be obtained by calling getResultList
or
+ * getSingleResult
.hasMoreResults
method can then be used to test
+ * for further results.execute
or hasMoreResults
returns false,
+ * the getUpdateCount
method can be called to obtain the
+ * pending result if it is an update count. The getUpdateCount
+ * method will return either the update count (zero or greater) or -1
+ * if there is no update count (i.e., either the next result is a result set
+ * or there is no next update count).INOUT
or OUT
parameters are extracted.getResultList
and
+ * getUpdateCount
have been exhausted, results returned through
+ * INOUT
and OUT
parameters can be retrieved.getOutputParameterValue
methods are used to retrieve
+ * the values passed back from the procedure through INOUT
+ * and OUT
parameters.REF_CURSOR
parameters for result sets the
+ * update counts should be exhausted before calling getResultList
+ * to retrieve the result set. Alternatively, the REF_CURSOR
+ * result set can be retrieved through getOutputParameterValue
.
+ * Result set mappings will be applied to results corresponding to
+ * REF_CURSOR
parameters in the order the REF_CURSOR
+ * parameters were registered with the query.INOUT
and OUT
parameters, execute
+ * can be followed immediately by calls to
+ * getOutputParameterValue
.Parameter
object.
+ * @param param parameter object
+ * @param value parameter value
+ * @return the same query instance
+ * @throws IllegalArgumentException if the parameter does not
+ * correspond to a parameter of the query
+ */
+ java.util.Calendar
to a Parameter
object.
+ * @param param parameter object
+ * @param value parameter value
+ * @param temporalType temporal type
+ * @return the same query instance
+ * @throws IllegalArgumentException if the parameter does not
+ * correspond to a parameter of the query
+ */
+ StoredProcedureQuery setParameter(Parameterjava.util.Date
to a Parameter
object.
+ * @param param parameter object
+ * @param value parameter value
+ * @param temporalType temporal type
+ * @return the same query instance
+ * @throws IllegalArgumentException if the parameter does not
+ * correspond to a parameter of the query
+ */
+ StoredProcedureQuery setParameter(Parameterjava.util.Calendar
to a named parameter.
+ * @param name parameter name
+ * @param value parameter value
+ * @param temporalType temporal type
+ * @return the same query instance
+ * @throws IllegalArgumentException if the parameter name does
+ * not correspond to a parameter of the query or if the
+ * value argument is of incorrect type
+ */
+ StoredProcedureQuery setParameter(String name,
+ Calendar value,
+ TemporalType temporalType);
+
+ /**
+ * Bind an instance of java.util.Date
to a named parameter.
+ * @param name parameter name
+ * @param value parameter value
+ * @param temporalType temporal type
+ * @return the same query instance
+ * @throws IllegalArgumentException if the parameter name does
+ * not correspond to a parameter of the query or if the
+ * value argument is of incorrect type
+ */
+ StoredProcedureQuery setParameter(String name,
+ Date value,
+ TemporalType temporalType);
+
+ /**
+ * Bind an argument value to a positional parameter.
+ * @param position position
+ * @param value parameter value
+ * @return the same query instance
+ * @throws IllegalArgumentException if position does not
+ * correspond to a positional parameter of the query
+ * or if the argument is of incorrect type
+ */
+ StoredProcedureQuery setParameter(int position, Object value);
+
+ /**
+ * Bind an instance of java.util.Calendar
to a positional
+ * parameter.
+ * @param position position
+ * @param value parameter value
+ * @param temporalType temporal type
+ * @return the same query instance
+ * @throws IllegalArgumentException if position does not
+ * correspond to a positional parameter of the query or
+ * if the value argument is of incorrect type
+ */
+ StoredProcedureQuery setParameter(int position,
+ Calendar value,
+ TemporalType temporalType);
+
+ /**
+ * Bind an instance of java.util.Date
to a positional parameter.
+ * @param position position
+ * @param value parameter value
+ * @param temporalType temporal type
+ * @return the same query instance
+ * @throws IllegalArgumentException if position does not
+ * correspond to a positional parameter of the query or
+ * if the value argument is of incorrect type
+ */
+ StoredProcedureQuery setParameter(int position,
+ Date value,
+ TemporalType temporalType);
+
+ /**
+ * Set the flush mode type to be used for the query execution.
+ * The flush mode type applies to the query regardless of the
+ * flush mode type in use for the entity manager.
+ * @param flushMode flush mode
+ * @return the same query instance
+ */
+ StoredProcedureQuery setFlushMode(FlushModeType flushMode);
+
+ /**
+ * Register a positional parameter.
+ * All parameters must be registered.
+ * @param position parameter position
+ * @param type type of the parameter
+ * @param mode parameter mode
+ * @return the same query instance
+ */
+ StoredProcedureQuery registerStoredProcedureParameter(
+ int position,
+ Class type,
+ ParameterMode mode);
+
+ /**
+ * Register a named parameter.
+ * @param parameterName name of the parameter as registered or
+ * specified in metadata
+ * @param type type of the parameter
+ * @param mode parameter mode
+ * @return the same query instance
+ */
+ StoredProcedureQuery registerStoredProcedureParameter(
+ String parameterName,
+ Class type,
+ ParameterMode mode);
+
+ /**
+ * Retrieve a value passed back from the procedure
+ * through an INOUT or OUT parameter.
+ * For portability, all results corresponding to result sets
+ * and update counts must be retrieved before the values of
+ * output parameters.
+ * @param position parameter position
+ * @return the result that is passed back through the parameter
+ * @throws IllegalArgumentException if the position does
+ * not correspond to a parameter of the query or is
+ * not an INOUT or OUT parameter
+ */
+ Object getOutputParameterValue(int position);
+
+ /**
+ * Retrieve a value passed back from the procedure
+ * through an INOUT or OUT parameter.
+ * For portability, all results corresponding to result sets
+ * and update counts must be retrieved before the values of
+ * output parameters.
+ * @param parameterName name of the parameter as registered or
+ * specified in metadata
+ * @return the result that is passed back through the parameter
+ * @throws IllegalArgumentException if the parameter name does
+ * not correspond to a parameter of the query or is
+ * not an INOUT or OUT parameter
+ */
+ Object getOutputParameterValue(String parameterName);
+
+ /**
+ * Return true if the first result corresponds to a result set,
+ * and false if it is an update count or if there are no results
+ * other than through INOUT and OUT parameters, if any.
+ * @return true if first result corresponds to result set
+ * @throws QueryTimeoutException if the query execution exceeds
+ * the query timeout value set and only the statement is
+ * rolled back
+ * @throws PersistenceException if the query execution exceeds
+ * the query timeout value set and the transaction
+ * is rolled back
+ */
+ boolean execute();
+
+ /**
+ * Return the update count of -1 if there is no pending result or
+ * if the first result is not an update count. The provider will
+ * call execute
on the query if needed.
+ * @return the update count or -1 if there is no pending result
+ * or if the next result is not an update count.
+ * @throws TransactionRequiredException if there is
+ * no transaction or the persistence context has not
+ * been joined to the transaction
+ * @throws QueryTimeoutException if the statement execution
+ * exceeds the query timeout value set and only
+ * the statement is rolled back
+ * @throws PersistenceException if the query execution exceeds
+ * the query timeout value set and the transaction
+ * is rolled back
+ */
+ int executeUpdate();
+
+ /**
+ * Retrieve the list of results from the next result set.
+ * The provider will call execute
on the query
+ * if needed.
+ * A REF_CURSOR
result set, if any, will be retrieved
+ * in the order the REF_CURSOR
parameter was
+ * registered with the query.
+ * @return a list of the results or null is the next item is not
+ * a result set
+ * @throws QueryTimeoutException if the query execution exceeds
+ * the query timeout value set and only the statement is
+ * rolled back
+ * @throws PersistenceException if the query execution exceeds
+ * the query timeout value set and the transaction
+ * is rolled back
+ */
+ List getResultList();
+
+ /**
+ * Retrieve a single result from the next result set.
+ * The provider will call execute
on the query
+ * if needed.
+ * A REF_CURSOR
result set, if any, will be retrieved
+ * in the order the REF_CURSOR
parameter was
+ * registered with the query.
+ * @return the result or null if the next item is not a result set
+ * @throws NoResultException if there is no result in the next
+ * result set
+ * @throws NonUniqueResultException if more than one result
+ * @throws QueryTimeoutException if the query execution exceeds
+ * the query timeout value set and only the statement is
+ * rolled back
+ * @throws PersistenceException if the query execution exceeds
+ * the query timeout value set and the transaction
+ * is rolled back
+ */
+ Object getSingleResult();
+
+ /**
+ * Return true if the next result corresponds to a result set,
+ * and false if it is an update count or if there are no results
+ * other than through INOUT and OUT parameters, if any.
+ * @return true if next result corresponds to result set
+ * @throws QueryTimeoutException if the query execution exceeds
+ * the query timeout value set and only the statement is
+ * rolled back
+ * @throws PersistenceException if the query execution exceeds
+ * the query timeout value set and the transaction
+ * is rolled back
+ */
+ boolean hasMoreResults();
+
+ /**
+ * Return the update count or -1 if there is no pending result
+ * or if the next result is not an update count.
+ * @return update count or -1 if there is no pending result or if
+ * the next result is not an update count
+ * @throws QueryTimeoutException if the query execution exceeds
+ * the query timeout value set and only the statement is
+ * rolled back
+ * @throws PersistenceException if the query execution exceeds
+ * the query timeout value set and the transaction
+ * is rolled back
+ */
+ int getUpdateCount();
+
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/Subgraph.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/Subgraph.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/Subgraph.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,201 @@
+/*******************************************************************************
+ * Copyright (c) 2011 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ *
+ ******************************************************************************/
+
+package javax.persistence;
+
+import javax.persistence.metamodel.Attribute;
+import java.util.List;
+
+/**
+ * This type represents a subgraph for an attribute node that
+ * corresponds to a Managed Type. Using this class, an entity subgraph
+ * can be embedded within an EntityGraph.
+ *
+ * @param Table
annotation is specified for an entity
+ * class, the default values apply.
+ *
+ *
+ * Example:
+ *
+ * @Entity
+ * @Table(name="CUST", schema="RECORDS")
+ * public class Customer { ... }
+ *
+ *
+ * @since Java Persistence 1.0
+ */
+@Target(TYPE)
+@Retention(RUNTIME)
+public @interface Table {
+
+ /**
+ * (Optional) The name of the table.
+ * Column
and JoinColumn
+ * annotations and constraints entailed by primary key mappings.
+ *
+ * Example 1:
+ *
+ * @Entity public class Employee {
+ * ...
+ * @TableGenerator(
+ * name="empGen",
+ * table="ID_GEN",
+ * pkColumnName="GEN_KEY",
+ * valueColumnName="GEN_VALUE",
+ * pkColumnValue="EMP_ID",
+ * allocationSize=1)
+ * @Id
+ * @GeneratedValue(strategy=TABLE, generator="empGen")
+ * int id;
+ * ...
+ * }
+ *
+ * Example 2:
+ *
+ * @Entity public class Address {
+ * ...
+ * @TableGenerator(
+ * name="addressGen",
+ * table="ID_GEN",
+ * pkColumnName="GEN_KEY",
+ * valueColumnName="GEN_VALUE",
+ * pkColumnValue="ADDR_ID")
+ * @Id
+ * @GeneratedValue(strategy=TABLE, generator="addressGen")
+ * int id;
+ * ...
+ * }
+ *
+ *
+ * @see GeneratedValue
+ *
+ * @since Java Persistence 1.0
+ */
+@Repeatable(TableGenerators.class)
+@Target({TYPE, METHOD, FIELD})
+@Retention(RUNTIME)
+public @interface TableGenerator {
+
+ /**
+ * (Required) A unique generator name that can be referenced
+ * by one or more classes to be the generator for id values.
+ */
+ String name();
+
+ /**
+ * (Optional) Name of table that stores the generated id values.
+ * TableGenerator
annotations.
+ *
+ * @see TableGenerator
+ * @since Java Persistence 2.2
+ */
+@Target({TYPE, METHOD, FIELD})
+@Retention(RUNTIME)
+public @interface TableGenerators {
+
+ TableGenerator[] value();
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/Temporal.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/Temporal.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/Temporal.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,50 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * This annotation must be specified for persistent fields
+ * or properties of type java.util.Date
and
+ * java.util.Calendar
. It may only be specified for fields
+ * or properties of these types.
+ *
+ * Temporal
annotation may be used in
+ * conjunction with the {@link Basic} annotation, the {@link Id}
+ * annotation, or the {@link ElementCollection} annotation (when
+ * the element collection value is of such a temporal type.
+ *
+ *
+ * Example:
+ *
+ * @Temporal(DATE)
+ * protected java.util.Date endDate;
+ *
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({METHOD, FIELD})
+@Retention(RUNTIME)
+public @interface Temporal {
+
+ /** The type used in mapping java.util.Date
or java.util.Calendar
. */
+ TemporalType value();
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/TemporalType.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/TemporalType.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/TemporalType.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,34 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * Type used to indicate a specific mapping of java.util.Date
+ * or java.util.Calendar
.
+ *
+ * @since Java Persistence 1.0
+ */
+public enum TemporalType {
+
+ /** Map as java.sql.Date
*/
+ DATE,
+
+ /** Map as java.sql.Time
*/
+ TIME,
+
+ /** Map as java.sql.Timestamp
*/
+ TIMESTAMP
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/TransactionRequiredException.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/TransactionRequiredException.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/TransactionRequiredException.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,44 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * Thrown by the persistence provider when a transaction is required but is not
+ * active.
+ *
+ * @since Java Persistence 1.0
+ */
+public class TransactionRequiredException extends PersistenceException {
+
+ /**
+ * Constructs a new TransactionRequiredException
exception with
+ * null
as its detail message.
+ */
+ public TransactionRequiredException() {
+ super();
+ }
+
+ /**
+ * Constructs a new TransactionRequiredException
exception with
+ * the specified detail message.
+ *
+ * @param message
+ * the detail message.
+ */
+ public TransactionRequiredException(String message) {
+ super(message);
+ }
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/Transient.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/Transient.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/Transient.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,45 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies that the property or field is not persistent. It is used
+ * to annotate a property or field of an entity class, mapped
+ * superclass, or embeddable class.
+ *
+ *
+ * Example:
+ *
+ * @Entity
+ * public class Employee {
+ * @Id int id;
+ * @Transient User currentUser;
+ * ...
+ * }
+ *
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({METHOD, FIELD})
+@Retention(RUNTIME)
+
+public @interface Transient {}
Index: 3rdParty_sources/persistence-api/javax/persistence/Tuple.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/Tuple.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/Tuple.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,96 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.util.List;
+
+/**
+ * Interface for extracting the elements of a query result tuple.
+ *
+ * @see TupleElement
+ *
+ * @since Java Persistence 2.0
+ */
+public interface Tuple {
+
+ /**
+ * Get the value of the specified tuple element.
+ * @param tupleElement tuple element
+ * @return value of tuple element
+ * @throws IllegalArgumentException if tuple element
+ * does not correspond to an element in the
+ * query result tuple
+ */
+ TupleElement
interface defines an element that is returned in
+ * a query result tuple.
+ * @param NONE
has been set and there is no transaction
+ * or the persistence context has not been joined to the
+ * transaction
+ * @throws PessimisticLockException if pessimistic locking
+ * fails and the transaction is rolled back
+ * @throws LockTimeoutException if pessimistic locking
+ * fails and only the statement is rolled back
+ * @throws PersistenceException if the query execution exceeds
+ * the query timeout value set and the transaction
+ * is rolled back
+ */
+ Listjava.util.stream.Stream
.
+ * By default this method delegates to getResultList().stream()
,
+ * however persistence provider may choose to override this method
+ * to provide additional capabilities.
+ *
+ * @return a stream of the results
+ * @throws IllegalStateException if called for a Java
+ * Persistence query language UPDATE or DELETE statement
+ * @throws QueryTimeoutException if the query execution exceeds
+ * the query timeout value set and only the statement is
+ * rolled back
+ * @throws TransactionRequiredException if a lock mode other than
+ * NONE
has been set and there is no transaction
+ * or the persistence context has not been joined to the transaction
+ * @throws PessimisticLockException if pessimistic locking
+ * fails and the transaction is rolled back
+ * @throws LockTimeoutException if pessimistic locking
+ * fails and only the statement is rolled back
+ * @throws PersistenceException if the query execution exceeds
+ * the query timeout value set and the transaction
+ * is rolled back
+ * @see Stream
+ * @see #getResultList()
+ * @since 2.2
+ */
+ default StreamNONE
has been set and there is no transaction
+ * or the persistence context has not been joined to the
+ * transaction
+ * @throws PessimisticLockException if pessimistic locking
+ * fails and the transaction is rolled back
+ * @throws LockTimeoutException if pessimistic locking
+ * fails and only the statement is rolled back
+ * @throws PersistenceException if the query execution exceeds
+ * the query timeout value set and the transaction
+ * is rolled back
+ */
+ X getSingleResult();
+
+ /**
+ * Set the maximum number of results to retrieve.
+ * @param maxResult maximum number of results to retrieve
+ * @return the same query instance
+ * @throws IllegalArgumentException if the argument is negative
+ */
+ TypedQueryParameter
object.
+ * @param param parameter object
+ * @param value parameter value
+ * @return the same query instance
+ * @throws IllegalArgumentException if the parameter
+ * does not correspond to a parameter of the
+ * query
+ */
+ java.util.Calendar
to a Parameter
object.
+ * @param param parameter object
+ * @param value parameter value
+ * @param temporalType temporal type
+ * @return the same query instance
+ * @throws IllegalArgumentException if the parameter does not
+ * correspond to a parameter of the query
+ */
+ TypedQueryjava.util.Date
to a Parameter
object.
+ * @param param parameter object
+ * @param value parameter value
+ * @param temporalType temporal type
+ * @return the same query instance
+ * @throws IllegalArgumentException if the parameter does not
+ * correspond to a parameter of the query
+ */
+ TypedQueryjava.util.Calendar
to a named parameter.
+ * @param name parameter name
+ * @param value parameter value
+ * @param temporalType temporal type
+ * @return the same query instance
+ * @throws IllegalArgumentException if the parameter name does
+ * not correspond to a parameter of the query or if
+ * the value argument is of incorrect type
+ */
+ TypedQueryjava.util.Date
to a named parameter.
+ * @param name parameter name
+ * @param value parameter value
+ * @param temporalType temporal type
+ * @return the same query instance
+ * @throws IllegalArgumentException if the parameter name does
+ * not correspond to a parameter of the query or if
+ * the value argument is of incorrect type
+ */
+ TypedQueryjava.util.Calendar
to a positional
+ * parameter.
+ * @param position position
+ * @param value parameter value
+ * @param temporalType temporal type
+ * @return the same query instance
+ * @throws IllegalArgumentException if position does not
+ * correspond to a positional parameter of the query
+ * or if the value argument is of incorrect type
+ */
+ TypedQueryjava.util.Date
to a positional parameter.
+ * @param position position
+ * @param value parameter value
+ * @param temporalType temporal type
+ * @return the same query instance
+ * @throws IllegalArgumentException if position does not
+ * correspond to a positional parameter of the query
+ * or if the value argument is of incorrect type
+ */
+ TypedQuery
+ * Example:
+ * @Entity
+ * @Table(
+ * name="EMPLOYEE",
+ * uniqueConstraints=
+ * @UniqueConstraint(columnNames={"EMP_ID", "EMP_NAME"})
+ * )
+ * public class Employee { ... }
+ *
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({})
+@Retention(RUNTIME)
+public @interface UniqueConstraint {
+
+ /** (Optional) Constraint name. A provider-chosen name will be chosen
+ * if a name is not specified.
+ *
+ * @since Java Persistence 2.0
+ */
+ String name() default "";
+
+ /** (Required) An array of the column names that make up the constraint. */
+ String[] columnNames();
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/ValidationMode.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/ValidationMode.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/ValidationMode.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,46 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+/**
+ * The validation mode to be used by the provider for the persistence
+ * unit.
+ *
+ * @since Java Persistence 2.0
+ */
+public enum ValidationMode {
+
+ /**
+ * If a Bean Validation provider is present in the environment,
+ * the persistence provider must perform the automatic validation
+ * of entities. If no Bean Validation provider is present in the
+ * environment, no lifecycle event validation takes place.
+ * This is the default behavior.
+ */
+ AUTO,
+
+ /**
+ * The persistence provider must perform the lifecycle event
+ * validation. It is an error if there is no Bean Validation
+ * provider present in the environment.
+ */
+ CALLBACK,
+
+ /**
+ * The persistence provider must not perform lifecycle event validation.
+ */
+ NONE
+ }
Index: 3rdParty_sources/persistence-api/javax/persistence/Version.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/Version.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/Version.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence;
+
+import java.lang.annotation.Target;
+import java.lang.annotation.Retention;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.RetentionPolicy.RUNTIME;
+
+/**
+ * Specifies the version field or property of an entity class that
+ * serves as its optimistic lock value. The version is used to ensure
+ * integrity when performing the merge operation and for optimistic
+ * concurrency control.
+ *
+ * Version
property or field
+ * should be used per class; applications that use more than one
+ * Version
property or field will not be portable.
+ *
+ * Version
property should be mapped to
+ * the primary table for the entity class; applications that
+ * map the Version
property to a table other than
+ * the primary table will not be portable.
+ *
+ * int
, Integer
, short
,
+ * Short
, long
, Long
,
+ * java.sql.Timestamp
.
+ *
+ *
+ * Example:
+ *
+ * @Version
+ * @Column(name="OPTLOCK")
+ * protected int getVersionNum() { return versionNum; }
+ *
+ *
+ * @since Java Persistence 1.0
+ */
+@Target({METHOD, FIELD})
+@Retention(RUNTIME)
+public @interface Version {}
Index: 3rdParty_sources/persistence-api/javax/persistence/criteria/AbstractQuery.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/criteria/AbstractQuery.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/criteria/AbstractQuery.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,182 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence.criteria;
+
+import java.util.List;
+import java.util.Set;
+import javax.persistence.metamodel.EntityType;
+
+/**
+ * The AbstractQuery
interface defines functionality that is common
+ * to both top-level queries and subqueries.
+ * It is not intended to be used directly in query construction.
+ *
+ * CriteriaQuery
or Subquery
itself,
+ * including any subquery roots defined as a result of
+ * correlation. Returns empty set if no roots have been defined.
+ * Modifications to the set do not affect the query.
+ * @return the set of query roots
+ */
+ SetcreateQuery
or subquery
method, that
+ * type will be returned. If the query was created using the
+ * createTupleQuery
method, the result type is
+ * Tuple
. Otherwise, the result type is
+ * Object
.
+ * @return result type
+ */
+ ClassCollectionJoin
interface is the type of the result of
+ * joining to a collection over an association or element
+ * collection that has been specified as a java.util.Collection
.
+ *
+ * @param Collection
+ *
+ * @since Java Persistence 2.0
+ */
+public interface CollectionJoinCollection
that is
+ * the target of the join
+ */
+ CollectionAttribute super Z, E> getModel();
+}
Index: 3rdParty_sources/persistence-api/javax/persistence/criteria/CommonAbstractCriteria.java
===================================================================
diff -u
--- 3rdParty_sources/persistence-api/javax/persistence/criteria/CommonAbstractCriteria.java (revision 0)
+++ 3rdParty_sources/persistence-api/javax/persistence/criteria/CommonAbstractCriteria.java (revision cacda0ef9b2c02f124e1f050882017fbe1be6c7b)
@@ -0,0 +1,49 @@
+/*******************************************************************************
+ * Copyright (c) 2008 - 2013 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
+ * which accompanies this distribution.
+ * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
+ * and the Eclipse Distribution License is available at
+ * http://www.eclipse.org/org/documents/edl-v10.php.
+ *
+ * Contributors:
+ * Linda DeMichiel - Java Persistence 2.1
+ * Linda DeMichiel - Java Persistence 2.0
+ *
+ ******************************************************************************/
+package javax.persistence.criteria;
+
+/**
+ * The CommonAbstractCriteria
interface defines functionality
+ * that is common to both top-level criteria queries and subqueries as
+ * well as to update and delete criteria operations.
+ * It is not intended to be used directly in query construction.
+ *
+ * CompoundSelection
interface defines a compound selection item
+ * (tuple, array, or result of constructor).
+ *
+ * @param Predicate
is used instead of Expression<Boolean>
+ * in this API in order to work around the fact that Java
+ * generics are not compatible with varags.
+ *
+ * @since Java Persistence 2.0
+ */
+public interface CriteriaBuilder {
+
+ /**
+ * Create a CriteriaQuery
object.
+ * @return criteria query object
+ */
+ CriteriaQuery