[maven-release-plugin] copy for tag geronimo-jpa_2.0_spec-1.0-EA-1
git-svn-id: https://svn.apache.org/repos/asf/geronimo/specs/tags/geronimo-jpa_2.0_spec-1.0-EA-1@738641 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/pom.xml b/pom.xml
index d731d4a..0039d6b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,7 +33,7 @@
<artifactId>geronimo-jpa_2.0_spec</artifactId>
<packaging>jar</packaging>
<name>JPA 2.0</name>
- <version>1.0-EA-SNAPSHOT</version>
+ <version>1.0-EA-1</version>
<url>http://geronimo.apache.org/maven/${siteId}/${version}</url>
<distributionManagement>
@@ -51,9 +51,9 @@
</properties>
<scm>
- <connection>scm:svn:http://svn.apache.org/repos/asf/geronimo/specs/trunk/geronimo-jpa_2.0_spec/</connection>
- <developerConnection>scm:svn:https://svn.apache.org/repos/asf/geronimo/specs/trunk/geronimo-jpa_2.0_spec/</developerConnection>
- <url>http://svn.apache.org/viewcvs.cgi/geronimo/specs/trunk/geronimo-jpa_2.0_spec/</url>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/geronimo/specs/tags/geronimo-jpa_2.0_spec-1.0-EA-1</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/geronimo/specs/tags/geronimo-jpa_2.0_spec-1.0-EA-1</developerConnection>
+ <url>http://svn.apache.org/viewcvs.cgi/geronimo/specs/tags/geronimo-jpa_2.0_spec-1.0-EA-1</url>
</scm>
</project>
diff --git a/src/main/java/javax/persistence/Aggregate.java b/src/main/java/javax/persistence/Aggregate.java
index fad0643..041956b 100644
--- a/src/main/java/javax/persistence/Aggregate.java
+++ b/src/main/java/javax/persistence/Aggregate.java
@@ -24,13 +24,6 @@
//
package javax.persistence;
-/**
- * Type of the result of an aggregate operation
- */
public interface Aggregate extends Expression {
- /**
- * Specify that duplicates are to be removed before the aggregate operation
- * is invoked.
- */
Expression distinct();
}
diff --git a/src/main/java/javax/persistence/Cache.java b/src/main/java/javax/persistence/Cache.java
index 0701654..abefac6 100644
--- a/src/main/java/javax/persistence/Cache.java
+++ b/src/main/java/javax/persistence/Cache.java
@@ -24,30 +24,12 @@
//
package javax.persistence;
-/**
- * Interface used to interact with the second-level cache.
- * If a cache is not in use, the methods of this interface have
- * no effect, except for contains, which returns false.
- */
public interface Cache {
- /**
- * Whether the cache contains data for the given entity.
- */
public boolean contains(Class cls, Object primaryKey);
- /**
- * Remove the data for the given entity from the cache.
- */
public void evict(Class cls, Object primaryKey);
- /**
- * Remove the data for entities of the specified class (and its
- * subclasses) from the cache.
- */
public void evict(Class cls);
- /**
- * Clear the cache.
- */
public void evictAll();
}
diff --git a/src/main/java/javax/persistence/CaseExpression.java b/src/main/java/javax/persistence/CaseExpression.java
index 94426ac..f3843fb 100644
--- a/src/main/java/javax/persistence/CaseExpression.java
+++ b/src/main/java/javax/persistence/CaseExpression.java
@@ -27,279 +27,48 @@
import java.util.Calendar;
import java.util.Date;
-/**
- * Interface for the construction of case expressions
- */
public interface CaseExpression {
- /**
- * Add a when predicate clause to a general case expression. The when
- * predicate must be followed by the corresponding then case expression that
- * specifies the result of the specific case. Clauses are evaluated in the
- * order added.
- *
- * @param pred -
- * corresponds to the evaluation condition for the specific case
- * @return CaseExpression corresponding to the case with the added when
- * clause
- */
CaseExpression when(Predicate pred);
- /**
- * Add a when clause to a simple case expression. The when case expression
- * must be followed by the corresponding then case expression that specifies
- * the result of the specific case. Clauses are evaluated in the order added
- *
- * @param when -
- * corresponds to the value against which the case operand of the
- * simple case is tested
- * @return CaseExpression corresponding to the case with the added clause
- */
CaseExpression when(Expression when);
- /**
- * Add a when clause to a simple case expression. The when case expression
- * must be followed by the corresponding then case expression that specifies
- * the result of the specific case. Clauses are evaluated in the order added
- *
- * @param when -
- * corresponds to the value against which the case operand of the
- * simple case is tested
- * @return CaseExpression corresponding to the case with the added clause
- */
CaseExpression when(Number when);
- /**
- * Add a when clause to a simple case expression. The when case expression
- * must be followed by the corresponding then case expression that specifies
- * the result of the specific case. Clauses are evaluated in the order added
- *
- * @param when -
- * corresponds to the value against which the
- * case operand of the simple case is tested
- * @return CaseExpression corresponding to the case with the added clause
- */
CaseExpression when(String when);
- /**
- * Add a when clause to a simple case expression. The when case expression
- * must be followed by the corresponding then case expression that specifies
- * the result of the specific case. Clauses are evaluated in the order added
- *
- * @param when -
- * corresponds to the value against which the case operand of the
- * simple case is tested
- * @return CaseExpression corresponding to the case with the added clause
- */
CaseExpression when(Date when);
- /**
- * Add a when clause to a simple case expression. The when case expression
- * must be followed by the corresponding then case expression that specifies
- * the result of the specific case. Clauses are evaluated in the order added
- *
- * @param when -
- * corresponds to the value against which the case operand of the
- * simple case is tested
- * @return CaseExpression corresponding to the case with the added clause
- */
CaseExpression when(Calendar when);
- /**
- * Add a when clause to a simple case expression. The when case expression
- * must be followed by the corresponding then case expression that specifies
- * the result of the specific case. Clauses are evaluated in the order added
- *
- * @param when -
- * corresponds to the value against which the case operand of the
- * simple case is tested
- * @return CaseExpression corresponding to the case with the added clause
- */
CaseExpression when(Class when);
- /**
- * Add a when clause to a simple case expression. The when case expression
- * must be followed by the corresponding then case expression that specifies
- * the result of the specific case. Clauses are evaluated in the order added
- *
- * @param when -
- * corresponds to the value against which the case operand of the
- * simple case is tested
- * @return CaseExpression corresponding to the case with the added clause
- */
CaseExpression when(Enum<?> when);
- /**
- * Add a then clause to a general or simple case expression. The then clause
- * specifies the result corresponding to the immediately preceding when.
- * Clauses are evaluated in the order added.
- *
- * @param then -
- * corresponds to the result of the case expression if the when
- * is satisfied
- * @return CaseExpression corresponding to the case with the added then
- * clause
- */
CaseExpression then(Expression then);
- /**
- * Add a then clause to a general or simple case expression. The then clause
- * specifies the result corresponding to the immediately preceding when.
- * Clauses are evaluated in the order added.
- *
- * @param then -
- * corresponds to the result of the case expression if the when
- * is satisfied
- * @return CaseExpression corresponding to the case with the added then
- * clause
- */
CaseExpression then(Number then);
- /**
- * Add a then clause to a general or simple case expression. The then clause
- * specifies the result corresponding to the immediately preceding when.
- * Clauses are evaluated in the order added.
- *
- * @param then -
- * corresponds to the result of the case expression if the when
- * is satisfied
- * @return CaseExpression corresponding to the case with the added then
- * clause
- */
CaseExpression then(String then);
- /**
- * Add a then clause to a general or simple case expression. The then clause
- * specifies the result corresponding to the immediately preceding when.
- * Clauses are evaluated in the order added.
- *
- * @param then -
- * corresponds to the result of the case expression if the when
- * is satisfied
- * @return CaseExpression corresponding to the case with the added then
- * clause
- */
CaseExpression then(Date then);
- /**
- * Add a then clause to a general or simple case expression. The then clause
- * specifies the result corresponding to the immediately preceding when.
- * Clauses are evaluated in the order added.
- *
- * @param then -
- * corresponds to the result of the case expression if the when
- * is satisfied
- * @return CaseExpression corresponding to the case with the added then
- * clause
- */
CaseExpression then(Calendar then);
- /**
- * Add a then clause to a general or simple case expression. The then clause
- * specifies the result corresponding to the immediately preceding when.
- * Clauses are evaluated in the order added.
- *
- * @param then -
- * corresponds to the result of the case expression if the when
- * is satisfied
- * @return CaseExpression corresponding to the case with the added then
- * clause
- */
CaseExpression then(Class then);
- /**
- * Add a then clause to a general or simple case expression. The then clause
- * specifies the result corresponding to the immediately preceding when.
- * Clauses are evaluated in the order added.
- *
- * @param then -
- * corresponds to the result of the case expression if the when
- * is satisfied
- * @return CaseExpression corresponding to the case with the added then
- * clause
- */
CaseExpression then(Enum<?> then);
- /**
- * Add else to a case expression. A case expression must have an else
- * clause.
- *
- * @param arg -
- * corresponds to the result of the case expression if the when
- * condition is not satisfied
- * @return Expression corresponding to the case expression with the added
- * clause
- */
Expression elseCase(Expression arg);
- /**
- * Add else to a case expression. A case expression must have an else
- * clause.
- *
- * @param arg -
- * corresponds to the result of the case expression if the when
- * condition is not satisfied
- * @return Expression corresponding to the case expression with the added
- * clause
- */
Expression elseCase(String arg);
- /**
- * Add else to a case expression. A case expression must have an else
- * clause.
- *
- * @param arg -
- * corresponds to the result of the case expression if the when
- * condition is not satisfied
- * @return Expression corresponding to the case expression with the added
- * clause
- */
Expression elseCase(Number arg);
- /**
- * Add else to a case expression. A case expression must have an else
- * clause.
- *
- * @param arg -
- * corresponds to the result of the case expression if the when
- * condition is not satisfied
- * @return Expression corresponding to the case expression with the added
- * clause
- */
Expression elseCase(Date arg);
- /**
- * Add else to a case expression. A case expression must have an else
- * clause.
- *
- * @param arg -
- * corresponds to the result of the case expression if the when
- * condition is not satisfied
- * @return Expression corresponding to the case expression with the added
- * clause
- */
Expression elseCase(Calendar arg);
- /**
- * Add else to a case expression. A case expression must have an else
- * clause.
- *
- * @param arg -
- * corresponds to the result of the case expression if the when
- * condition is not satisfied
- * @return Expression corresponding to the case expression with the added
- * clause
- */
Expression elseCase(Class arg);
- /**
- * Add else to a case expression. A case expression must have an else
- * clause.
- *
- * @param arg -
- * corresponds to the result of the case expression if the when
- * condition is not satisfied
- * @return Expression corresponding to the case expression with the added
- * clause
- */
Expression elseCase(Enum<?> arg);
}
diff --git a/src/main/java/javax/persistence/DomainObject.java b/src/main/java/javax/persistence/DomainObject.java
index fb572fe..15ec57e 100644
--- a/src/main/java/javax/persistence/DomainObject.java
+++ b/src/main/java/javax/persistence/DomainObject.java
@@ -24,106 +24,20 @@
//
package javax.persistence;
-/**
- * Domain objects define the domain over which a query operates. A domain object
- * plays a role analogous to that of a Java Persistence query language
- * identification variable.
- */
public interface DomainObject extends PathExpression, QueryDefinition {
- /**
- * Extend the query domain by joining with a class that can be navigated to
- * or that is embedded in the class corresponding to the domain object on
- * which the method is invoked. This method is permitted to be invoked only
- * when defining the domain of the query. It must not be invoked within the
- * context of the select, where, groupBy, or having operations. The domain
- * object must correspond to a class that contains the referenced attribute.
- * The query definition is modified to include the newly joined domain
- * object.
- *
- * @param attribute -
- * name of the attribute that references the target of the join
- * @return the new DomainObject that is added for the target of the join
- */
DomainObject join(String attribute);
- /**
- * Extend the query domain by left outer joining with a class that can be
- * navigated to or that is embedded in the class corresponding to the domain
- * object on which the method is invoked. This method is permitted to be
- * invoked only when defining the domain of the query. It must not be
- * invoked within the context of the select, where, groupBy, or having
- * operations. The domain object must correspond to a class that contains
- * the referenced attribute. The query definition is modified to include the
- * newly joined domain object.
- *
- * @param attribute -
- * name of the attribute that references the target of the join
- * @return the new DomainObject that is added for the target of the join
- */
DomainObject leftJoin(String attribute);
- /**
- * Specify that the association or element collection that is referenced by
- * the attribute be eagerly fetched through use of an inner join. The domain
- * object must correspond to a class that contains the referenced attribute.
- * The query is modified to include the joined domain object.
- *
- * @param attribute -
- * name of the attribute that references the target of the join
- * @return the FetchJoinObject that is added for the target of the join
- */
FetchJoinObject joinFetch(String attribute);
- /**
- * Specify that the association or element collection that is referenced by
- * the attribute be eagerly fetched through use of a left outer join. The
- * domain object must correspond to a class that contains the referenced
- * attribute. The query is modified to include the joined domain object.
- *
- * @param attribute -
- * name of the attribute that references the target of the join
- * @return the FetchJoinObject that is added for the target of the join
- */
FetchJoinObject leftJoinFetch(String attribute);
- /**
- * Return a path expression corresponding to the value of a map-valued
- * association or element collection. This method is only permitted to be
- * invoked upon a domain object that corresponds to a map-valued association
- * or element collection.
- *
- * @return PathExpression corresponding to the map value
- */
PathExpression value();
- /**
- * Return a path expression corresponding to the key of a map-valued
- * association or element collection. This method is only permitted to be
- * invoked upon a domain object that corresponds to a map-valued association
- * or element collection.
- *
- * @return PathExpression corresponding to the map key
- */
PathExpression key();
- /**
- * Return a select item corresponding to the map entry of a map-valued
- * association or element collection. This method is only permitted to be
- * invoked upon a domain object that corresponds to a map-valued association
- * or element collection.
- *
- * @return SelectItem corresponding to the map entry
- */
SelectItem entry();
- /**
- * Return an expression that corresponds to the index. of the domain object
- * in the referenced association or element collection. This method is only
- * permitted to be invoked upon a domain object that corresponds to a
- * multi-valued association or element collection for which an order column
- * has been defined.
- *
- * @return Expression denoting the index
- */
Expression index();
}
diff --git a/src/main/java/javax/persistence/EntityManager.java b/src/main/java/javax/persistence/EntityManager.java
index ad41ae0..2952f68 100644
--- a/src/main/java/javax/persistence/EntityManager.java
+++ b/src/main/java/javax/persistence/EntityManager.java
@@ -28,595 +28,84 @@
import java.util.Set;
/**
- * Interface used to interact with the persistence context.
- *
* @version $Rev$ $Date$
*/
public interface EntityManager {
- /**
- * Make an instance managed and persistent.
- *
- * @param entity
- * @throws EntityExistsException 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
- * @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> T merge(T entity);
- /**
- * Remove the entity instance.
- *
- * @param entity
- * @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
- * @param primaryKey
- * @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 entitys primary key or
- * is null
- */
public <T> T find(Class<T> entityClass, Object primaryKey);
- /**
- * 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
- * @param primaryKey
- * @param lockMode
- * @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 set
- * @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 <T> T find(Class<T> entityClass, Object primaryKey,
LockModeType lockMode);
- /**
- * Find by primary key and lock, using 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
- * @param primaryKey
- * @param lockMode
- * @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 set
- * @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 <T> T find(Class<T> entityClass, Object primaryKey,
LockModeType lockMode,
Map<String, Object> 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
- * @param 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 entitys primary key or
- * is null
- * @throws EntityNotFoundException if the entity state
- * cannot be accessed
- */
public <T> T getReference(Class<T> 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
- */
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
- * @param lockMode
- * @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
- * @param lockMode
- * @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
- */
public void lock(Object entity, LockModeType lockMode,
Map<String, Object> properties);
- /**
- * Refresh the state of the instance from the database,
- * overwriting changes made to the entity, if any.
- *
- * @param entity
- * @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,
- * 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
- * @param lockMode
- * @throws IllegalArgumentException if the instance is not
- * an entity or the entity is not managed
- * @throws TransactionRequiredException if there is no
- * transaction
- * @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
- */
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
- * @param lockMode
- * @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
- * @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
- */
public void refresh(Object entity, LockModeType lockMode,
Map<String, Object> 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.
- *
- * @param entity
- * @throws IllegalArgumentException if the instance is not an
- * entity
- */
public void clear(Object entity);
- // Open Issue: Alternative names for this method and the corresponding cascade option.
- /**
- * Check if the instance is a managed entity instance belonging
- * to the current persistence context.
- *
- * @param entity
- * @return
- * @throws IllegalArgumentException if not an entity
- */
public boolean contains(Object entity);
- /**
- * Get the current lock mode for the entity instance.
- *
- * @param entity
- * @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
- */
public LockModeType getLockMode(Object entity);
- /**
- * Get the properties and associated values that are in effect
- * for the entity manager. Changing the contents of the map does
- * not change the configuration in effect.
- */
public Map<String, Object> getProperties();
- /**
- * Get the names of the properties that are supported for use
- * with the entity manager.
- * These correspond to properties and hints that may be passed
- * to the methods of the EntityManager interface that take a
- * properties argument or used with the PersistenceContext
- * annotation. These properties include all standard entity
- * manager hints and properties as well as vendor-specific ones
- * supported by the provider. These properties may or may not
- * currently be in effect.
- *
- * @return property names
- */
public Set<String> getSupportedProperties();
- /**
- * 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 Query for executing a
- * criteria query.
- *
- * @param qdef a Criteria API query definition object
- * @return the new query instance
- * @throws IllegalArgumentException if the query definition is
- * found to be invalid
- */
public Query createQuery(QueryDefinition qdef);
- /**
- * 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 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);
- /**
- * Indicate to the EntityManager that a JTA transaction is
- * active. This method should be called on a JTA application
- * managed EntityManager 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();
- /**
- * 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.
- */
public <T> T unwrap(Class<T> 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.
- */
public Object getDelegate();
- /**
- * Close an application-managed EntityManager.
- * After the close method has been invoked, all methods
- * on the EntityManager instance and any Query objects obtained
- * from it will throw the IllegalStateException except
- * for getProperties, getSupportedProperties, getTransaction,
- * and isOpen (which will return false).
- * If this method is called when the EntityManager is
- * associated with an active transaction, the persistence
- * context remains managed until the transaction completes.
- *
- * @throws IllegalStateException if the EntityManager
- * is container-managed.
- */
public void close();
- /**
- * Determine whether the EntityManager is open.
- *
- * @return true until the EntityManager has been closed.
- */
public boolean isOpen();
- /**
- * Return the resource-level transaction object.
- * The EntityTransaction instance may be used serially to
- * begin and commit multiple transactions.
- *
- * @return EntityTransaction instance
- * @throws IllegalStateException if invoked on a JTA
- * EntityManager.
- */
public EntityTransaction getTransaction();
- /**
- * Return the entity manager factory for the entity manager.
- *
- * @return EntityManagerFactory instance
- * @throws IllegalStateException if the entity manager has
- * been closed.
- */
public EntityManagerFactory getEntityManagerFactory();
- /**
- * Return an instance of QueryBuilder for the creation of
- * Criteria API QueryDefinition objects.
- *
- * @return QueryBuilder instance
- * @throws IllegalStateException if the entity manager has
- * been closed.
- */
public QueryBuilder getQueryBuilder();
}
diff --git a/src/main/java/javax/persistence/EntityManagerFactory.java b/src/main/java/javax/persistence/EntityManagerFactory.java
index 4d0fc4f..cb8a868 100644
--- a/src/main/java/javax/persistence/EntityManagerFactory.java
+++ b/src/main/java/javax/persistence/EntityManagerFactory.java
@@ -28,94 +28,24 @@
import java.util.Set;
/**
- * Interface used to interact with the entity manager factory
- * for the persistence unit.
*
* @version $Rev$ $Date$
*/
public interface EntityManagerFactory {
- /**
- * Create a new EntityManager.
- * This method returns a new EntityManager instance each time
- * it is invoked.
- * The isOpen method will return true on the returned instance.
- *
- * @throws IllegalStateException if the entity manager factory
- * has been closed.
- */
public EntityManager createEntityManager();
- /**
- * Create a new 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.
- *
- * @throws IllegalStateException if the entity manager factory
- * has been closed.
- */
public EntityManager createEntityManager(Map map);
- /**
- * Return an instance of QueryBuilder for the creation of
- * Criteria API QueryDefinition objects.
- *
- * @return QueryBuilder instance
- * @throws IllegalStateException if the entity manager factory
- * has been closed.
- */
public QueryBuilder getQueryBuilder();
- /**
- * Close the factory, releasing any resources that it holds.
- * After a factory instance is closed, all methods invoked on
- * it will throw an 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();
- /**
- * Indicates whether the factory is open. Returns true
- * until the factory has been closed.
- */
public boolean isOpen();
- /**
- * 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
- */
public Map getProperties();
- /**
- * Get the names of the properties that are supported for use
- * with the entity manager factory. These correspond to
- * properties that may be passed to the methods of the
- * EntityManagerFactory interface that take a properties
- * argument. These include all standard properties as well as
- * vendor-specific properties supported by the provider. These
- * properties may or may not currently be in effect.
- *
- * @return properties and hints
- */
public Set<String> getSupportedProperties();
- /**
- * 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.
- */
public Cache getCache();
}
diff --git a/src/main/java/javax/persistence/Expression.java b/src/main/java/javax/persistence/Expression.java
index 05bd2bb..1db0a4d 100644
--- a/src/main/java/javax/persistence/Expression.java
+++ b/src/main/java/javax/persistence/Expression.java
@@ -24,507 +24,93 @@
//
package javax.persistence;
-/**
- * Instances of this interface can be used either as select list items or as
- * predicate operands.
- */
public interface Expression extends SelectItem, PredicateOperand {
- /*
- * Conditional predicates over expression items
- */
- /**
- * Create a predicate for testing whether the expression is a member of the
- * association or element collection denoted by the path expression. The
- * argument must correspond to a collection-valued association or element
- * collection of like type.
- *
- * @param arg -
- * a path expression that specifies a collection-valued
- * association or an element collection
- * @return conditional predicate
- */
+
Predicate member(PathExpression arg);
- /**
- * Create a predicate for testing whether the value of the expression is
- * null.
- *
- * @return conditional predicate
- */
Predicate isNull();
- /**
- * Create a predicate for testing whether the expression value is a member
- * of the argument list.
- *
- * @param strings
- * @return conditional predicate
- */
Predicate in(String... strings);
- /**
- * Create a predicate for testing whether the expression value is a member
- * of the argument list.
- *
- * @param nums
- * @return conditional predicate
- */
Predicate in(Number... nums);
- /**
- * Create a predicate for testing whether the expression value is a member
- * of the argument list.
- *
- * @param enums
- * @return conditional predicate
- */
Predicate in(Enum<?>... enums);
- /**
- * Create a predicate for testing whether the expression value is a member
- * of the argument list.
- *
- * @param classes
- * @return conditional predicate
- */
Predicate in(Class... classes);
- /**
- * Create a predicate for testing whether the expression value is a member
- * of the argument list.
- *
- * @param params
- * @return conditional predicate
- */
Predicate in(Expression... params);
- /**
- * Create a predicate for testing whether the expression value is a member
- * of a subquery result.
- *
- * @param subquery
- * @return conditional predicate
- */
Predicate in(Subquery subquery);
- /*
- * Operations on strings
- */
- /**
- * String length This method must be invoked on an expression corresponding
- * to a string.
- *
- * @return expression denoting the length of the string.
- */
Expression length();
- /**
- * Concatenate a string with other string(s). This method must be invoked on
- * an expression corresponding to a string.
- *
- * @param str -
- * string(s)
- * @return expression denoting the concatenation of the strings, starting
- * with the string corresponding to the expression on which the
- * method was invoked.
- */
Expression concat(String... str);
- /**
- * Concatenate a string with other string(s). This method must be invoked on
- * an expression corresponding to a string.
- *
- * @param str -
- * expression(s) corresponding to string(s)
- * @return expression denoting the concatenation of the strings, starting
- * with the string corresponding to the expression on which the
- * method was invoked.
- */
Expression concat(Expression... str);
- /**
- * Extract a substring starting at specified position through to the end of
- * the string. This method must be invoked on an expression corresponding to
- * a string.
- *
- * @param start -
- * start position (1 indicates first position)
- * @return expression denoting the extracted substring
- */
Expression substring(int start);
- /**
- * Extract a substring starting at specified position through to the end of
- * the string. This method must be invoked on an expression corresponding to
- * a string.
- *
- * @param start -
- * expression denoting start position (1 indicates first
- * position)
- * @return expression denoting the extracted substring
- */
Expression substring(Expression start);
- /**
- * Extract a substring. This method must be invoked on an expression
- * corresponding to a string.
- *
- * @param start -
- * start position (1 indicates first position)
- * @param len -
- * length of the substring to be returned
- * @return expression denoting the extracted substring
- */
Expression substring(int start, int len);
- /**
- * Extract a substring. This method must be invoked on an expression
- * corresponding to a string.
- *
- * @param start -
- * start position (1 indicates first position)
- * @param len -
- * expression denoting length of the substring to return
- * @return expression denoting the extracted substring
- */
Expression substring(int start, Expression len);
- /**
- * Extract a substring. This method must be invoked on an expression
- * corresponding to a string.
- *
- * @param start -
- * expression denoting start position (1 indicates first
- * position)
- * @param len -
- * length of the substring to return
- * @return expression denoting the extracted substring
- */
Expression substring(Expression start, int len);
- /**
- * Extract a substring. This method must be invoked on an expression
- * corresponding to a string.
- *
- * @param start -
- * expression denoting start position (1 indicates first
- * position)
- * @param len -
- * expression denoting length of the substring to return
- * @return expression denoting the extracted substring
- */
Expression substring(Expression start, Expression len);
- /**
- * Convert string to lowercase. This method must be invoked on an expression
- * corresponding to a string.
- *
- * @return expression denoting the string in lowercase
- */
Expression lower();
- /**
- * Convert string to uppercase. This method must be invoked on an expression
- * corresponding to a string.
- *
- * @return expression denoting the string in uppercase
- */
Expression upper();
- /**
- * Trim leading and trailing blanks. This method must be invoked on an
- * expression corresponding to a string.
- *
- * @return expression denoting trimmed string
- */
Expression trim();
- /**
- * Trim leading, trailing blanks (or both) as specified by trim spec. This
- * method must be invoked on an expression corresponding to a string.
- *
- * @param spec -
- * trim specification
- * @return expression denoting trimmed string
- */
Expression trim(TrimSpec spec);
- /**
- * Trim leading and trailing occurrences of character from the string. This
- * method must be invoked on an expression corresponding to a string.
- *
- * @param c -
- * character to be trimmed
- * @return expression denoting trimmed string
- */
Expression trim(char c);
- /**
- * Trim occurrences of the character from leading or trailing (or both)
- * positions of the string, as specified by trim spec. This method must be
- * invoked on an expression corresponding to a string.
- *
- * @param c -
- * character to be trimmed
- * @param spec -
- * trim specification
- * @return expression denoting trimmed string
- */
Expression trim(char c, TrimSpec spec);
- /**
- * Trim leading and trailing occurrences of character specified by the
- * expression argument from the string. This method must be invoked on an
- * expression corresponding to a string.
- *
- * @param expr -
- * expression corresponding to the character to be trimmed
- * @return expression denoting trimmed string
- */
Expression trim(Expression expr);
- /**
- * Trim occurrences of the character specified by the expression argument
- * from leading or trailing (or both) positions of the string, as specified
- * by trim spec. This method must be invoked on an expression corresponding
- * to a string.
- *
- * @param expr -
- * expression corresponding to the character to be trimmed
- * @param spec -
- * trim specification
- * @return expression denoting trimmed string
- */
Expression trim(Expression expr, TrimSpec spec);
- /**
- * Locate a string contained within the string corresponding to the
- * expression on which the method was invoked. The search is started at
- * position 1 (first string position). This method must be invoked on an
- * expression corresponding to a string.
- *
- * @param str -
- * string to be located
- * @return expression denoting the first position at which the string was
- * found or expression denoting 0 if the string was not found
- */
Expression locate(String str);
- /**
- * Locate a string contained within the string corresponding to the
- * expression on which the method was invoked. The search is started at
- * position 1 (first string position). This method must be invoked on an
- * expression corresponding to a string.
- *
- * @param str -
- * expression corresponding to the string to be located
- * @return expression denoting the first position at which the string was
- * found or expression denoting 0 if the string was not found
- */
Expression locate(Expression str);
- /**
- * Locate a string contained within the string corresponding to the
- * expression on which the method was invoked, starting at a specified
- * search position. This method must be invoked on an expression
- * corresponding to a string.
- *
- * @param str -
- * string to be located
- * @param position -
- * position at which to start the search
- * @return expression denoting the first position at which the string was
- * found or expression denoting 0 if the string was not found
- */
Expression locate(String str, int position);
- /**
- * Locate a string contained within the string corresponding to the
- * expression on which the method was invoked, starting at a specified
- * search position. This method must be invoked on an expression
- * corresponding to a string.
- *
- * @param str -
- * string to be located
- * @param position -
- * expression corresponding to position at which to start the
- * search
- * @return expression denoting the first position at which the string was
- * found or expression denoting 0 if the string was not found
- */
Expression locate(String str, Expression position);
- /**
- * Locate a string contained within the string corresponding to the
- * expression on which the method was invoked, starting at a specified
- * search position. This method must be invoked on an expression
- * corresponding to a string.
- *
- * @param str -
- * expression corresponding to the string to be located
- * @param position -
- * position at which to start the search
- * @return expression denoting the first position at which the string was
- * found or expression denoting 0 if the string was not found
- */
Expression locate(Expression str, int position);
- /**
- * Locate a string contained within the string corresponding to the
- * expression on which the method was invoked, starting at a specified
- * search position. This method must be invoked on an expression
- * corresponding to a string.
- *
- * @param str -
- * expression corresponding to the string to be located
- * @param position -
- * expression corresponding to position at which to start the
- * search
- * @return expression denoting the first position at which the string was
- * found or expression denoting 0 if the string was not found
- */
Expression locate(Expression str, Expression position);
- /*
- * Arithmetic operations
- */
- /**
- * Addition. This method must be invoked on an expression corresponding to a
- * number.
- *
- * @param num -
- * number to be added
- * @return expression denoting the sum
- */
Expression plus(Number num);
- /**
- * Addition. This method must be invoked on an expression corresponding to a
- * number.
- *
- * @param expr -
- * expression corresponding to number to be added
- * @return expression denoting the sum
- */
Expression plus(Expression expr);
- /**
- * Unary minus. This method must be invoked on an expression corresponding
- * to a number.
- *
- * @return expression denoting the unary minus of the expression
- */
Expression minus();
- /**
- * Subtraction. This method must be invoked on an expression corresponding
- * to a number.
- *
- * @param num -
- * subtrahend
- * @return expression denoting the result of subtracting the argument from
- * the number corresponding to the expression on which the method
- * was invoked.
- */
Expression minus(Number num);
- /**
- * Subtraction. This method must be invoked on an expression corresponding
- * to a number.
- *
- * @param expr -
- * expression corresponding to subtrahend
- * @return expression denoting the result of subtracting the number denoted
- * by the argument from the number corresponding to the expression
- * on which the method was invoked.
- */
Expression minus(Expression expr);
- /**
- * Division. This method must be invoked on an expression corresponding to a
- * number.
- *
- * @param num -
- * divisor
- * @return expression denoting the result of dividing the number
- * corresponding to the expression on which the method was invoked
- * by the argument
- */
Expression dividedBy(Number num);
- /**
- * Division. This method must be invoked on an expression corresponding to a
- * number.
- *
- * @param expr -
- * expression corresponding to the divisor
- * @return expression denoting the result of dividing the number
- * corresponding to the expression on which the method was invoked
- * by the number denoted by the argument
- */
Expression dividedBy(Expression expr);
- /**
- * Multiplication. This method must be invoked on an expression
- * corresponding to a number.
- *
- * @param num -
- * multiplier
- * @return expression denoting the result of multiplying the argument with
- * the number corresponding to the expression on which the method
- * was invoked.
- */
Expression times(Number num);
- /**
- * Multiplication. This method must be invoked on an expression
- * corresponding to a number.
- *
- * @param expr -
- * expression corresponding to the multiplier
- * @return expression denoting the result of multiplying the number denoted
- * by the argument with the number corresponding to the expression
- * on which the method was invoked.
- */
Expression times(Expression expr);
- /**
- * Absolute value. This method must be invoked on an expression
- * corresponding to a number.
- *
- * @return expression corresponding to the absolute value
- */
Expression abs();
- /**
- * Square root. This method must be invoked on an expression corresponding
- * to a number.
- *
- * @return expression corresponding to the square root
- */
Expression sqrt();
- /**
- * Modulo operation. This must be invoked on an expression corresponding to
- * an integer value
- *
- * @param num -
- * integer divisor
- * @return expression corresponding to the integer remainder of the division
- * of the integer corresponding to the expression on which the
- * method was invoked by the argument.
- */
Expression mod(int num);
- /**
- * Modulo operation. This must be invoked on an expression corresponding to
- * an integer value
- *
- * @param expr -
- * expression corresponding to integer divisor
- * @return expression corresponding to the integer remainder of the division
- * of the integer corresponding to the expression on which the
- * method was invoked by the argument.
- */
Expression mod(Expression expr);
-}
\ No newline at end of file
+}
diff --git a/src/main/java/javax/persistence/FetchJoinObject.java b/src/main/java/javax/persistence/FetchJoinObject.java
index 707286d..088116c 100644
--- a/src/main/java/javax/persistence/FetchJoinObject.java
+++ b/src/main/java/javax/persistence/FetchJoinObject.java
@@ -24,8 +24,5 @@
//
package javax.persistence;
-/**
- * Interface used for the result of a fetch join.
- */
public interface FetchJoinObject {
}
diff --git a/src/main/java/javax/persistence/MapKeyColumn.java b/src/main/java/javax/persistence/MapKeyColumn.java
index 6310c53..f0a0e42 100644
--- a/src/main/java/javax/persistence/MapKeyColumn.java
+++ b/src/main/java/javax/persistence/MapKeyColumn.java
@@ -48,7 +48,7 @@
int length() default 255;
- int precision() default 0; // decimal precision
+ int precision() default 0;
- int scale() default 0; // decimal scale
+ int scale() default 0;
}
diff --git a/src/main/java/javax/persistence/PathExpression.java b/src/main/java/javax/persistence/PathExpression.java
index f0a71c3..8dd1a5a 100644
--- a/src/main/java/javax/persistence/PathExpression.java
+++ b/src/main/java/javax/persistence/PathExpression.java
@@ -24,99 +24,23 @@
//
package javax.persistence;
-/**
- * Interface for operations over objects reached via paths
- */
public interface PathExpression extends Expression {
- /**
- * Return a path expression corresponding to the referenced attribute. It is
- * not permitted to invoke this method on a path expression that corresponds
- * to a multi-valued association or element collection. The path expression
- * on which this method is invoked must correspond to a class containing the
- * referenced attribute.
- *
- * @param attributeName -
- * name of the referenced attribute
- * @return path expression
- */
+
PathExpression get(String attributeName);
- /**
- * Return an expression that corresponds to the type of the entity. This
- * method can only be invoked on a path expression corresponding to an
- * entity. It is not permitted to invoke this method on a path expression
- * that corresponds to a multi-valued association.
- *
- * @return expression denoting the entity's type
- */
Expression type();
- /**
- * Return an expression that corresponds to the number of elements
- * association or element collection corresponding to the path expression.
- * This method can only be invoked on a path expression that corresponds to
- * a multi-valued association or to an element collection.
- *
- * @return expression denoting the size
- */
Expression size();
- /**
- * Add a restriction that the path expression must correspond to an
- * association or element collection that is empty (has no elements). This
- * method can only be invoked on a path expression that corresponds to a
- * multi-valued association or to an element collection.
- *
- * @return predicate corresponding to the restriction
- */
Predicate isEmpty();
- /**
- * Specify that the avg operation is to be applied. The path expression must
- * correspond to an attribute of a numeric type. It is not permitted to
- * invoke this method on a path expression that corresponds to a
- * multi-valued association or element collection.
- *
- * @return the resulting aggregate
- */
Aggregate avg();
- /**
- * Specify that the max operation is to be applied. The path expression must
- * correspond to an attribute of an orderable type. It is not permitted to
- * invoke this method on a path expression that corresponds to a
- * multi-valued association or element collection.
- *
- * @return the resulting aggregate
- */
Aggregate max();
- /**
- * Specify that the min operation is to be applied. The path expression must
- * correspond to an attribute of an orderable type. It is not permitted to
- * invoke this method on a path expression that corresponds to a
- * multi-valued association or element collection.
- *
- * @return the resulting aggregate
- */
Aggregate min();
- /**
- * Specify that the count operation is to be applied. It is not permitted to
- * invoke this method on a path expression that corresponds to a
- * multi-valued association or element collection.
- *
- * @return the resulting aggregate
- */
Aggregate count();
- /**
- * Specify that the sum operation is to be applied. The path expression must
- * correspond to an attribute of a numeric type. It is not permitted to
- * invoke this method on a path expression that corresponds to a
- * multi-valued association or element collection.
- *
- * @return the resulting aggregate
- */
Aggregate sum();
-}
\ No newline at end of file
+}
diff --git a/src/main/java/javax/persistence/Predicate.java b/src/main/java/javax/persistence/Predicate.java
index c5fb351..94c53a8 100644
--- a/src/main/java/javax/persistence/Predicate.java
+++ b/src/main/java/javax/persistence/Predicate.java
@@ -24,35 +24,11 @@
//
package javax.persistence;
-/**
- * Interface used to define compound predicates.
- */
public interface Predicate {
- /**
- * Creates an AND of the predicate with the argument.
- *
- * @param predicate -
- * A simple or compound predicate
- * @return the predicate that is the AND of the original simple or compound
- * predicate and the argument.
- */
+
Predicate and(Predicate predicate);
- /**
- * Creates an OR of the predicate with the argument.
- *
- * @param predicate -
- * A simple or compound predicate
- * @return the predicate that is the OR of the original simple or compound
- * predicate and the argument.
- */
Predicate or(Predicate predicate);
- /**
- * Creates a negation of the predicate with the argument.
- *
- * @return the predicate that is the negation of the original simple or
- * compound predicate.
- */
Predicate not();
-}
\ No newline at end of file
+}
diff --git a/src/main/java/javax/persistence/PredicateOperand.java b/src/main/java/javax/persistence/PredicateOperand.java
index cb19587..28a2bcd 100644
--- a/src/main/java/javax/persistence/PredicateOperand.java
+++ b/src/main/java/javax/persistence/PredicateOperand.java
@@ -27,567 +27,115 @@
import java.util.Calendar;
import java.util.Date;
-/**
- * Interface for constructing where-clause and having-clause conditions.
- * Instances of PredicateOperand are used in constructing predicates passed to
- * the where or having methods.
- */
public interface PredicateOperand {
- /**
- * Create a predicate for testing equality with the specified argument.
- *
- * @param arg -
- * PredicateOperand instance or parameter
- * @return conditional predicate
- */
+
Predicate equal(PredicateOperand arg);
- /**
- * Create a predicate for testing equality with the specified argument.
- *
- * @param cls -
- * entity class
- * @return conditional predicate
- */
Predicate equal(Class cls);
- /**
- * Create a predicate for testing equality with the specified argument.
- *
- * @param arg -
- * numeric
- * @return conditional predicate
- */
Predicate equal(Number arg);
- /**
- * Create a predicate for testing equality with the specified argument.
- *
- * @param arg -
- * string value
- * @return conditional predicate
- */
Predicate equal(String arg);
- /**
- * Create a predicate for testing equality with the specified argument.
- *
- * @param arg -
- * boolean value
- * @return conditional predicate
- */
Predicate equal(boolean arg);
- /**
- * Create a predicate for testing equality with the specified argument.
- *
- * @param arg -
- * date
- * @return conditional predicate
- */
Predicate equal(Date arg);
- /**
- * Create a predicate for testing equality with the specified argument.
- *
- * @param arg -
- * calendar
- * @return conditional predicate
- */
Predicate equal(Calendar arg);
- /**
- * Create a predicate for testing equality with the specified argument.
- *
- * @param e -
- * enum
- * @return conditional predicate
- */
Predicate equal(Enum<?> e);
- /**
- * Create a predicate for testing inequality with the specified argument.
- *
- * @param arg -
- * PredicateOperand instance or parameter
- * @return conditional predicate
- */
Predicate notEqual(PredicateOperand arg);
- /**
- * Create a predicate for testing inequality with the specified argument.
- *
- * @param cls -
- * entity class
- * @return conditional predicate
- */
Predicate notEqual(Class cls);
- /**
- * Create a predicate for testing inequality with the specified argument.
- *
- * @param arg -
- * numberic value
- * @return conditional predicate
- */
Predicate notEqual(Number arg);
- /**
- * Create a predicate for testing inequality with the specified argument.
- *
- * @param arg -
- * string value
- * @return conditional predicate
- */
Predicate notEqual(String arg);
- /**
- * Create a predicate for testing inequality with the specified argument.
- *
- * @param arg -
- * boolean value
- * @return conditional predicate
- */
Predicate notEqual(boolean arg);
- /**
- * Create a predicate for testing inequality with the specified argument.
- *
- * @param arg -
- * date
- * @return conditional predicate
- */
Predicate notEqual(Date arg);
- /**
- * Create a predicate for testing inequality with the specified argument.
- *
- * @param arg -
- * calendar
- * @return conditional predicate
- */
Predicate notEqual(Calendar arg);
- /**
- * Create a predicate for testing inequality with the specified argument.
- *
- * @param e -
- * enum
- * @return conditional predicate
- */
Predicate notEqual(Enum<?> e);
- /**
- * Create a predicate for testing whether the PredicateOperand is greater
- * than the argument.
- *
- * @param arg -
- * PredicateOperand instance or parameter
- * @return conditional predicate
- */
Predicate greaterThan(PredicateOperand arg);
- /**
- * Create a predicate for testing whether the PredicateOperand is greater
- * than the argument.
- *
- * @param arg -
- * numeric
- * @return conditional predicate
- */
Predicate greaterThan(Number arg);
- /**
- * Create a predicate for testing whether the PredicateOperand is greater
- * than the argument.
- *
- * @param arg -
- * string
- * @return conditional predicate
- */
Predicate greaterThan(String arg);
- /**
- * Create a predicate for testing whether the PredicateOperand is greater
- * than the argument.
- *
- * @param arg -
- * date
- * @return conditional predicate
- */
Predicate greaterThan(Date arg);
- /**
- * Create a predicate for testing whether the PredicateOperand is greater
- * than the argument.
- *
- * @param arg -
- * calendar
- * @return conditional predicate
- */
Predicate greaterThan(Calendar arg);
- /**
- * Create a predicate for testing whether the PredicateOperand is greater
- * than or equal to the argument.
- *
- * @param arg -
- * PredicateOperand instance or parameter
- * @return conditional predicate
- */
Predicate greaterEqual(PredicateOperand arg);
- /**
- * Create a predicate for testing whether the PredicateOperand is greater
- * than or equal to the argument.
- *
- * @param arg -
- * numeric
- * @return conditional predicate
- */
Predicate greaterEqual(Number arg);
- /**
- * Create a predicate for testing whether the PredicateOperand is greater
- * than or equal to the argument.
- *
- * @param arg -
- * string
- * @return conditional predicate
- */
Predicate greaterEqual(String arg);
- /**
- * Create a predicate for testing whether the PredicateOperand is greater
- * than or equal to the argument.
- *
- * @param arg -
- * date
- * @return conditional predicate
- */
Predicate greaterEqual(Date arg);
- /**
- * Create a predicate for testing whether the PredicateOperand is greater
- * than or equal to the argument.
- *
- * @param arg -
- * calendar
- * @return conditional predicate
- */
Predicate greaterEqual(Calendar arg);
- /**
- * Create a predicate for testing whether the PredicateOperand is less than
- * the argument.
- *
- * @param arg -
- * PredicateOperand instance or parameter
- * @return conditional predicate
- */
Predicate lessThan(PredicateOperand arg);
- /**
- * Create a predicate for testing whether the PredicateOperand is less than
- * the argument.
- *
- * @param arg -
- * numeric
- * @return conditional predicate
- */
Predicate lessThan(Number arg);
- /**
- * Create a predicate for testing whether the PredicateOperand is less than
- * the argument.
- *
- * @param arg -
- * string
- * @return conditional predicate
- */
Predicate lessThan(String arg);
- /**
- * Create a predicate for testing whether the PredicateOperand is less than
- * the argument.
- *
- * @param arg -
- * date
- * @return conditional predicate
- */
Predicate lessThan(Date arg);
- /**
- * Create a predicate for testing whether the PredicateOperand is less than
- * the argument.
- *
- * @param arg -
- * calendar
- * @return conditional predicate
- */
Predicate lessThan(Calendar arg);
- /**
- * Create a predicate for testing whether the PredicateOperand is less than
- * or equal to the argument.
- *
- * @param arg -
- * PredicateOperand instance or parameter
- * @return conditional predicate
- */
Predicate lessEqual(PredicateOperand arg);
- /**
- * Create a predicate for testing whether the PredicateOperand is less than
- * or equal to the argument.
- *
- * @param arg -
- * numeric
- * @return conditional predicate
- */
Predicate lessEqual(Number arg);
- /**
- * Create a predicate for testing whether the PredicateOperand is less than
- * or equal to the argument.
- *
- * @param arg -
- * string
- * @return conditional predicate
- */
Predicate lessEqual(String arg);
- /**
- * Create a predicate for testing whether the PredicateOperand is less than
- * or equal to the argument.
- *
- * @param arg -
- * date
- * @return conditional predicate
- */
Predicate lessEqual(Date arg);
- /**
- * Create a predicate for testing whether the PredicateOperand is less than
- * or equal to the argument.
- *
- * @param arg -
- * calendar
- * @return conditional predicate
- */
Predicate lessEqual(Calendar arg);
- /**
- * Create a predicate for testing whether the PredicateOperand lies between
- * (inclusive) the two arguments.
- *
- * @param arg1 -
- * PredicateOperand instance or parameter
- * @param arg2 -
- * PredicateOperand instance or parameter
- * @return conditional predicate
- */
Predicate between(PredicateOperand arg1, PredicateOperand arg2);
- /**
- * Create a predicate for testing whether the PredicateOperand lies between
- * (inclusive) the two arguments.
- *
- * @param arg1 -
- * PredicateOperand instance or parameter
- * @param arg2 -
- * numeric
- * @return conditional predicate
- */
Predicate between(PredicateOperand arg1, Number arg2);
- /**
- * Create a predicate for testing whether the PredicateOperand lies between
- * (inclusive) the two arguments.
- *
- * @param arg1 -
- * numeric
- * @param arg2 -
- * PredicateOperand instance or parameter
- * @return conditional predicate
- */
Predicate between(Number arg1, PredicateOperand arg2);
- /**
- * Create a predicate for testing whether the PredicateOperand lies between
- * (inclusive) the two arguments.
- *
- * @param arg1 -
- * numeric
- * @param arg2 -
- * numeric
- * @return conditional predicate
- */
Predicate between(Number arg1, Number arg2);
- /**
- * Create a predicate for testing whether the PredicateOperand lies between
- * (inclusive) the two arguments.
- *
- * @param arg1 -
- * PredicateOperand instance or parameter
- * @param arg2 -
- * string
- * @return conditional predicate
- */
Predicate between(PredicateOperand arg1, String arg2);
- /**
- * Create a predicate for testing whether the PredicateOperand lies between
- * (inclusive) the two arguments.
- *
- * @param arg1 -
- * string
- * @param arg2 -
- * PredicateOperand instance or parameter
- * @return conditional predicate
- */
Predicate between(String arg1, PredicateOperand arg2);
- /**
- * Create a predicate for testing whether the PredicateOperand lies between
- * (inclusive) the two arguments.
- *
- * @param arg1 -
- * string
- * @param arg2 -
- * string
- * @return conditional predicate
- */
Predicate between(String arg1, String arg2);
- /**
- * Create a predicate for testing whether the PredicateOperand lies between
- * (inclusive) the two arguments.
- *
- * @param arg1 -
- * PredicateOperand instance or parameter
- * @param arg2 -
- * date
- * @return conditional predicate
- */
Predicate between(PredicateOperand arg1, Date arg2);
- /**
- * Create a predicate for testing whether the PredicateOperand lies between
- * (inclusive) the two arguments.
- *
- * @param arg1 -
- * date
- * @param arg2 -
- * PredicateOperand instance or parameter
- * @return conditional predicate
- */
Predicate between(Date arg1, PredicateOperand arg2);
- /**
- * Create a predicate for testing whether the PredicateOperand lies between
- * (inclusive) the two arguments.
- *
- * @param arg1 -
- * date
- * @param arg2 -
- * date
- * @return conditional predicate
- */
Predicate between(Date arg1, Date arg2);
- /**
- * Create a predicate for testing whether the PredicateOperand lies between
- * (inclusive) the two arguments.
- *
- * @param arg1 -
- * PredicateOperand instance or parameter
- * @param arg2 -
- * calendar
- * @return conditional predicate
- */
Predicate between(PredicateOperand arg1, Calendar arg2);
- /**
- * Create a predicate for testing whether the PredicateOperand lies between
- * (inclusive) the two arguments.
- *
- * @param arg1 -
- * calendar
- * @param arg2 -
- * PredicateOperand instance or parameter
- * @return conditional predicate
- */
Predicate between(Calendar arg1, PredicateOperand arg2);
- /**
- * Create a predicate for testing whether the PredicateOperand lies between
- * (inclusive) the two arguments.
- *
- * @param arg1 -
- * calendar
- * @param arg2 -
- * calendar
- * @return conditional predicate
- */
Predicate between(Calendar arg1, Calendar arg2);
- /**
- * Create a predicate for testing whether the PredicateOperand satisfies the
- * given pattern.
- *
- * @param pattern
- * @return conditional predicate
- */
Predicate like(PredicateOperand pattern);
- /**
- * Create a predicate for testing whether the PredicateOperand satisfies the
- * given pattern.
- *
- * @param pattern
- * @param escapeChar
- * @return conditional predicate
- */
Predicate like(PredicateOperand pattern, PredicateOperand escapeChar);
- /**
- * Create a predicate for testing whether the PredicateOperand satisfies the
- * given pattern.
- *
- * @param pattern
- * @param escapeChar
- * @return conditional predicate
- */
Predicate like(PredicateOperand pattern, char escapeChar);
- /**
- * Create a predicate for testing whether the PredicateOperand satisfies the
- * given pattern.
- *
- * @param pattern
- * @return conditional predicate
- */
Predicate like(String pattern);
- /**
- * Create a predicate for testing whether the PredicateOperand satisfies the
- * given pattern.
- *
- * @param pattern
- * @param escapeChar
- * @return conditional predicate
- */
Predicate like(String pattern, PredicateOperand escapeChar);
- /**
- * Create a predicate for testing whether the PredicateOperand satisfies the
- * given pattern.
- *
- * @param pattern
- * @param escapeChar
- * @return conditional predicate
- */
Predicate like(String pattern, char escapeChar);
}
diff --git a/src/main/java/javax/persistence/Query.java b/src/main/java/javax/persistence/Query.java
index cd30e92..88fedc5 100644
--- a/src/main/java/javax/persistence/Query.java
+++ b/src/main/java/javax/persistence/Query.java
@@ -31,284 +31,57 @@
import java.util.Set;
/**
- * Interface used to control query execution.
- *
* @version $Rev$ $Date$
*/
public interface Query {
- /**
- * Execute a SELECT query and return the query results
- * as a List.
- *
- * @return a list of the results
- * @throws IllegalStateException if called for a Java
- * Persistence query language UPDATE or DELETE statement
- * @throws QueryTimeoutException if the query execution exceeds
- * the query timeout value set
- * @throws TransactionRequiredException if a lock mode has
- * been set and there is no transaction
- * @throws PessimisticLockException if pessimistic locking
- * fails and the transaction is rolled back
- * @throws LockTimeoutException if pessimistic locking
- * fails and only the statement is rolled back
- */
public List getResultList();
- /**
- * Execute a SELECT query that returns a single result.
- *
- * @return the result
- * @throws NoResultException if there is no result
- * @throws NonUniqueResultException if more than one result
- * @throws IllegalStateException if called for a Java
- * Persistence query language UPDATE or DELETE statement
- * @throws QueryTimeoutException if the query execution exceeds
- * the query timeout value set
- * @throws TransactionRequiredException if a lock mode has
- * been set and there is no transaction
- * @throws PessimisticLockException if pessimistic locking
- * fails and the transaction is rolled back
- * @throws LockTimeoutException if pessimistic locking
- * fails and only the statement is rolled back
- */
public Object getSingleResult();
- /**
- * Execute an update or delete statement.
- *
- * @return the number of entities updated or deleted
- * @throws IllegalStateException if called for a Java
- * Persistence query language SELECT statement or for
- * a criteria query
- * @throws TransactionRequiredException if there is
- * no transaction
- * @throws QueryTimeoutException if the statement execution
- * exceeds the query timeout value set
- */
public int executeUpdate();
- /**
- * Set the maximum number of results to retrieve.
- *
- * @param maxResult
- * @return the same query instance
- * @throws IllegalArgumentException if argument is negative
- */
public Query setMaxResults(int maxResult);
- /**
- * The maximum number of results the query object was set to
- * retrieve. Returns Integer.MAX_VALUE if setMaxResults was not
- * applied to the query object.
- *
- * @return maximum number of results
- */
public int getMaxResults();
- /**
- * Set the position of the first result to retrieve.
- *
- * @param start position of the first result, numbered from 0
- * @return the same query instance
- * @throws IllegalArgumentException if argument is negative
- */
public Query setFirstResult(int startPosition);
- /**
- * The position of the first result the query object was set to
- * retrieve. Returns 0 if setFirstResult was not applied to the
- * query object.
- *
- * @return position of first result
- */
public int getFirstResult();
- /**
- * Set a query hint.
- * If a vendor-specific 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 hintName
- * @param value
- * @return the same query instance
- * <p/>
- * * @throws IllegalArgumentException if the second argument is not
- * valid for the implementation
- */
public Query setHint(String hintName, Object value);
- /**
- * Get the hints and associated values that are in effect for
- * the query instance.
- *
- * @return query hints
- */
public Map<String, Object> getHints();
- /**
- * Get the names of the hints that are supported for query
- * objects. These hints correspond to hints that may be passed
- * to the methods of the Query interface that take hints as
- * arguments or used with the NamedQuery and NamedNativeQuery
- * annotations. These include all standard query hints as well as
- * vendor-specific hints supported by the provider. These hints
- * may or may not currently be in effect.
- *
- * @return hints
- */
public Set<String> getSupportedHints();
- /**
- * Bind an argument to a named parameter.
- *
- * @param name the parameter name
- * @param value
- * @return the same query instance
- * @throws IllegalArgumentException if parameter name does not
- * correspond to parameter in query string
- * or argument is of incorrect type
- */
public Query setParameter(String name, Object value);
- /**
- * Bind an instance of java.util.Date to a named parameter.
- *
- * @param name
- * @param value
- * @param temporalType
- * @return the same query instance
- * @throws IllegalArgumentException if parameter name does not
- * correspond to parameter in query string
- */
public Query setParameter(String name, Date value,
TemporalType temporalType);
- /**
- * Bind an instance of java.util.Calendar to a named parameter.
- *
- * @param name
- * @param value
- * @param temporalType
- * @return the same query instance
- * @throws IllegalArgumentException if parameter name does not
- * correspond to parameter in query string
- */
public Query setParameter(String name, Calendar value,
TemporalType temporalType);
- /**
- * Bind an argument to a positional parameter.
- *
- * @param position
- * @param value
- * @return the same query instance
- * @throws IllegalArgumentException if position does not
- * correspond to positional parameter of query
- * or argument is of incorrect type
- */
public Query setParameter(int position, Object value);
- /**
- * Bind an instance of java.util.Date to a positional parameter.
- *
- * @param position
- * @param value
- * @param temporalType
- * @return the same query instance
- * @throws IllegalArgumentException if position does not
- * correspond to positional parameter of query
- */
public Query setParameter(int position, Date value,
TemporalType temporalType);
- /**
- * Bind an instance of java.util.Calendar to a positional
- * parameter.
- *
- * @param position
- * @param value
- * @param temporalType
- * @return the same query instance
- * @throws IllegalArgumentException if position does not
- * correspond to positional parameter of query
- */
public Query setParameter(int position, Calendar value,
TemporalType temporalType);
- /**
- * Get the parameters names and associated values of the
- * parameters that are bound for the query instance.
- * Returns empty map if no parameters have been bound
- * or if the query does not use named parameters.
- *
- * @return named parameters
- */
public Map<String, Object> getNamedParameters();
- /**
- * Get the values of the positional parameters
- * that are bound for the query instance.
- * Positional positions are listed in order of position.
- * Returns empty list if no parameters have been bound
- * or if the query does not use positional parameters.
- *
- * @return positional parameters
- */
public List getPositionalParameters();
- /**
- * Set the flush mode type to be used for the query execution.
- * The flush mode type applies to the query regardless of the
- * flush mode type in use for the entity manager.
- *
- * @param flushMode
- */
public Query setFlushMode(FlushModeType flushMode);
- /**
- * The flush mode in effect for the query execution. If a flush
- * mode has not been set for the query object, returns the flush
- * mode in effect for the entity manager.
- *
- * @return flush mode
- */
public FlushModeType getFlushMode();
- /**
- * Set the lock mode type to be used for the query execution.
- *
- * @param lockMode
- * @throws IllegalStateException if not a Java Persistence
- * query language SELECT query or Criteria API query
- */
public Query setLockMode(LockModeType lockMode);
- /**
- * Get the current lock mode for the query.
- *
- * @return lock mode
- * @throws IllegalStateException if not a Java Persistence
- * query language SELECT query or Criteria API query
- */
public LockModeType getLockMode();
- /**
- * Return an object of the specified type to allow access to the
- * provider-specific API. If the provider's Query 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 Query implementation class
- * or an interface that it implements.
- * @return an instance of the specified class
- * @throws PersistenceException if the provider does not support
- * the call.
- */
public <T> T unwrap(Class<T> cls);
}
diff --git a/src/main/java/javax/persistence/QueryBuilder.java b/src/main/java/javax/persistence/QueryBuilder.java
index 58d9365..12911aa 100644
--- a/src/main/java/javax/persistence/QueryBuilder.java
+++ b/src/main/java/javax/persistence/QueryBuilder.java
@@ -24,39 +24,11 @@
//
package javax.persistence;
-/**
- * Factory interface for query definition objects
- */
public interface QueryBuilder {
- /**
- * Create an uninitialized query definition object.
- *
- * @return query definition instance
- */
+
QueryDefinition createQueryDefinition();
- /**
- * Create a query definition object with the given root. The root must be an
- * entity class.
- *
- * @param cls -
- * an entity class
- * @return root domain object
- */
DomainObject createQueryDefinition(Class root);
- /**
- * Create a query definition object whose root is derived from a domain
- * object of the containing query. Provides support for correlated
- * subqueries. Joins against the resulting domain object do not affect the
- * query domain of the containing query. The path expression must correspond
- * to an entity class. The path expression must not be a domain object of
- * the containing query.
- *
- * @param path -
- * path expression corresponding to the domain object used to
- * derive the subquery root.
- * @return the subquery DomainObject
- */
DomainObject createSubqueryDefinition(PathExpression path);
}
diff --git a/src/main/java/javax/persistence/QueryDefinition.java b/src/main/java/javax/persistence/QueryDefinition.java
index 8fb9d50..d4e8bc0 100644
--- a/src/main/java/javax/persistence/QueryDefinition.java
+++ b/src/main/java/javax/persistence/QueryDefinition.java
@@ -28,534 +28,105 @@
import java.util.Date;
import java.util.List;
-/**
- * Interface for construction of query definitions
- */
public interface QueryDefinition extends Subquery {
- /**
- * Add a query root corresponding to the given entity, forming a cartesian
- * product with any existing roots. The domain object that is returned is
- * bound as a component of the given query. The argument must be an entity
- * class.
- *
- * @param cls -
- * an entity class
- * @return DomainObject corresponding to the specified entity class.
- */
+
DomainObject addRoot(Class cls);
- /**
- * Add a root derived from a domain object of the containing query
- * definition to a query definition used as a subquery. Provides support for
- * correlated subqueries. Joins against the resulting domain object do not
- * affect the query domain of the containing query. The path expression must
- * correspond to an entity class. The path expression must not be a domain
- * object of the containing query.
- *
- * @param path -
- * path expression corresponding to the domain object used to
- * derive the subquery root.
- * @return the subquery DomainObject
- */
DomainObject addSubqueryRoot(PathExpression path);
- /**
- * Specify the objects / values to be returned. Replaces the previous select
- * list, if any. If no select items are specified and there is only one
- * query root, the root entity is assumed to be the result.
- *
- * @param selectItems -
- * one or more SelectItem instances
- * @return the modified query definition instance
- */
QueryDefinition select(SelectItem... selectItems);
- /**
- * Specify the objects / values to be returned. Replaces the previous select
- * list, if any. If no select items are specified and there is only one
- * query root, the root entity is assumed to be the result.
- *
- * @param selectItemList -
- * a list containing one or more SelectItem instances
- * @return the modified query definition instance
- */
QueryDefinition select(List<SelectItem> selectItemList);
- /**
- * Specify the objects / values to be returned. Duplicate results will be
- * eliminated. Replaces the previous select list, if any. If no select items
- * are specified and there is only one query root, the root entity is
- * assumed to be the result.
- *
- * @param selectItems -
- * one or more SelectItem instances
- * @return the modified query definition instance
- */
QueryDefinition selectDistinct(SelectItem... selectItems);
- /**
- * Specify the objects / values to be returned. Duplicate results will be
- * eliminated. Replaces the previous select list, if any. If no select items
- * are specified, and there is only one query root, the root entity is
- * assumed to be the result. is assumed to be the result.
- *
- * @param selectItemList -
- * a list containing one or more SelectItem instances
- * @return the modified query definition instance
- */
QueryDefinition selectDistinct(List<SelectItem> selectItemList);
- /**
- * Modifies the query definition to restrict the result of the query
- * according to the specified predicate. Replaces the previously added
- * restriction(s), if any.
- *
- * @param predicate -
- * a simple or compound conditional predicate
- * @return the modified QueryDefinition instance
- */
QueryDefinition where(Predicate predicate);
- /**
- * Specify the items of the select list that are used in ordering the query
- * results. Replaces the previous order-by list, if any.
- *
- * @param orderByItems -
- * one or more OrderByItem instances
- * @return the modified QueryDefinition instance
- */
QueryDefinition orderBy(OrderByItem... orderByItems);
- /**
- * Specify the items of the select list that are used in ordering the query
- * results. Replaces the previous order-by list, if any.
- *
- * @param orderByItemList -
- * a list containing one or more OrderByItem instances
- * @return the modified QueryDefinition instance
- */
QueryDefinition orderBy(List<OrderByItem> orderByItemList);
- /**
- * Specify the items that are used to form groups over the query results.
- * Replaces the previous group-by list, if any.
- *
- * @param pathExprs
- * @return the modified QueryDefinition instance
- */
QueryDefinition groupBy(PathExpression... pathExprs);
- /**
- * Specify the items that are used to form groups over the query results.
- * Replaces the previous group-by list, if any.
- *
- * @param pathExprList
- * @return the modified QueryDefinition instance
- */
QueryDefinition groupBy(List<PathExpression> pathExprList);
- /**
- * Specify the restrictions over the groups of a query. Replaces the
- * previous having restriction(s), if any.
- *
- * @param predicate
- * @return the modified QueryDefinition Instance
- */
QueryDefinition having(Predicate predicate);
- /**
- * Specify that a constructor for the given class is to be applied to the
- * corresponding query results after the query is executed. The class must
- * have a constructor that accepts the Java argument types corresponding to
- * the given select items.
- *
- * @param cls -
- * a class with the correponding constructor
- * @param args -
- * select items that correspond to result types that are valid as
- * arguments to the constructor
- * @result SelectItem instance representing the constructor
- */
SelectItem newInstance(Class cls, SelectItem... args);
- /**
- * Use the query definition instance as a subquery in an exists predicate.
- *
- * @return the resulting predicate
- */
Predicate exists();
- /**
- * Use the query definition object in a subquery in an all expression.
- *
- * @return the resulting Subquery
- */
Subquery all();
- /**
- * Use the query definition object in a subquery in an any expression.
- *
- * @return the resulting Subquery
- */
Subquery any();
- /**
- * Use the query definition object in a subquery in a some expression.
- *
- * @return the resulting Subquery
- */
Subquery some();
- /**
- * Create an empty general case expression. A general case expression is of
- * the form:
- * <p/>
- * generalCase() .when(conditional-predicate).then(scalar-expression)
- * .when(conditional-predicate).then(scalar-expression) ...
- * .elseCase(scalar-expression)
- *
- * @return empty general case expression
- */
CaseExpression generalCase();
- /**
- * Create a simple case expression with the given case operand. A simple
- * case expression is of the form:
- * <p/>
- * simpleCase(case-operand) .when(scalar-expression).then(scalar-expression)
- * .when(scalar-expression).then(scalar-expression) ...
- * .elseCase(scalar-expression)
- *
- * @param caseOperand -
- * expression used for testing against the when scalar
- * expressions
- * @return case expression with the given case operand
- */
CaseExpression simpleCase(Expression caseOperand);
- /**
- * Create a simple case expression with the given case operand. A simple
- * case expression is of the form:
- * <p/>
- * simpleCase(case-operand) .when(scalar-expression).then(scalar-expression)
- * .when(scalar-expression).then(scalar-expression) ...
- * .elseCase(scalar-expression)
- *
- * @param caseOperand -
- * numeric value used for testing against the when scalar
- * expressions
- * @return case expression with the given case operand
- */
CaseExpression simpleCase(Number caseOperand);
- /**
- * Create a simple case expression with the given case operand. A simple
- * case expression is of the form:
- * <p/>
- * simpleCase(case-operand) .when(scalar-expression).then(scalar-expression)
- * .when(scalar-expression).then(scalar-expression) ...
- * .elseCase(scalar-expression)
- *
- * @param caseOperand -
- * value used for testing against the when scalar expressions
- * @return case expression with the given case operand
- */
CaseExpression simpleCase(String caseOperand);
- /**
- * Create a simple case expression with the given case operand. A simple
- * case expression is of the form:
- * <p/>
- * simpleCase(case-operand) .when(scalar-expression).then(scalar-expression)
- * .when(scalar-expression).then(scalar-expression) ...
- * .elseCase(scalar-expression)
- *
- * @param caseOperand -
- * value used for testing against the when scalar expressions
- * @return case expression with the given case operand
- */
CaseExpression simpleCase(Date caseOperand);
- /**
- * Create a simple case expression with the given case operand. A simple
- * case expression is of the form:
- * <p/>
- * simpleCase(case-operand) .when(scalar-expression).then(scalar-expression)
- * .when(scalar-expression).then(scalar-expression) ...
- * .elseCase(scalar-expression)
- *
- * @param caseOperand -
- * value used for testing against the when scalar expressions
- * @return case expression with the given case operand
- */
CaseExpression simpleCase(Calendar caseOperand);
- /**
- * Create a simple case expression with the given case operand. A simple
- * case expression is of the form:
- * <p/>
- * simpleCase(case-operand) .when(scalar-expression).then(scalar-expression)
- * .when(scalar-expression).then(scalar-expression) ...
- * .elseCase(scalar-expression)
- *
- * @param caseOperand -
- * value used for testing against the when scalar expressions
- * @return case expression with the given case operand
- */
CaseExpression simpleCase(Class caseOperand);
- /**
- * Create a simple case expression with the given case operand. A simple
- * case expression is of the form:
- * <p/>
- * simpleCase(case-operand) .when(scalar-expression).then(scalar-expression)
- * .when(scalar-expression).then(scalar-expression) ...
- * .elseCase(scalar-expression)
- *
- * @param caseOperand -
- * value used for testing against the when scalar expressions
- * @return case expression with the given case operand
- */
CaseExpression simpleCase(Enum<?> caseOperand);
- /**
- * coalesce This is equivalent to a case expression that returns null if all
- * its arguments evaluate to null, and the value of its first non-null
- * argument otherwise.
- *
- * @param exp -
- * expressions to be used for testing against null
- * @return Expression corresponding to the given coalesce expression
- */
Expression coalesce(Expression... exp);
- /**
- * coalesce This is equivalent to a case expression that returns null if all
- * its arguments evaluate to null, and the value of its first non-null
- * argument otherwise.
- *
- * @param exp -
- * expressions to be used for testing against null
- * @return Expression corresponding to the given coalesce expression
- */
Expression coalesce(String... exp);
- /**
- * coalesce This is equivalent to a case expression that returns null if all
- * its arguments evaluate to null, and the value of its first non-null
- * argument otherwise.
- *
- * @param exp -
- * expressions to be used for testing against null
- * @return Expression corresponding to the given coalesce expression
- */
Expression coalesce(Date... exp);
- /**
- * coalesce This is equivalent to a case expression that returns null if all
- * its arguments evaluate to null, and the value of its first non-null
- * argument otherwise.
- *
- * @param exp -
- * expressions to be used for testing against null
- * @return Expression corresponding to the given coalesce expression
- */
Expression coalesce(Calendar... exp);
- /**
- * nullif This is equivalent to a case expression that tests whether its
- * arguments are equal, returning null if they are and the value of the
- * first expression if they are not.
- *
- * @param exp1
- * @param exp2
- * @return Expression corresponding to the given nullif expression
- */
Expression nullif(Expression exp1, Expression exp2);
- /**
- * nullif This is equivalent to a case expression that tests whether its
- * arguments are equal, returning null if they are and the value of the
- * first expression if they are not.
- *
- * @param arg1
- * @param arg2
- * @return Expression corresponding to the given nullif expression
- */
Expression nullif(Number arg1, Number arg2);
- /**
- * nullif This is equivalent to a case expression that tests whether its
- * arguments are equal, returning null if they are and the value of the
- * first expression if they are not.
- *
- * @param arg1
- * @param arg2 Criteria API Java Persistence 2.0, Public Review Draft
- * Criteria API Interfaces 10/31/08 158 JSR-317 Public Review
- * Draft Sun Microsystems, Inc.
- * @return Expression corresponding to the given nullif expression
- */
Expression nullif(String arg1, String arg2);
- /**
- * nullif This is equivalent to a case expression that tests whether its
- * arguments are equal, returning null if they are and the value of the
- * first expression if they are not.
- *
- * @param arg1
- * @param arg2
- * @return Expression corresponding to the given nullif expression
- */
Expression nullif(Date arg1, Date arg2);
- /**
- * nullif This is equivalent to a case expression that tests whether its
- * arguments are equal, returning null if they are and the value of the
- * first expression if they are not.
- *
- * @param arg1
- * @param arg2
- * @return Expression corresponding to the given nullif expression
- */
Expression nullif(Calendar arg1, Calendar arg2);
- /**
- * nullif This is equivalent to a case expression that tests whether its
- * arguments are equal, returning null if they are and the value of the
- * first expression if they are not.
- *
- * @param arg1
- * @param arg2
- * @return Expression corresponding to the given nullif expression
- */
Expression nullif(Class arg1, Class arg2);
- /**
- * nullif This is equivalent to a case expression that tests whether its
- * arguments are equal, returning null if they are and the value of the
- * first expression if they are not.
- *
- * @param arg1
- * @param arg2
- * @return Expression corresponding to the given nullif expression
- */
Expression nullif(Enum<?> arg1, Enum<?> arg2);
- /**
- * Create a predicate value from the given boolean.
- *
- * @param b boolean value
- * @return a true or false predicate
- */
Predicate predicate(boolean b);
- /**
- * Create an Expression corresponding to the current time on the database
- * server at the time of query execution.
- *
- * @return the corresponding Expression
- */
Expression currentTime();
- /**
- * Create an Expression corresponding to the current date on the database
- * server at the time of query execution.
- *
- * @return the corresponding Expression
- */
Expression currentDate();
- /**
- * Create an Expression corresponding to the current timestamp on the
- * database server at the time of query execution.
- *
- * @return the corresponding Expression
- */
Expression currentTimestamp();
- /**
- * Create an Expression corresponding to a String value.
- *
- * @param s -
- * string value
- * @return the corresponding Expression literal
- */
Expression literal(String s);
- /**
- * Create an Expression corresponding to a numeric value.
- *
- * @param n -
- * numeric value
- * @return the corresponding Expression literal
- */
Expression literal(Number n);
- /**
- * Create an Expression corresponding to a boolean value.
- *
- * @param b -
- * boolean value
- * @return the corresponding Expression literal
- */
Expression literal(boolean b);
- /**
- * Create an Expression corresponding to a Calendar value.
- *
- * @param c -
- * Calendar value
- * @return the corresponding Expression literal
- */
Expression literal(Calendar c);
- /**
- * Create an Expression corresponding to a Date value.
- *
- * @param d -
- * Date value
- * @return the corresponding Expression literal
- */
Expression literal(Date d);
- /**
- * Create an Expression corresponding to a character value.
- *
- * @param character value
- * @return the corresponding Expression literal
- */
Expression literal(char c);
- /**
- * Create an Expression corresponding to an entity class.
- *
- * @param cls -
- * entity class
- * @return the corresponding Expression literal
- */
Expression literal(Class cls);
- /**
- * Create an Expression corresponding to an enum.
- *
- * @param e -
- * enum
- * @return the corresponding Expression literal
- */
Expression literal(Enum<?> e);
- /**
- * Create an Expression corresponding to a null value.
- *
- * @return the corresponding Expression literal
- */
Expression nullLiteral();
- /**
- * Specify use of a parameter of the given name.
- *
- * @param parameter name
- * @return an Expression corresponding to a named parameter
- */
Expression param(String name);
-}
\ No newline at end of file
+}
diff --git a/src/main/java/javax/persistence/SelectItem.java b/src/main/java/javax/persistence/SelectItem.java
index 8b599e2..2dfbf9f 100644
--- a/src/main/java/javax/persistence/SelectItem.java
+++ b/src/main/java/javax/persistence/SelectItem.java
@@ -24,27 +24,9 @@
//
package javax.persistence;
-/**
- * SelectItem instances are used in specifying the query's select list.
- * <p/>
- * The methods of this interface are used to define arguments that can be passed
- * to the orderBy method for use in ordering selected items of the query result.
- */
public interface SelectItem extends OrderByItem {
- /**
- * Return an OrderByItem referencing the SelectItem and specifying ascending
- * ordering. The SelectItem must correspond to an orderable value.
- *
- * @return order-by item
- */
+
OrderByItem asc();
- /**
- * Return an OrderByItem referencing the SelectItem and specifying
- * descending ordering. The SelectItem must correspond to an orderable
- * value.
- *
- * @return order-by item
- */
OrderByItem desc();
}
diff --git a/src/main/java/javax/persistence/Subquery.java b/src/main/java/javax/persistence/Subquery.java
index 99750ae..78ee875 100644
--- a/src/main/java/javax/persistence/Subquery.java
+++ b/src/main/java/javax/persistence/Subquery.java
@@ -24,8 +24,5 @@
//
package javax.persistence;
-/**
- * Instances of this interface can be used as subqueries.
- */
public interface Subquery extends PredicateOperand {
}
diff --git a/src/main/java/javax/persistence/TrimSpec.java b/src/main/java/javax/persistence/TrimSpec.java
index f237dbf..b93d9bf 100644
--- a/src/main/java/javax/persistence/TrimSpec.java
+++ b/src/main/java/javax/persistence/TrimSpec.java
@@ -24,9 +24,6 @@
//
package javax.persistence;
-/**
- * Used to specify the trimming of strings
- */
public enum TrimSpec {
LEADING, TRAILING, BOTH
}