From 3260b13e0598ba708cea184a851179723d4d9b4a Mon Sep 17 00:00:00 2001 From: Gunnar Morling Date: Wed, 23 Oct 2013 09:29:36 +0200 Subject: [PATCH 1/2] JPA-60 Using correct apostrophe character --- src/main/java/javax/persistence/EntityManager.java | 6 +++--- src/main/java/javax/persistence/MapsId.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/javax/persistence/EntityManager.java b/src/main/java/javax/persistence/EntityManager.java index 8c1f0ce..c2259dd 100644 --- a/src/main/java/javax/persistence/EntityManager.java +++ b/src/main/java/javax/persistence/EntityManager.java @@ -98,7 +98,7 @@ public interface EntityManager { * 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 not a valid type for that entity's primary key or * is null */ public T find(Class entityClass, Object primaryKey); @@ -118,7 +118,7 @@ public interface EntityManager { * 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 not a valid type for that entity's primary key or * is null * @since Java Persistence 2.0 */ @@ -239,7 +239,7 @@ public T find(Class entityClass, Object primaryKey, * @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 + * not a valid type for that entity's primary key or * is null * @throws EntityNotFoundException if the entity state * cannot be accessed diff --git a/src/main/java/javax/persistence/MapsId.java b/src/main/java/javax/persistence/MapsId.java index ee40de2..6de8146 100644 --- a/src/main/java/javax/persistence/MapsId.java +++ b/src/main/java/javax/persistence/MapsId.java @@ -65,7 +65,7 @@ /** * (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 + * supplied, the relationship maps the entity's primary * key. */ String value() default ""; From 23cce60d1a4e6f2c7aacfd584034d1293246e568 Mon Sep 17 00:00:00 2001 From: Gunnar Morling Date: Wed, 23 Oct 2013 09:39:24 +0200 Subject: [PATCH 2/2] JPA-60 Changing indentation to tabs --- src/main/java/javax/persistence/Access.java | 8 +- .../java/javax/persistence/AccessType.java | 8 +- .../persistence/AssociationOverride.java | 52 +- .../persistence/AssociationOverrides.java | 10 +- .../javax/persistence/AttributeOverride.java | 24 +- .../javax/persistence/AttributeOverrides.java | 4 +- src/main/java/javax/persistence/Basic.java | 32 +- src/main/java/javax/persistence/Cache.java | 46 +- .../javax/persistence/CacheRetrieveMode.java | 20 +- .../javax/persistence/CacheStoreMode.java | 34 +- .../java/javax/persistence/Cacheable.java | 8 +- .../java/javax/persistence/CascadeType.java | 34 +- .../javax/persistence/CollectionTable.java | 74 +- src/main/java/javax/persistence/Column.java | 114 +- .../java/javax/persistence/ColumnResult.java | 4 +- .../persistence/DiscriminatorColumn.java | 42 +- .../javax/persistence/DiscriminatorType.java | 24 +- .../javax/persistence/DiscriminatorValue.java | 24 +- .../javax/persistence/ElementCollection.java | 34 +- .../persistence/EntityExistsException.java | 78 +- .../javax/persistence/EntityListeners.java | 4 +- .../java/javax/persistence/EntityManager.java | 1334 ++++++++--------- .../persistence/EntityManagerFactory.java | 178 +-- .../java/javax/persistence/EntityResult.java | 26 +- .../javax/persistence/EntityTransaction.java | 84 +- src/main/java/javax/persistence/EnumType.java | 8 +- .../java/javax/persistence/Enumerated.java | 4 +- .../java/javax/persistence/FetchType.java | 8 +- .../java/javax/persistence/FieldResult.java | 14 +- .../java/javax/persistence/FlushModeType.java | 8 +- .../javax/persistence/GeneratedValue.java | 26 +- .../javax/persistence/GenerationType.java | 52 +- src/main/java/javax/persistence/IdClass.java | 4 +- .../java/javax/persistence/Inheritance.java | 4 +- .../javax/persistence/InheritanceType.java | 22 +- .../java/javax/persistence/JoinColumn.java | 210 +-- .../java/javax/persistence/JoinColumns.java | 8 +- .../java/javax/persistence/JoinTable.java | 86 +- .../java/javax/persistence/LockModeType.java | 102 +- .../persistence/LockTimeoutException.java | 120 +- .../java/javax/persistence/ManyToMany.java | 66 +- .../java/javax/persistence/ManyToOne.java | 56 +- src/main/java/javax/persistence/MapKey.java | 22 +- .../java/javax/persistence/MapKeyColumn.java | 30 +- .../javax/persistence/MapKeyEnumerated.java | 4 +- .../javax/persistence/MapKeyJoinColumn.java | 70 +- .../javax/persistence/MapKeyTemporal.java | 10 +- src/main/java/javax/persistence/MapsId.java | 12 +- .../javax/persistence/NamedNativeQueries.java | 4 +- .../javax/persistence/NamedNativeQuery.java | 26 +- .../java/javax/persistence/NamedQueries.java | 4 +- .../java/javax/persistence/NamedQuery.java | 40 +- .../persistence/NonUniqueResultException.java | 18 +- .../java/javax/persistence/OneToMany.java | 78 +- src/main/java/javax/persistence/OneToOne.java | 80 +- src/main/java/javax/persistence/OrderBy.java | 28 +- .../java/javax/persistence/OrderColumn.java | 6 +- .../java/javax/persistence/Parameter.java | 52 +- .../javax/persistence/PersistenceContext.java | 50 +- .../persistence/PersistenceContexts.java | 4 +- .../javax/persistence/SharedCacheMode.java | 48 +- .../javax/persistence/ValidationMode.java | 36 +- 62 files changed, 1860 insertions(+), 1860 deletions(-) diff --git a/src/main/java/javax/persistence/Access.java b/src/main/java/javax/persistence/Access.java index 52adce5..03c55c9 100644 --- a/src/main/java/javax/persistence/Access.java +++ b/src/main/java/javax/persistence/Access.java @@ -28,8 +28,8 @@ @Retention(RUNTIME) public @interface Access { - /** - * (Required) Specification of field- or property-based access. - */ - AccessType value(); + /** + * (Required) Specification of field- or property-based access. + */ + AccessType value(); } diff --git a/src/main/java/javax/persistence/AccessType.java b/src/main/java/javax/persistence/AccessType.java index e85a2f7..07899fb 100644 --- a/src/main/java/javax/persistence/AccessType.java +++ b/src/main/java/javax/persistence/AccessType.java @@ -20,9 +20,9 @@ */ public enum AccessType { - /** Field-based access is used. */ - FIELD, + /** Field-based access is used. */ + FIELD, - /** Property-based access is used. */ - PROPERTY + /** Property-based access is used. */ + PROPERTY } diff --git a/src/main/java/javax/persistence/AssociationOverride.java b/src/main/java/javax/persistence/AssociationOverride.java index 1cfccf0..1e9ccc2 100644 --- a/src/main/java/javax/persistence/AssociationOverride.java +++ b/src/main/java/javax/persistence/AssociationOverride.java @@ -122,34 +122,34 @@ 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(); + /** + * (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 {}; + /** + * 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 {}; - /** - * 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; + /** + * 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; /** * (Optional) Used to specify or control the generation of a foreign key constraint for the columns diff --git a/src/main/java/javax/persistence/AssociationOverrides.java b/src/main/java/javax/persistence/AssociationOverrides.java index e272135..43142b8 100644 --- a/src/main/java/javax/persistence/AssociationOverrides.java +++ b/src/main/java/javax/persistence/AssociationOverrides.java @@ -62,9 +62,9 @@ public @interface AssociationOverrides { - /** - *(Required) The association override mappings that are to be - * applied to the relationship field or property . - */ - AssociationOverride[] value(); + /** + *(Required) The association override mappings that are to be + * applied to the relationship field or property . + */ + AssociationOverride[] value(); } diff --git a/src/main/java/javax/persistence/AttributeOverride.java b/src/main/java/javax/persistence/AttributeOverride.java index df62518..f678989 100644 --- a/src/main/java/javax/persistence/AttributeOverride.java +++ b/src/main/java/javax/persistence/AttributeOverride.java @@ -132,17 +132,17 @@ 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 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(); + /** + * (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(); } diff --git a/src/main/java/javax/persistence/AttributeOverrides.java b/src/main/java/javax/persistence/AttributeOverrides.java index c5222cb..97d131b 100644 --- a/src/main/java/javax/persistence/AttributeOverrides.java +++ b/src/main/java/javax/persistence/AttributeOverrides.java @@ -45,6 +45,6 @@ public @interface AttributeOverrides { - /** (Required) One or more field or property mapping overrides. */ - AttributeOverride[] value(); + /** (Required) One or more field or property mapping overrides. */ + AttributeOverride[] value(); } diff --git a/src/main/java/javax/persistence/Basic.java b/src/main/java/javax/persistence/Basic.java index 6dddc7a..6aa8173 100644 --- a/src/main/java/javax/persistence/Basic.java +++ b/src/main/java/javax/persistence/Basic.java @@ -56,21 +56,21 @@ @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 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; + /** + * (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; } diff --git a/src/main/java/javax/persistence/Cache.java b/src/main/java/javax/persistence/Cache.java index 5d21df3..f27228d 100644 --- a/src/main/java/javax/persistence/Cache.java +++ b/src/main/java/javax/persistence/Cache.java @@ -18,32 +18,32 @@ */ 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); + /** + * 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 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); + /** + * 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(); + /** + * Clear the cache. + */ + public void evictAll(); /** * Return an object of the specified type to allow access to the provider-specific API. diff --git a/src/main/java/javax/persistence/CacheRetrieveMode.java b/src/main/java/javax/persistence/CacheRetrieveMode.java index d156905..35843fb 100644 --- a/src/main/java/javax/persistence/CacheRetrieveMode.java +++ b/src/main/java/javax/persistence/CacheRetrieveMode.java @@ -19,16 +19,16 @@ */ public enum CacheRetrieveMode { - /** - * Read entity data from the cache: this is - * the default behavior. - */ - USE, + /** + * Read entity data from the cache: this is + * the default behavior. + */ + USE, - /** - * Bypass the cache: get data directly from - * the database. - */ - BYPASS + /** + * Bypass the cache: get data directly from + * the database. + */ + BYPASS } diff --git a/src/main/java/javax/persistence/CacheStoreMode.java b/src/main/java/javax/persistence/CacheStoreMode.java index 23b79f0..3cc690b 100644 --- a/src/main/java/javax/persistence/CacheStoreMode.java +++ b/src/main/java/javax/persistence/CacheStoreMode.java @@ -19,23 +19,23 @@ */ public enum CacheStoreMode { - /** - * Insert/update entity data into cache when read - * from database and when committed into database: - * this is the default behavior. Does not force refresh - * of already cached items when reading from database. - */ - USE, + /** + * Insert/update entity data into cache when read + * from database and 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, + /** + * 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 + /** + * 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 } diff --git a/src/main/java/javax/persistence/Cacheable.java b/src/main/java/javax/persistence/Cacheable.java index ffa39cd..0528345 100644 --- a/src/main/java/javax/persistence/Cacheable.java +++ b/src/main/java/javax/persistence/Cacheable.java @@ -32,9 +32,9 @@ @Retention(RUNTIME) public @interface Cacheable { - /** - * (Optional) Whether or not the entity should be cached. - */ - boolean value() default true; + /** + * (Optional) Whether or not the entity should be cached. + */ + boolean value() default true; } diff --git a/src/main/java/javax/persistence/CascadeType.java b/src/main/java/javax/persistence/CascadeType.java index 13d026e..b6d84f2 100644 --- a/src/main/java/javax/persistence/CascadeType.java +++ b/src/main/java/javax/persistence/CascadeType.java @@ -19,26 +19,26 @@ */ public enum CascadeType { - /** Cascade all operations */ - ALL, + /** Cascade all operations */ + ALL, - /** Cascade persist operation */ - PERSIST, + /** Cascade persist operation */ + PERSIST, - /** Cascade merge operation */ - MERGE, + /** Cascade merge operation */ + MERGE, - /** Cascade remove operation */ - REMOVE, + /** Cascade remove operation */ + REMOVE, - /** Cascade refresh operation */ - REFRESH, + /** Cascade refresh operation */ + REFRESH, - /** - * Cascade detach operation - * - * @since Java Persistence 2.0 - * - */ - DETACH + /** + * Cascade detach operation + * + * @since Java Persistence 2.0 + * + */ + DETACH } diff --git a/src/main/java/javax/persistence/CollectionTable.java b/src/main/java/javax/persistence/CollectionTable.java index 7bb50ce..0a0a77b 100644 --- a/src/main/java/javax/persistence/CollectionTable.java +++ b/src/main/java/javax/persistence/CollectionTable.java @@ -97,47 +97,47 @@ @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 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 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 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) 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) Unique constraints that are to be placed on the - * table. These are only used if table generation is in effect. - */ - UniqueConstraint[] uniqueConstraints() 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. diff --git a/src/main/java/javax/persistence/Column.java b/src/main/java/javax/persistence/Column.java index 1df8066..86d9de5 100644 --- a/src/main/java/javax/persistence/Column.java +++ b/src/main/java/javax/persistence/Column.java @@ -48,70 +48,70 @@ @Retention(RUNTIME) public @interface Column { - /** - * (Optional) The name of the column. Defaults to - * the property or field name. - */ - String name() default ""; + /** + * (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 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 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 true; + /** + * (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 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) 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 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 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 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 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; + /** + * (Optional) The scale for a decimal (exact numeric) column. + * (Applies only if a decimal column is used.) + */ + int scale() default 0; } diff --git a/src/main/java/javax/persistence/ColumnResult.java b/src/main/java/javax/persistence/ColumnResult.java index 7148594..38e9471 100644 --- a/src/main/java/javax/persistence/ColumnResult.java +++ b/src/main/java/javax/persistence/ColumnResult.java @@ -51,8 +51,8 @@ @Retention(RUNTIME) public @interface ColumnResult { - /** (Required) The name of a column in the SELECT clause of a SQL query */ - String name(); + /** (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. */ Class type() default void.class; diff --git a/src/main/java/javax/persistence/DiscriminatorColumn.java b/src/main/java/javax/persistence/DiscriminatorColumn.java index 688f652..a8aea64 100644 --- a/src/main/java/javax/persistence/DiscriminatorColumn.java +++ b/src/main/java/javax/persistence/DiscriminatorColumn.java @@ -51,28 +51,28 @@ @Retention(RUNTIME) public @interface DiscriminatorColumn { - /** - * (Optional) The name of column to be used for the discriminator. - */ - String name() default "DTYPE"; + /** + * (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 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 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; + /** + * (Optional) The column length for String-based discriminator types. + * Ignored for other discriminator types. + */ + int length() default 31; } diff --git a/src/main/java/javax/persistence/DiscriminatorType.java b/src/main/java/javax/persistence/DiscriminatorType.java index 184ff5f..aae59a9 100644 --- a/src/main/java/javax/persistence/DiscriminatorType.java +++ b/src/main/java/javax/persistence/DiscriminatorType.java @@ -16,18 +16,18 @@ */ public enum DiscriminatorType { - /** - * String as the discriminator type. - */ - STRING, + /** + * String as the discriminator type. + */ + STRING, - /** - * Single character as the discriminator type. - */ - CHAR, + /** + * Single character as the discriminator type. + */ + CHAR, - /** - * Integer as the discriminator type. - */ - INTEGER + /** + * Integer as the discriminator type. + */ + INTEGER } diff --git a/src/main/java/javax/persistence/DiscriminatorValue.java b/src/main/java/javax/persistence/DiscriminatorValue.java index 43d94d1..ed008b0 100644 --- a/src/main/java/javax/persistence/DiscriminatorValue.java +++ b/src/main/java/javax/persistence/DiscriminatorValue.java @@ -60,16 +60,16 @@ @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(); + /** + * (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(); } diff --git a/src/main/java/javax/persistence/ElementCollection.java b/src/main/java/javax/persistence/ElementCollection.java index 848e849..cc9f758 100644 --- a/src/main/java/javax/persistence/ElementCollection.java +++ b/src/main/java/javax/persistence/ElementCollection.java @@ -42,22 +42,22 @@ @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) 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; + /** + * (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; } diff --git a/src/main/java/javax/persistence/EntityExistsException.java b/src/main/java/javax/persistence/EntityExistsException.java index 7294e53..8e40544 100644 --- a/src/main/java/javax/persistence/EntityExistsException.java +++ b/src/main/java/javax/persistence/EntityExistsException.java @@ -25,46 +25,46 @@ */ 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 + * 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. + * + * @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 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); - } + /** + * Constructs a new EntityExistsException exception with the + * specified cause. + * + * @param cause + * the cause. + */ + public EntityExistsException(Throwable cause) { + super(cause); + } } diff --git a/src/main/java/javax/persistence/EntityListeners.java b/src/main/java/javax/persistence/EntityListeners.java index 3d87e95..d99d0ab 100644 --- a/src/main/java/javax/persistence/EntityListeners.java +++ b/src/main/java/javax/persistence/EntityListeners.java @@ -26,6 +26,6 @@ @Retention(RUNTIME) public @interface EntityListeners { - /** The callback listener classes */ - Class[] value(); + /** The callback listener classes */ + Class[] value(); } diff --git a/src/main/java/javax/persistence/EntityManager.java b/src/main/java/javax/persistence/EntityManager.java index c2259dd..ae5e745 100644 --- a/src/main/java/javax/persistence/EntityManager.java +++ b/src/main/java/javax/persistence/EntityManager.java @@ -44,513 +44,513 @@ */ 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 invoked on a - * container-managed entity manager of type - * PersistenceContextType.TRANSACTION and there is - * no 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 invoked on a - * container-managed entity manager of type - * PersistenceContextType.TRANSACTION and there is - * no transaction - */ - public T merge(T entity); - - /** - * Remove the entity instance. - * @param entity entity instance - * @throws IllegalArgumentException if the instance is not an - * entity or is a detached entity - * @throws TransactionRequiredException if invoked on a - * container-managed entity manager of type - * 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 T find(Class entityClass, Object primaryKey); - - /** - * Find by primary key, using the specified properties. - * 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. - * If a vendor-specific property or hint is not recognized, - * it is silently ignored. - * @param entityClass entity class - * @param primaryKey primary key - * @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 - * is not a valid type for that entity's primary key or - * is null - * @since Java Persistence 2.0 - */ - public T find(Class entityClass, Object primaryKey, - Map properties); - - /** - * Find by primary key and lock. - * Search for an entity of the specified class and primary key - * and lock it with respect to the specified lock type. - * If the entity instance is contained in the persistence context, - * it is returned from there, and the effect of this method is - * the same as if the lock method had been called on the entity. - *

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 OptimisticLockException will be thrown. - *

If the lock mode type is pessimistic and the entity instance - * is found but cannot be locked: - *

    - *
  • the PessimisticLockException will be thrown if the database - * locking failure causes transaction-level rollback - *
  • the LockTimeoutException will be thrown if the database - * locking failure causes only statement-level rollback - *
- * @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 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 T find(Class entityClass, Object primaryKey, - LockModeType lockMode); - - /** - * Find by primary key and lock, using the specified properties. - * Search for an entity of the specified class and primary key - * and lock it with respect to the specified lock type. - * If the entity instance is contained in the persistence context, - * it is returned from there. - *

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 OptimisticLockException will be thrown. - *

If the lock mode type is pessimistic and the entity instance - * is found but cannot be locked: - *

    - *
  • the PessimisticLockException will be thrown if the database - * locking failure causes transaction-level rollback - *
  • the LockTimeoutException will be thrown if the database - * locking failure causes only statement-level rollback - *
- *

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 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 T find(Class entityClass, Object primaryKey, - LockModeType lockMode, - Map properties); - - /** - * Get an instance, whose state may be lazily fetched. - * If the requested instance does not exist in the database, - * the 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 T getReference(Class entityClass, - Object primaryKey); - - /** - * Synchronize the persistence context to the - * underlying database. - * @throws TransactionRequiredException if there is - * no transaction - * @throws PersistenceException if the flush fails - */ - public void flush(); - - /** - * Set the flush mode that applies to all objects contained - * in the persistence context. - * @param flushMode flush mode - */ - public void setFlushMode(FlushModeType flushMode); - - /** - * Get the flush mode that applies to all objects contained - * in the persistence context. - * @return flushMode - */ - public FlushModeType getFlushMode(); - - /** - * Lock an entity instance that is contained in the persistence - * context with the specified lock mode type. - *

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 - * OptimisticLockException will be thrown. - *

If the lock mode type is pessimistic and the entity instance - * is found but cannot be locked: - *

    - *
  • the PessimisticLockException will be thrown if the database - * locking failure causes transaction-level rollback - *
  • the LockTimeoutException will be thrown if the database - * locking failure causes only statement-level rollback - *
- * @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 - * @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. - *

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 - * OptimisticLockException will be thrown. - *

If the lock mode type is pessimistic and the entity instance - * is found but cannot be locked: - *

    - *
  • the PessimisticLockException will be thrown if the database - * locking failure causes transaction-level rollback - *
  • the LockTimeoutException will be thrown if the database - * locking failure causes only statement-level rollback - *
- *

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 - * @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 properties); - - /** - * Refresh the state of the instance from the database, - * overwriting changes made to the entity, if any. - * @param entity entity instance - * @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 - * PersistenceContextType.TRANSACTION and there is - * no 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. - *

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 invoked on a - * container-managed entity manager of type - * PersistenceContextType.TRANSACTION and there is - * no transaction - * @throws EntityNotFoundException if the entity no longer - * exists in the database - * @since Java Persistence 2.0 - */ - public void refresh(Object entity, - Map properties); - - /** - * 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. - *

If the lock mode type is pessimistic and the entity instance - * is found but cannot be locked: - *

    - *
  • the PessimisticLockException will be thrown if the database - * locking failure causes transaction-level rollback - *
  • the LockTimeoutException will be thrown if the - * database locking failure causes only statement-level - * rollback. - *
- * @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 there is no - * transaction and if invoked on a container-managed - * EntityManager instance with - * PersistenceContextType.TRANSACTION or with a lock mode - * other than NONE - * @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. - *

If the lock mode type is pessimistic and the entity instance - * is found but cannot be locked: - *

    - *
  • the PessimisticLockException will be thrown if the database - * locking failure causes transaction-level rollback - *
  • the LockTimeoutException will be thrown if the database - * locking failure causes only statement-level rollback - *
- *

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 there is no - * transaction and if invoked on a container-managed - * EntityManager instance with - * PersistenceContextType.TRANSACTION or with a lock mode - * other than NONE - * @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, - Map properties); - - /** - * Clear the persistence context, causing all managed - * entities to become detached. Changes made to entities that - * have not been flushed to the database will not be - * persisted. - */ - public void clear(); - - /** - * Remove the given entity from the persistence context, causing - * a managed entity to become detached. Unflushed changes made - * to the entity if any (including removal of the entity), - * will not be synchronized to the database. Entities which - * previously referenced the detached entity will continue to - * reference it. - * @param entity entity instance - * @throws IllegalArgumentException if the instance is not an - * entity - * @since Java Persistence 2.0 - */ - public void detach(Object entity); - - /** - * Check if the instance is a managed entity instance belonging - * to the current persistence context. - * @param entity entity instance - * @return boolean indicating if entity is in persistence context - * @throws IllegalArgumentException if not an entity - */ - public boolean contains(Object entity); - - /** - * Get the current lock mode for the entity instance. - * @param entity entity instance - * @return lock mode - * @throws TransactionRequiredException if there is no - * transaction - * @throws IllegalArgumentException if the instance is not a - * managed entity and a transaction is active - * @since Java Persistence 2.0 - */ - public LockModeType getLockMode(Object entity); - - /** - * Set an entity manager property or hint. - * If a vendor-specific property or hint is not recognized, it is - * silently ignored. - * @param propertyName name of property or hint - * @param value value for property or hint - * @throws IllegalArgumentException if the second argument is - * not valid for the implementation - * @since Java Persistence 2.0 - */ - public void setProperty(String propertyName, Object value); - - /** - * Get the properties and hints and associated values that are in effect - * for the entity manager. Changing the contents of the map does - * not change the configuration in effect. - * @return map of properties and hints in effect for entity manager - * @since Java Persistence 2.0 - */ - public Map getProperties(); - - /** - * Create an instance of Query 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 TypedQuery createQuery(CriteriaQuery criteriaQuery); + /** + * 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 invoked on a + * container-managed entity manager of type + * PersistenceContextType.TRANSACTION and there is + * no 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 invoked on a + * container-managed entity manager of type + * PersistenceContextType.TRANSACTION and there is + * no transaction + */ + public T merge(T entity); + + /** + * Remove the entity instance. + * @param entity entity instance + * @throws IllegalArgumentException if the instance is not an + * entity or is a detached entity + * @throws TransactionRequiredException if invoked on a + * container-managed entity manager of type + * 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 T find(Class entityClass, Object primaryKey); + + /** + * Find by primary key, using the specified properties. + * 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. + * If a vendor-specific property or hint is not recognized, + * it is silently ignored. + * @param entityClass entity class + * @param primaryKey primary key + * @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 + * is not a valid type for that entity's primary key or + * is null + * @since Java Persistence 2.0 + */ + public T find(Class entityClass, Object primaryKey, + Map properties); + + /** + * Find by primary key and lock. + * Search for an entity of the specified class and primary key + * and lock it with respect to the specified lock type. + * If the entity instance is contained in the persistence context, + * it is returned from there, and the effect of this method is + * the same as if the lock method had been called on the entity. + *

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 OptimisticLockException will be thrown. + *

If the lock mode type is pessimistic and the entity instance + * is found but cannot be locked: + *

    + *
  • the PessimisticLockException will be thrown if the database + * locking failure causes transaction-level rollback + *
  • the LockTimeoutException will be thrown if the database + * locking failure causes only statement-level rollback + *
+ * @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 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 T find(Class entityClass, Object primaryKey, + LockModeType lockMode); + + /** + * Find by primary key and lock, using the specified properties. + * Search for an entity of the specified class and primary key + * and lock it with respect to the specified lock type. + * If the entity instance is contained in the persistence context, + * it is returned from there. + *

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 OptimisticLockException will be thrown. + *

If the lock mode type is pessimistic and the entity instance + * is found but cannot be locked: + *

    + *
  • the PessimisticLockException will be thrown if the database + * locking failure causes transaction-level rollback + *
  • the LockTimeoutException will be thrown if the database + * locking failure causes only statement-level rollback + *
+ *

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 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 T find(Class entityClass, Object primaryKey, + LockModeType lockMode, + Map properties); + + /** + * Get an instance, whose state may be lazily fetched. + * If the requested instance does not exist in the database, + * the 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 T getReference(Class entityClass, + Object primaryKey); + + /** + * Synchronize the persistence context to the + * underlying database. + * @throws TransactionRequiredException if there is + * no transaction + * @throws PersistenceException if the flush fails + */ + public void flush(); + + /** + * Set the flush mode that applies to all objects contained + * in the persistence context. + * @param flushMode flush mode + */ + public void setFlushMode(FlushModeType flushMode); + + /** + * Get the flush mode that applies to all objects contained + * in the persistence context. + * @return flushMode + */ + public FlushModeType getFlushMode(); + + /** + * Lock an entity instance that is contained in the persistence + * context with the specified lock mode type. + *

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 + * OptimisticLockException will be thrown. + *

If the lock mode type is pessimistic and the entity instance + * is found but cannot be locked: + *

    + *
  • the PessimisticLockException will be thrown if the database + * locking failure causes transaction-level rollback + *
  • the LockTimeoutException will be thrown if the database + * locking failure causes only statement-level rollback + *
+ * @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 + * @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. + *

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 + * OptimisticLockException will be thrown. + *

If the lock mode type is pessimistic and the entity instance + * is found but cannot be locked: + *

    + *
  • the PessimisticLockException will be thrown if the database + * locking failure causes transaction-level rollback + *
  • the LockTimeoutException will be thrown if the database + * locking failure causes only statement-level rollback + *
+ *

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 + * @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 properties); + + /** + * Refresh the state of the instance from the database, + * overwriting changes made to the entity, if any. + * @param entity entity instance + * @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 + * PersistenceContextType.TRANSACTION and there is + * no 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. + *

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 invoked on a + * container-managed entity manager of type + * PersistenceContextType.TRANSACTION and there is + * no transaction + * @throws EntityNotFoundException if the entity no longer + * exists in the database + * @since Java Persistence 2.0 + */ + public void refresh(Object entity, + Map properties); + + /** + * 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. + *

If the lock mode type is pessimistic and the entity instance + * is found but cannot be locked: + *

    + *
  • the PessimisticLockException will be thrown if the database + * locking failure causes transaction-level rollback + *
  • the LockTimeoutException will be thrown if the + * database locking failure causes only statement-level + * rollback. + *
+ * @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 there is no + * transaction and if invoked on a container-managed + * EntityManager instance with + * PersistenceContextType.TRANSACTION or with a lock mode + * other than NONE + * @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. + *

If the lock mode type is pessimistic and the entity instance + * is found but cannot be locked: + *

    + *
  • the PessimisticLockException will be thrown if the database + * locking failure causes transaction-level rollback + *
  • the LockTimeoutException will be thrown if the database + * locking failure causes only statement-level rollback + *
+ *

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 there is no + * transaction and if invoked on a container-managed + * EntityManager instance with + * PersistenceContextType.TRANSACTION or with a lock mode + * other than NONE + * @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, + Map properties); + + /** + * Clear the persistence context, causing all managed + * entities to become detached. Changes made to entities that + * have not been flushed to the database will not be + * persisted. + */ + public void clear(); + + /** + * Remove the given entity from the persistence context, causing + * a managed entity to become detached. Unflushed changes made + * to the entity if any (including removal of the entity), + * will not be synchronized to the database. Entities which + * previously referenced the detached entity will continue to + * reference it. + * @param entity entity instance + * @throws IllegalArgumentException if the instance is not an + * entity + * @since Java Persistence 2.0 + */ + public void detach(Object entity); + + /** + * Check if the instance is a managed entity instance belonging + * to the current persistence context. + * @param entity entity instance + * @return boolean indicating if entity is in persistence context + * @throws IllegalArgumentException if not an entity + */ + public boolean contains(Object entity); + + /** + * Get the current lock mode for the entity instance. + * @param entity entity instance + * @return lock mode + * @throws TransactionRequiredException if there is no + * transaction + * @throws IllegalArgumentException if the instance is not a + * managed entity and a transaction is active + * @since Java Persistence 2.0 + */ + public LockModeType getLockMode(Object entity); + + /** + * Set an entity manager property or hint. + * If a vendor-specific property or hint is not recognized, it is + * silently ignored. + * @param propertyName name of property or hint + * @param value value for property or hint + * @throws IllegalArgumentException if the second argument is + * not valid for the implementation + * @since Java Persistence 2.0 + */ + public void setProperty(String propertyName, Object value); + + /** + * Get the properties and hints and associated values that are in effect + * for the entity manager. Changing the contents of the map does + * not change the configuration in effect. + * @return map of properties and hints in effect for entity manager + * @since Java Persistence 2.0 + */ + public Map getProperties(); + + /** + * Create an instance of Query 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 TypedQuery createQuery(CriteriaQuery criteriaQuery); /** * Create an instance of Query for executing a criteria @@ -572,74 +572,74 @@ public void refresh(Object entity, LockModeType lockMode, 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 TypedQuery createQuery(String qlString, Class resultClass); - - /** - * Create an instance of 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 TypedQuery createNamedQuery(String name, Class resultClass); - - /** - * Create an instance of Query for executing - * a native SQL statement, e.g., for update or delete. - * @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 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 TypedQuery createQuery(String qlString, Class resultClass); + + /** + * Create an instance of 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 TypedQuery createNamedQuery(String name, Class resultClass); + + /** + * Create an instance of Query for executing + * a native SQL statement, e.g., for update or delete. + * @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 @@ -725,15 +725,15 @@ public StoredProcedureQuery createStoredProcedureQuery( String procedureName, String... resultSetMappings); /** - * Indicate to the entity manager that a JTA transaction is - * active. This method should be called on a JTA application - * managed entity manager that was created outside the scope - * of the active transaction to associate it with the current - * JTA transaction. - * @throws TransactionRequiredException if there is - * no transaction - */ - public void joinTransaction(); + * Indicate to the entity manager that a JTA transaction is + * active. This method should be called on a JTA application + * managed entity manager that was created outside the scope + * of the active transaction 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 @@ -745,89 +745,89 @@ public StoredProcedureQuery createStoredProcedureQuery( 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 T unwrap(Class cls); - - /** - * Return the underlying provider object for the EntityManager, - * if available. The result of this method is implementation - * specific. The 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 and TypedQuery - * 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 - * associated with 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 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 T unwrap(Class cls); + + /** + * Return the underlying provider object for the EntityManager, + * if available. The result of this method is implementation + * specific. The 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 and TypedQuery + * 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 + * associated with 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. diff --git a/src/main/java/javax/persistence/EntityManagerFactory.java b/src/main/java/javax/persistence/EntityManagerFactory.java index b7f7259..a0b1c54 100644 --- a/src/main/java/javax/persistence/EntityManagerFactory.java +++ b/src/main/java/javax/persistence/EntityManagerFactory.java @@ -27,29 +27,29 @@ */ public interface EntityManagerFactory { - /** - * Create a new application-managed EntityManager. This method returns a new + /** + * Create a new application-managed EntityManager. This method returns a new * code>EntityManager instance each time it is invoked. The isOpen method will return true * on the returned instance. * - * @return entity manager instance + * @return entity manager instance * - * @throws IllegalStateException if the entity manager factory has been closed - */ - public EntityManager createEntityManager(); + * @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. + /** + * 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 + * @param map properties for entity manager * - * @return entity manager instance + * @return entity manager instance * - * @throws IllegalStateException if the entity manager factory - * has been closed - */ + * @throws IllegalStateException if the entity manager factory + * has been closed + */ public EntityManager createEntityManager(Map map); /** @@ -83,80 +83,80 @@ public interface EntityManagerFactory { */ 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 Map getProperties(); - - /** - * Access the cache that is associated with the entity manager - * factory (the "second level cache"). - * @return instance of the Cache interface - * @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(); + /** + * 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 Map getProperties(); + + /** + * Access the cache that is associated with the entity manager + * factory (the "second level cache"). + * @return instance of the Cache interface + * @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 diff --git a/src/main/java/javax/persistence/EntityResult.java b/src/main/java/javax/persistence/EntityResult.java index 7916e6b..105b19f 100644 --- a/src/main/java/javax/persistence/EntityResult.java +++ b/src/main/java/javax/persistence/EntityResult.java @@ -45,19 +45,19 @@ @Retention(RUNTIME) public @interface EntityResult { - /** The class of the result. */ - Class entityClass(); + /** 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 {}; + /** + * 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 ""; + /** + * 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 ""; } diff --git a/src/main/java/javax/persistence/EntityTransaction.java b/src/main/java/javax/persistence/EntityTransaction.java index 74c2f65..e9197c0 100644 --- a/src/main/java/javax/persistence/EntityTransaction.java +++ b/src/main/java/javax/persistence/EntityTransaction.java @@ -19,51 +19,51 @@ */ public interface EntityTransaction { - /** - * Start a resource transaction. - * @throws IllegalStateException if isActive() is true - */ - public void begin(); + /** + * 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(); + /** + * 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(); + /** + * 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(); + /** + * 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(); + /** + * 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(); + /** + * 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(); } diff --git a/src/main/java/javax/persistence/EnumType.java b/src/main/java/javax/persistence/EnumType.java index b50bd57..20a0882 100644 --- a/src/main/java/javax/persistence/EnumType.java +++ b/src/main/java/javax/persistence/EnumType.java @@ -17,9 +17,9 @@ * @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 an integer. */ + ORDINAL, - /** Persist enumerated type property or field as a string. */ - STRING + /** Persist enumerated type property or field as a string. */ + STRING } diff --git a/src/main/java/javax/persistence/Enumerated.java b/src/main/java/javax/persistence/Enumerated.java index 95e5482..f820647 100644 --- a/src/main/java/javax/persistence/Enumerated.java +++ b/src/main/java/javax/persistence/Enumerated.java @@ -51,6 +51,6 @@ @Retention(RUNTIME) public @interface Enumerated { - /** (Optional) The type used in mapping an enum type. */ - EnumType value() default ORDINAL; + /** (Optional) The type used in mapping an enum type. */ + EnumType value() default ORDINAL; } diff --git a/src/main/java/javax/persistence/FetchType.java b/src/main/java/javax/persistence/FetchType.java index 625e562..b22822a 100644 --- a/src/main/java/javax/persistence/FetchType.java +++ b/src/main/java/javax/persistence/FetchType.java @@ -35,9 +35,9 @@ */ public enum FetchType { - /** Defines that data can be lazily fetched. */ - LAZY, + /** Defines that data can be lazily fetched. */ + LAZY, - /** Defines that data must be eagerly fetched. */ - EAGER + /** Defines that data must be eagerly fetched. */ + EAGER } diff --git a/src/main/java/javax/persistence/FieldResult.java b/src/main/java/javax/persistence/FieldResult.java index 215bcdc..89d4f7e 100644 --- a/src/main/java/javax/persistence/FieldResult.java +++ b/src/main/java/javax/persistence/FieldResult.java @@ -45,12 +45,12 @@ public @interface FieldResult { - /** Name of the persistent field or property of the class. */ - String name(); + /** 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(); + /** + * Name of the column in the SELECT clause - i.e., column + * aliases, if applicable. + */ + String column(); } diff --git a/src/main/java/javax/persistence/FlushModeType.java b/src/main/java/javax/persistence/FlushModeType.java index 7bd674d..c62f24b 100644 --- a/src/main/java/javax/persistence/FlushModeType.java +++ b/src/main/java/javax/persistence/FlushModeType.java @@ -35,11 +35,11 @@ */ public enum FlushModeType { - /** Flushing to occur at transaction commit. The provider may flush - * at other times, but is not required to. - */ + /** 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. */ + /** (Default) Flushing to occur at query execution. */ AUTO } diff --git a/src/main/java/javax/persistence/GeneratedValue.java b/src/main/java/javax/persistence/GeneratedValue.java index 52632e6..4a24cab 100644 --- a/src/main/java/javax/persistence/GeneratedValue.java +++ b/src/main/java/javax/persistence/GeneratedValue.java @@ -57,18 +57,18 @@ 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 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. - *

Defaults to the id generator supplied by persistence provider. - */ - String generator() default ""; + /** + * (Optional) The name of the primary key generator + * to use as specified in the {@link SequenceGenerator} + * or {@link TableGenerator} annotation. + *

Defaults to the id generator supplied by persistence provider. + */ + String generator() default ""; } diff --git a/src/main/java/javax/persistence/GenerationType.java b/src/main/java/javax/persistence/GenerationType.java index 5f11346..83b5336 100644 --- a/src/main/java/javax/persistence/GenerationType.java +++ b/src/main/java/javax/persistence/GenerationType.java @@ -18,33 +18,33 @@ */ 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 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 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 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 - * 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 + /** + * Indicates that the persistence provider should pick an + * appropriate strategy for the particular database. The + * 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 } diff --git a/src/main/java/javax/persistence/IdClass.java b/src/main/java/javax/persistence/IdClass.java index aed3bfd..aed85d7 100644 --- a/src/main/java/javax/persistence/IdClass.java +++ b/src/main/java/javax/persistence/IdClass.java @@ -43,6 +43,6 @@ public @interface IdClass { - /** Primary key class */ - Class value(); + /** Primary key class */ + Class value(); } diff --git a/src/main/java/javax/persistence/Inheritance.java b/src/main/java/javax/persistence/Inheritance.java index 4b848ac..f420ad7 100644 --- a/src/main/java/javax/persistence/Inheritance.java +++ b/src/main/java/javax/persistence/Inheritance.java @@ -42,6 +42,6 @@ public @interface Inheritance { - /** The strategy to be used for the entity inheritance hierarchy. */ - InheritanceType strategy() default SINGLE_TABLE; + /** The strategy to be used for the entity inheritance hierarchy. */ + InheritanceType strategy() default SINGLE_TABLE; } diff --git a/src/main/java/javax/persistence/InheritanceType.java b/src/main/java/javax/persistence/InheritanceType.java index 069bb12..0506593 100644 --- a/src/main/java/javax/persistence/InheritanceType.java +++ b/src/main/java/javax/persistence/InheritanceType.java @@ -16,17 +16,17 @@ */ public enum InheritanceType { - /** A single table per class hierarchy. */ - SINGLE_TABLE, + /** A single table per class hierarchy. */ + SINGLE_TABLE, - /** A table per concrete entity class. */ - TABLE_PER_CLASS, + /** 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 + /** + * 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 } diff --git a/src/main/java/javax/persistence/JoinColumn.java b/src/main/java/javax/persistence/JoinColumn.java index 55ffa15..3f90c2a 100644 --- a/src/main/java/javax/persistence/JoinColumn.java +++ b/src/main/java/javax/persistence/JoinColumn.java @@ -50,118 +50,118 @@ @Retention(RUNTIME) public @interface JoinColumn { - /** - * (Optional) The name of the foreign key column. - * The table in which it is found depends upon the - * context. - *

    - *
  • If the join is for a OneToOne or ManyToOne - * mapping using a foreign key mapping strategy, - * the foreign key column is in the table of the - * source entity or embeddable. - *
  • If the join is for a unidirectional OneToMany mapping - * using a foreign key mapping strategy, the foreign key is in the - * table of the target entity. - *
  • If the join is for a ManyToMany mapping or for a OneToOne - * or bidirectional ManyToOne/OneToMany mapping using a join - * table, the foreign key is in a join table. - *
  • If the join is for an element collection, the foreign - * key is in a collection table. - *
- * - *

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 foreign key column. + * The table in which it is found depends upon the + * context. + *

    + *
  • If the join is for a OneToOne or ManyToOne + * mapping using a foreign key mapping strategy, + * the foreign key column is in the table of the + * source entity or embeddable. + *
  • If the join is for a unidirectional OneToMany mapping + * using a foreign key mapping strategy, the foreign key is in the + * table of the target entity. + *
  • If the join is for a ManyToMany mapping or for a OneToOne + * or bidirectional ManyToOne/OneToMany mapping using a join + * table, the foreign key is in a join table. + *
  • If the join is for an element collection, the foreign + * key is in a collection table. + *
+ * + *

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. - *

    - *
  • When used with entity relationship mappings other - * than the cases described here, the referenced column is in the - * table of the target entity. - *
  • When used with a unidirectional OneToMany foreign key - * mapping, the referenced column is in the table of the source - * entity. - *
  • When used inside a 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. - *
  • When used in a CollectionTable mapping, the - * referenced column is in the table of the entity containing the - * collection. - *
- * - *

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) The name of the column referenced by this foreign + * key column. + *

    + *
  • When used with entity relationship mappings other + * than the cases described here, the referenced column is in the + * table of the target entity. + *
  • When used with a unidirectional OneToMany foreign key + * mapping, the referenced column is in the table of the source + * entity. + *
  • When used inside a 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. + *
  • When used in a CollectionTable mapping, the + * referenced column is in the table of the entity containing the + * collection. + *
+ * + *

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 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 property 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 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 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 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) 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 for the column. - */ - String columnDefinition() default ""; + /** + * (Optional) The SQL fragment that is used when + * generating the DDL for the column. + *

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: - *

    - *
  • If the join is for a OneToOne or ManyToOne mapping - * using a foreign key mapping strategy, the name of the table of - * the source entity or embeddable. - *
  • If the join is for a unidirectional OneToMany mapping - * using a foreign key mapping strategy, the name of the table of - * the target entity. - *
  • If the join is for a ManyToMany mapping or - * for a OneToOne or bidirectional ManyToOne/OneToMany mapping - * using a join table, the name of the join table. - *
  • If the join is for an element collection, the name of the collection table. - *
- */ - String table() 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: + *

    + *
  • If the join is for a OneToOne or ManyToOne mapping + * using a foreign key mapping strategy, the name of the table of + * the source entity or embeddable. + *
  • If the join is for a unidirectional OneToMany mapping + * using a foreign key mapping strategy, the name of the table of + * the target entity. + *
  • If the join is for a ManyToMany mapping or + * for a OneToOne or bidirectional ManyToOne/OneToMany mapping + * using a join table, the name of the join table. + *
  • If the join is for an element collection, the name of the collection table. + *
+ */ + String table() default ""; /** * (Optional) The foreign key constraint specification for the join column. This is used only if table generation diff --git a/src/main/java/javax/persistence/JoinColumns.java b/src/main/java/javax/persistence/JoinColumns.java index 5d5effc..f73791b 100644 --- a/src/main/java/javax/persistence/JoinColumns.java +++ b/src/main/java/javax/persistence/JoinColumns.java @@ -43,10 +43,10 @@ @Retention(RUNTIME) public @interface JoinColumns { - /** - * The join columns that map the relationship. - */ - JoinColumn[] value(); + /** + * The join columns that map the relationship. + */ + JoinColumn[] value(); /** * (Optional) The foreign key constraint specification for the join columns. This is used only if table diff --git a/src/main/java/javax/persistence/JoinTable.java b/src/main/java/javax/persistence/JoinTable.java index ca8a0de..85a14bb 100644 --- a/src/main/java/javax/persistence/JoinTable.java +++ b/src/main/java/javax/persistence/JoinTable.java @@ -60,54 +60,54 @@ public @interface JoinTable { - /** - * (Optional) The name of the join table. - * - *

Defaults to the concatenated names of - * the two associated primary entity tables, - * separated by an underscore. - */ - String name() default ""; + /** + * (Optional) The name of the join table. + * + *

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 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 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 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) 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) Unique constraints that are - * to be placed on the table. These are - * only used if table generation is in effect. - *

Defaults to no additional constraints. - */ - UniqueConstraint[] uniqueConstraints() default {}; + /** + * (Optional) Unique constraints that are + * to be placed on the table. These are + * only used if table generation is in effect. + *

Defaults to no additional constraints. + */ + UniqueConstraint[] uniqueConstraints() default {}; /** * (Optional) Indexes for the table. These are only used if table generation is in effect. diff --git a/src/main/java/javax/persistence/LockModeType.java b/src/main/java/javax/persistence/LockModeType.java index 9396f1a..d5f2df8 100644 --- a/src/main/java/javax/persistence/LockModeType.java +++ b/src/main/java/javax/persistence/LockModeType.java @@ -119,62 +119,62 @@ * @since Java Persistence 1.0 */ public enum LockModeType { - /** - * Synonymous with OPTIMISTIC. - * OPTIMISTIC is to be preferred for new - * applications. - * - */ - READ, + /** + * Synonymous with 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, + /** + * 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. + * + * @since Java Persistence 2.0 + */ + OPTIMISTIC, - /** - * Optimistic lock, with version update. - * - * @since Java Persistence 2.0 - */ - OPTIMISTIC_FORCE_INCREMENT, + /** + * Optimistic lock, with version update. + * + * @since Java Persistence 2.0 + */ + OPTIMISTIC_FORCE_INCREMENT, - /** - * - * Pessimistic read lock. - * - * @since Java Persistence 2.0 - */ - PESSIMISTIC_READ, + /** + * + * Pessimistic read lock. + * + * @since Java Persistence 2.0 + */ + PESSIMISTIC_READ, - /** - * Pessimistic write lock. - * - * @since Java Persistence 2.0 - */ - PESSIMISTIC_WRITE, + /** + * Pessimistic write lock. + * + * @since Java Persistence 2.0 + */ + PESSIMISTIC_WRITE, - /** - * Pessimistic write lock, with version update. - * - * @since Java Persistence 2.0 - */ - PESSIMISTIC_FORCE_INCREMENT, + /** + * Pessimistic write lock, with version update. + * + * @since Java Persistence 2.0 + */ + PESSIMISTIC_FORCE_INCREMENT, - /** - * No lock. - * - * @since Java Persistence 2.0 - */ - NONE + /** + * No lock. + * + * @since Java Persistence 2.0 + */ + NONE } diff --git a/src/main/java/javax/persistence/LockTimeoutException.java b/src/main/java/javax/persistence/LockTimeoutException.java index c4ec467..3acbd78 100644 --- a/src/main/java/javax/persistence/LockTimeoutException.java +++ b/src/main/java/javax/persistence/LockTimeoutException.java @@ -19,71 +19,71 @@ * @since Java Persistence 2.0 */ public class LockTimeoutException extends PersistenceException { - /** The object that caused the exception */ - Object entity; + /** 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 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. + * @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 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 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 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; - } + /** + * 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; - } + /** + * Returns the object that caused this exception. + * @return the entity + */ + public Object getObject() { + return this.entity; + } } diff --git a/src/main/java/javax/persistence/ManyToMany.java b/src/main/java/javax/persistence/ManyToMany.java index a402f04..a32a558 100644 --- a/src/main/java/javax/persistence/ManyToMany.java +++ b/src/main/java/javax/persistence/ManyToMany.java @@ -98,40 +98,40 @@ @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. - * - *

Defaults to the parameterized type of - * the collection when defined using generics. - */ - Class targetEntity() default void.class; + /** + * (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. + * + *

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 cascade element applies to the - * map value. - * - *

Defaults to no operations being cascaded. - */ - CascadeType[] cascade() default {}; + /** + * (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 cascade element applies to the + * map value. + * + *

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; + /** (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 ""; + /** + * The field that owns the relationship. Required unless + * the relationship is unidirectional. + */ + String mappedBy() default ""; } diff --git a/src/main/java/javax/persistence/ManyToOne.java b/src/main/java/javax/persistence/ManyToOne.java index dfe82c8..cfe353e 100644 --- a/src/main/java/javax/persistence/ManyToOne.java +++ b/src/main/java/javax/persistence/ManyToOne.java @@ -78,35 +78,35 @@ public @interface ManyToOne { - /** - * (Optional) The entity class that is the target of - * the association. - * - *

Defaults to the type of the field or property - * that stores the association. - */ - Class targetEntity() default void.class; + /** + * (Optional) The entity class that is the target of + * the association. + * + *

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) 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 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) Whether the association is optional. If set + * to false then a non-null relationship must always exist. + */ + boolean optional() default true; } diff --git a/src/main/java/javax/persistence/MapKey.java b/src/main/java/javax/persistence/MapKey.java index 5a4b3eb..587a39d 100644 --- a/src/main/java/javax/persistence/MapKey.java +++ b/src/main/java/javax/persistence/MapKey.java @@ -80,15 +80,15 @@ @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. - *

Default: If the - * 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 ""; + /** + * (Optional) The name of the persistent field or property of the + * associated entity that is used as the map key. + *

Default: If the + * 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 ""; } diff --git a/src/main/java/javax/persistence/MapKeyColumn.java b/src/main/java/javax/persistence/MapKeyColumn.java index 8576b26..552f13f 100644 --- a/src/main/java/javax/persistence/MapKeyColumn.java +++ b/src/main/java/javax/persistence/MapKeyColumn.java @@ -52,8 +52,8 @@ * 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. - *

Defaults to the concatenation of the following: the name of - * the referencing relationship field or property; "_"; "KEY". + *

Defaults to the concatenation of the following: the name of + * the referencing relationship field or property; "_"; "KEY". */ String name() default ""; @@ -88,21 +88,21 @@ * 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. - * - *

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. - */ + * + *

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 ""; /** @@ -114,8 +114,8 @@ /** * (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.) + * + *

Default: 0. (The value must be set by the developer.) */ int precision() default 0; // decimal precision diff --git a/src/main/java/javax/persistence/MapKeyEnumerated.java b/src/main/java/javax/persistence/MapKeyEnumerated.java index 0881e94..3bb43f4 100644 --- a/src/main/java/javax/persistence/MapKeyEnumerated.java +++ b/src/main/java/javax/persistence/MapKeyEnumerated.java @@ -58,6 +58,6 @@ @Target({METHOD, FIELD}) @Retention(RUNTIME) public @interface MapKeyEnumerated { - /** (Optional) The type used in mapping a map key enum type. */ - EnumType value() default ORDINAL; + /** (Optional) The type used in mapping a map key enum type. */ + EnumType value() default ORDINAL; } diff --git a/src/main/java/javax/persistence/MapKeyJoinColumn.java b/src/main/java/javax/persistence/MapKeyJoinColumn.java index f61b23f..eee73e1 100644 --- a/src/main/java/javax/persistence/MapKeyJoinColumn.java +++ b/src/main/java/javax/persistence/MapKeyJoinColumn.java @@ -88,32 +88,32 @@ * (Optional) The name of the foreign key column for the map * key. The table in which it is found depends upon the * context. - *

    - *
  • If the join is for a map key for an + *
      + *
    • If the join is for a map key for an * element collection, the foreign key column is in the * collection table for the map value. - *
    • If the join is for a map key for a ManyToMany entity - * relationship or for a OneToMany entity relationship - * using a join table, the foreign key column is in a join table. - *
    • If the join is for a OneToMany entity relationship using - * a foreign key mapping strategy, the foreign key column for the - * map key is in the table of the entity that is the value of the map. - *
    - * - *

    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". + *

  • If the join is for a map key for a ManyToMany entity + * relationship or for a OneToMany entity relationship + * using a join table, the foreign key column is in a join table. + *
  • If the join is for a OneToMany entity relationship using + * a foreign key mapping strategy, the foreign key column for the + * map key is in the table of the entity that is the value of the map. + *
+ * + *

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 + * + *

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 ""; @@ -145,32 +145,32 @@ /** * (Optional) The SQL fragment that is used when generating the DDL for the * column. - * Defaults to SQL generated by the provider 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. - *

    - *
  • If the join is for a map key for an element collection, the foreign key + *
      + *
    • If the join is for a map key for an element collection, the foreign key * column is in the collection table for the map value. - *
    • If the join is for a map key for a ManyToMany entity relationship - * or for a OneToMany entity relationship using a join table, - * the foreign key column is in a join table. + *
    • If the join is for a map key for a ManyToMany entity relationship + * or for a OneToMany entity relationship using a join table, + * the foreign key column is in a join table. *
    • If the join is for a OneToMany entity relationship using a foreign * key mapping strategy, the foreign key column for the map key is in the * table of the entity that is the value of the map. - *
    - *

    Default: - *

      - *
    • If the map is for an element collection, the - * name of the collection table for the map value. - *
    • If the map is for a OneToMany or ManyToMany entity relationship - * using a join table, the name of the join table for the map. - *
    • If the map 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. - *
    + *
+ *

Default: + *

    + *
  • If the map is for an element collection, the + * name of the collection table for the map value. + *
  • If the map is for a OneToMany or ManyToMany entity relationship + * using a join table, the name of the join table for the map. + *
  • If the map 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 ""; diff --git a/src/main/java/javax/persistence/MapKeyTemporal.java b/src/main/java/javax/persistence/MapKeyTemporal.java index 54c85e0..415f0ad 100644 --- a/src/main/java/javax/persistence/MapKeyTemporal.java +++ b/src/main/java/javax/persistence/MapKeyTemporal.java @@ -40,9 +40,9 @@ @Retention(RUNTIME) public @interface MapKeyTemporal { - /** (Required) The type used in mapping - * java.util.Date or - * java.util.Calendar. - */ - TemporalType value(); + /** (Required) The type used in mapping + * java.util.Date or + * java.util.Calendar. + */ + TemporalType value(); } diff --git a/src/main/java/javax/persistence/MapsId.java b/src/main/java/javax/persistence/MapsId.java index 6de8146..a6cce4e 100644 --- a/src/main/java/javax/persistence/MapsId.java +++ b/src/main/java/javax/persistence/MapsId.java @@ -62,11 +62,11 @@ @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. - */ + /** + * (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 ""; } diff --git a/src/main/java/javax/persistence/NamedNativeQueries.java b/src/main/java/javax/persistence/NamedNativeQueries.java index 2d51eba..d331f80 100644 --- a/src/main/java/javax/persistence/NamedNativeQueries.java +++ b/src/main/java/javax/persistence/NamedNativeQueries.java @@ -28,6 +28,6 @@ @Retention(RUNTIME) public @interface NamedNativeQueries { - /** (Required) Array of NamedNativeQuery annotations. */ - NamedNativeQuery[] value (); + /** (Required) Array of NamedNativeQuery annotations. */ + NamedNativeQuery[] value (); } diff --git a/src/main/java/javax/persistence/NamedNativeQuery.java b/src/main/java/javax/persistence/NamedNativeQuery.java index e49926b..033633a 100644 --- a/src/main/java/javax/persistence/NamedNativeQuery.java +++ b/src/main/java/javax/persistence/NamedNativeQuery.java @@ -27,21 +27,21 @@ @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 name used to refer to the query with the {@link EntityManager} + * methods that create query objects. + */ + String name(); - /** The SQL query string. */ - String query(); + /** The SQL query string. */ + String query(); - /** Query properties and hints. (May include vendor-specific query hints.) */ - QueryHint[] hints() default {}; + /** Query properties and hints. (May include vendor-specific query hints.) */ + QueryHint[] hints() default {}; - /** The class of the result. */ - Class resultClass() default void.class; + /** The class of the result. */ + Class resultClass() default void.class; - /** The name of a {@link SqlResultSetMapping}, as defined in metadata. */ - String resultSetMapping() default ""; + /** The name of a {@link SqlResultSetMapping}, as defined in metadata. */ + String resultSetMapping() default ""; } diff --git a/src/main/java/javax/persistence/NamedQueries.java b/src/main/java/javax/persistence/NamedQueries.java index e263854..c9e9ea0 100644 --- a/src/main/java/javax/persistence/NamedQueries.java +++ b/src/main/java/javax/persistence/NamedQueries.java @@ -28,6 +28,6 @@ @Retention(RUNTIME) public @interface NamedQueries { - /** (Required) An array of NamedQuery annotations. */ - NamedQuery [] value (); + /** (Required) An array of NamedQuery annotations. */ + NamedQuery [] value (); } diff --git a/src/main/java/javax/persistence/NamedQuery.java b/src/main/java/javax/persistence/NamedQuery.java index 5ff4800..c012405 100644 --- a/src/main/java/javax/persistence/NamedQuery.java +++ b/src/main/java/javax/persistence/NamedQuery.java @@ -48,27 +48,27 @@ @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 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(); + /** (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. - * @since Java Persistence 2.0 - */ - LockModeType lockMode() default NONE; + /** + * (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. + * @since Java Persistence 2.0 + */ + LockModeType lockMode() default NONE; - /** (Optional) Query properties and hints. May include - * vendor-specific query hints. - */ - QueryHint[] hints() default {}; + /** (Optional) Query properties and hints. May include + * vendor-specific query hints. + */ + QueryHint[] hints() default {}; } diff --git a/src/main/java/javax/persistence/NonUniqueResultException.java b/src/main/java/javax/persistence/NonUniqueResultException.java index 0fad9de..2901d4d 100644 --- a/src/main/java/javax/persistence/NonUniqueResultException.java +++ b/src/main/java/javax/persistence/NonUniqueResultException.java @@ -24,19 +24,19 @@ */ public class NonUniqueResultException extends PersistenceException { - /** - * Constructs a new NonUniqueResultException exception - * with null as its detail message. - */ + /** + * 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. - */ + /** + * Constructs a new NonUniqueResultException exception + * with the specified detail message. + * @param message the detail message. + */ public NonUniqueResultException(String message) { super(message); } diff --git a/src/main/java/javax/persistence/OneToMany.java b/src/main/java/javax/persistence/OneToMany.java index 0403b42..2c15044 100644 --- a/src/main/java/javax/persistence/OneToMany.java +++ b/src/main/java/javax/persistence/OneToMany.java @@ -83,47 +83,47 @@ @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. - * - *

Defaults to the parameterized type of - * the collection when defined using generics. - */ - Class targetEntity() default void.class; + /** + * (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. + * + *

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 cascade element applies to the - * map value. - */ - CascadeType[] cascade() default {}; + /** + * (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 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; + /** (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 ""; + /** + * 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; + /** + * (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; } diff --git a/src/main/java/javax/persistence/OneToOne.java b/src/main/java/javax/persistence/OneToOne.java index 2839b5b..cec5fdb 100644 --- a/src/main/java/javax/persistence/OneToOne.java +++ b/src/main/java/javax/persistence/OneToOne.java @@ -108,50 +108,50 @@ @Retention(RUNTIME) public @interface OneToOne { - /** - * (Optional) The entity class that is the target of - * the association. - * - *

Defaults to the type of the field or property - * that stores the association. - */ - Class targetEntity() default void.class; + /** + * (Optional) The entity class that is the target of + * the association. + * + *

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) 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 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) 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) 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; + /** + * (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; } diff --git a/src/main/java/javax/persistence/OrderBy.java b/src/main/java/javax/persistence/OrderBy.java index 8335d02..4c59b7b 100644 --- a/src/main/java/javax/persistence/OrderBy.java +++ b/src/main/java/javax/persistence/OrderBy.java @@ -114,18 +114,18 @@ public @interface OrderBy { /** - * An orderby_list. Specified as follows: - * - *

-    *    orderby_list::= orderby_item [,orderby_item]*
-    *    orderby_item::= [property_or_field_name] [ASC | DESC]
-    * 
- * - *

If ASC or DESC is not specified, - * ASC (ascending order) is assumed. - * - *

If the ordering element is not specified, ordering by - * the primary key of the associated entity is assumed. - */ - String value() default ""; + * An orderby_list. Specified as follows: + * + *

+	*    orderby_list::= orderby_item [,orderby_item]*
+	*    orderby_item::= [property_or_field_name] [ASC | DESC]
+	* 
+ * + *

If ASC or DESC is not specified, + * ASC (ascending order) is assumed. + * + *

If the ordering element is not specified, ordering by + * the primary key of the associated entity is assumed. + */ + String value() default ""; } diff --git a/src/main/java/javax/persistence/OrderColumn.java b/src/main/java/javax/persistence/OrderColumn.java index 4eba1e2..894fa1c 100644 --- a/src/main/java/javax/persistence/OrderColumn.java +++ b/src/main/java/javax/persistence/OrderColumn.java @@ -67,9 +67,9 @@ public @interface OrderColumn { /** (Optional) The name of the ordering column. - * Defaults to the concatenation of the name of the - * referencing property or field; "_"; "ORDER". - */ + * Defaults to the concatenation of the name of the + * referencing property or field; "_"; "ORDER". + */ String name() default ""; /** (Optional) Whether the database column is nullable. */ diff --git a/src/main/java/javax/persistence/Parameter.java b/src/main/java/javax/persistence/Parameter.java index 128276f..3d2e99a 100644 --- a/src/main/java/javax/persistence/Parameter.java +++ b/src/main/java/javax/persistence/Parameter.java @@ -20,32 +20,32 @@ */ public interface Parameter { - /** - * Return the parameter name, or null if the parameter is - * not a named parameter or no name has been assigned. - * @return parameter name - */ - String getName(); + /** + * Return the parameter name, or null if the parameter is + * not a named parameter or no name has been assigned. + * @return parameter name + */ + String getName(); - /** - * Return the parameter position, or null if the parameter - * is not a positional parameter. - * @return position of parameter - */ - Integer getPosition(); + /** + * Return the parameter position, or null if the parameter + * is not a positional parameter. + * @return position of parameter + */ + Integer getPosition(); - /** - * Return the Java type of the parameter. Values bound to the - * parameter must be assignable to this type. - * This method is required to be supported for criteria queries - * only. Applications that use this method for Java - * Persistence query language queries and native queries will - * not be portable. - * @return the Java type of the parameter - * @throws IllegalStateException if invoked on a parameter - * obtained from a Java persistence query language - * query or native query when the implementation does - * not support this use - */ - Class getParameterType(); + /** + * Return the Java type of the parameter. Values bound to the + * parameter must be assignable to this type. + * This method is required to be supported for criteria queries + * only. Applications that use this method for Java + * Persistence query language queries and native queries will + * not be portable. + * @return the Java type of the parameter + * @throws IllegalStateException if invoked on a parameter + * obtained from a Java persistence query language + * query or native query when the implementation does + * not support this use + */ + Class getParameterType(); } diff --git a/src/main/java/javax/persistence/PersistenceContext.java b/src/main/java/javax/persistence/PersistenceContext.java index c249a2b..5703952 100644 --- a/src/main/java/javax/persistence/PersistenceContext.java +++ b/src/main/java/javax/persistence/PersistenceContext.java @@ -27,26 +27,26 @@ @Retention(RUNTIME) public @interface PersistenceContext { - /** - * (Optional) The name by which the entity manager is to be accessed in the - * environment referencing context; not needed when dependency - * injection is used. - */ - String name() default ""; + /** + * (Optional) The name by which the entity manager 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 - * persistence.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) The name of the persistence unit as defined in the + * persistence.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 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 @@ -57,11 +57,11 @@ */ 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 {}; + /** + * (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 {}; } diff --git a/src/main/java/javax/persistence/PersistenceContexts.java b/src/main/java/javax/persistence/PersistenceContexts.java index 9bd44d8..b7400f9 100644 --- a/src/main/java/javax/persistence/PersistenceContexts.java +++ b/src/main/java/javax/persistence/PersistenceContexts.java @@ -28,7 +28,7 @@ @Retention(RUNTIME) public @interface PersistenceContexts { - /** (Required) One or more PersistenceContext annotations. */ - PersistenceContext[] value(); + /** (Required) One or more PersistenceContext annotations. */ + PersistenceContext[] value(); } diff --git a/src/main/java/javax/persistence/SharedCacheMode.java b/src/main/java/javax/persistence/SharedCacheMode.java index 79bbc13..ab69fd8 100644 --- a/src/main/java/javax/persistence/SharedCacheMode.java +++ b/src/main/java/javax/persistence/SharedCacheMode.java @@ -18,32 +18,32 @@ * @since Java Persistence 2.0 */ public enum SharedCacheMode { - /** - * All entities and entity-related state and data are cached. - */ - ALL, + /** + * All entities and entity-related state and data are cached. + */ + ALL, - /** - * Caching is disabled for the persistence unit. - */ - NONE, + /** + * 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 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 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 + /** + * + * Caching behavior is undefined: provider-specific defaults may apply. + */ + UNSPECIFIED } diff --git a/src/main/java/javax/persistence/ValidationMode.java b/src/main/java/javax/persistence/ValidationMode.java index 5b571a3..694a8be 100644 --- a/src/main/java/javax/persistence/ValidationMode.java +++ b/src/main/java/javax/persistence/ValidationMode.java @@ -16,24 +16,24 @@ * @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, + /** + * 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 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 + /** + * The persistence provider must not perform lifecycle event validation. + */ + NONE }