toplinkoperations.java

来自「有关此类编程有心德的高手 希望能够多多给予指教」· Java 代码 · 共 704 行 · 第 1/3 页

JAVA
704
字号
	 * Read all entity instances of the given class that match the given expression.
	 * @param entityClass the entity class
	 * @param expression the TopLink expression to match,
	 * usually built through the TopLink ExpressionBuilder
	 * @param enforceReadOnly whether to always retrieve read-only objects from
	 * the plain TopLink Session (else, read-write objects will be retrieved
	 * from the TopLink UnitOfWork in case of a non-read-only transaction)
	 * @return the list of matching entity instances
	 * @throws org.springframework.dao.DataAccessException in case of TopLink errors
	 * @see oracle.toplink.sessions.Session#readAllObjects(Class, oracle.toplink.expressions.Expression)
	 * @see oracle.toplink.expressions.ExpressionBuilder
	 */
	List readAll(Class entityClass, Expression expression, boolean enforceReadOnly)
			throws DataAccessException;

	/**
	 * Read all entity instances of the given class, as returned by the given call.
	 * <p>Retrieves read-write objects from the TopLink UnitOfWork in case of a
	 * non-read-only transaction, and read-only objects else.
	 * @param entityClass the entity class
	 * @param call the TopLink Call object to apply (either a SQLCall or an EJBQLCall)
	 * @return the list of matching entity instances
	 * @throws org.springframework.dao.DataAccessException in case of TopLink errors
	 * @see oracle.toplink.sessions.Session#readAllObjects(Class, oracle.toplink.queryframework.Call)
	 * @see oracle.toplink.queryframework.SQLCall
	 * @see oracle.toplink.queryframework.EJBQLCall
	 */
	List readAll(Class entityClass, Call call) throws DataAccessException;

	/**
	 * Read all entity instances of the given class, as returned by the given call.
	 * @param entityClass the entity class
	 * @param call the TopLink Call object to apply (either a SQLCall or an EJBQLCall)
	 * @param enforceReadOnly whether to always retrieve read-only objects from
	 * the plain TopLink Session (else, read-write objects will be retrieved
	 * from the TopLink UnitOfWork in case of a non-read-only transaction)
	 * @return the list of matching entity instances
	 * @throws org.springframework.dao.DataAccessException in case of TopLink errors
	 * @see oracle.toplink.sessions.Session#readAllObjects(Class, oracle.toplink.expressions.Expression)
	 * @see oracle.toplink.queryframework.SQLCall
	 * @see oracle.toplink.queryframework.EJBQLCall
	 */
	List readAll(Class entityClass, Call call, boolean enforceReadOnly) throws DataAccessException;

	/**
	 * Read an entity instance of the given class that matches the given expression.
	 * <p>Retrieves read-write objects from the TopLink UnitOfWork in case of a
	 * non-read-only transaction, and read-only objects else.
	 * @param entityClass the entity class
	 * @param expression the TopLink expression to match,
	 * usually built through the TopLink ExpressionBuilder
	 * @return the matching entity instance, or <code>null</code> if none found
	 * @throws org.springframework.dao.DataAccessException in case of TopLink errors
	 * @see oracle.toplink.sessions.Session#readAllObjects(Class, oracle.toplink.expressions.Expression)
	 * @see oracle.toplink.expressions.ExpressionBuilder
	 */
	Object read(Class entityClass, Expression expression) throws DataAccessException;

	/**
	 * Read an entity instance of the given class that matches the given expression.
	 * @param entityClass the entity class
	 * @param expression the TopLink expression to match,
	 * usually built through the TopLink ExpressionBuilder
	 * @param enforceReadOnly whether to always retrieve read-only objects from
	 * the plain TopLink Session (else, read-write objects will be retrieved
	 * from the TopLink UnitOfWork in case of a non-read-only transaction)
	 * @return a matching entity instance, or <code>null</code> if none found
	 * @throws org.springframework.dao.DataAccessException in case of TopLink errors
	 * @see oracle.toplink.sessions.Session#readAllObjects(Class, oracle.toplink.expressions.Expression)
	 * @see oracle.toplink.expressions.ExpressionBuilder
	 */
	Object read(Class entityClass, Expression expression, boolean enforceReadOnly)
			throws DataAccessException;

	/**
	 * Read an entity instance of the given class, as returned by the given call.
	 * <p>Retrieves read-write objects from the TopLink UnitOfWork in case of a
	 * non-read-only transaction, and read-only objects else.
	 * @param entityClass the entity class
	 * @param call the TopLink Call object to apply (either a SQLCall or an EJBQLCall)
	 * @return a matching entity instance, or <code>null</code> if none found
	 * @throws org.springframework.dao.DataAccessException in case of TopLink errors
	 * @see oracle.toplink.sessions.Session#readAllObjects(Class, oracle.toplink.queryframework.Call)
	 * @see oracle.toplink.queryframework.SQLCall
	 * @see oracle.toplink.queryframework.EJBQLCall
	 */
	Object read(Class entityClass, Call call) throws DataAccessException;

	/**
	 * Read an entity instance of the given class, as returned by the given call.
	 * @param entityClass the entity class
	 * @param call the TopLink Call object to apply (either a SQLCall or an EJBQLCall)
	 * @param enforceReadOnly whether to always retrieve read-only objects from
	 * the plain TopLink Session (else, read-write objects will be retrieved
	 * from the TopLink UnitOfWork in case of a non-read-only transaction)
	 * @return a matching entity instance, or <code>null</code> if none found
	 * @throws org.springframework.dao.DataAccessException in case of TopLink errors
	 * @see oracle.toplink.sessions.Session#readAllObjects(Class, oracle.toplink.expressions.Expression)
	 * @see oracle.toplink.queryframework.SQLCall
	 * @see oracle.toplink.queryframework.EJBQLCall
	 */
	Object read(Class entityClass, Call call, boolean enforceReadOnly)
			throws DataAccessException;


	//-------------------------------------------------------------------------
	// Convenience methods for reading an individual object by id
	//-------------------------------------------------------------------------

	/**
	 * Read the entity instance of the given class with the given id,
	 * throwing an exception if not found.
	 * <p>Retrieves read-write objects from the TopLink UnitOfWork in case of a
	 * non-read-only transaction, and read-only objects else.
	 * @param entityClass the entity class
	 * @param id the id of the desired object
	 * @return the entity instance
	 * @throws org.springframework.orm.ObjectRetrievalFailureException if not found
	 * @throws org.springframework.dao.DataAccessException in case of TopLink errors
	 * @see oracle.toplink.queryframework.ReadObjectQuery#setSelectionKey(java.util.Vector)
	 */
	Object readById(Class entityClass, Object id) throws DataAccessException;

	/**
	 * Read the entity instance of the given class with the given id,
	 * throwing an exception if not found.
	 * @param entityClass the entity class
	 * @param id the id of the desired object
	 * @return the entity instance
	 * @param enforceReadOnly whether to always retrieve read-only objects from
	 * the plain TopLink Session (else, read-write objects will be retrieved
	 * from the TopLink UnitOfWork in case of a non-read-only transaction)
	 * @throws org.springframework.orm.ObjectRetrievalFailureException if not found
	 * @throws org.springframework.dao.DataAccessException in case of TopLink errors
	 * @see oracle.toplink.queryframework.ReadObjectQuery#setSelectionKey(java.util.Vector)
	 */
	Object readById(Class entityClass, Object id, boolean enforceReadOnly) throws DataAccessException;

	/**
	 * Read the entity instance of the given class with the given composite id,
	 * throwing an exception if not found.
	 * <p>Retrieves read-write objects from the TopLink UnitOfWork in case of a
	 * non-read-only transaction, and read-only objects else.
	 * @param entityClass the entity class
	 * @param keys the composite id elements of the desired object
	 * @return the entity instance
	 * @throws org.springframework.orm.ObjectRetrievalFailureException if not found
	 * @throws org.springframework.dao.DataAccessException in case of TopLink errors
	 * @see oracle.toplink.queryframework.ReadObjectQuery#setSelectionKey(java.util.Vector)
	 */
	Object readById(Class entityClass, Object[] keys) throws DataAccessException;

	/**
	 * Read the entity instance of the given class with the given composite id,
	 * throwing an exception if not found.
	 * @param entityClass the entity class
	 * @param keys the composite id elements of the desired object
	 * @param enforceReadOnly whether to always retrieve read-only objects from
	 * the plain TopLink Session (else, read-write objects will be retrieved
	 * from the TopLink UnitOfWork in case of a non-read-only transaction)
	 * @return the entity instance
	 * @throws org.springframework.orm.ObjectRetrievalFailureException if not found
	 * @throws org.springframework.dao.DataAccessException in case of TopLink errors
	 * @see oracle.toplink.queryframework.ReadObjectQuery#setSelectionKey(java.util.Vector)
	 */
	Object readById(Class entityClass, Object[] keys, boolean enforceReadOnly) throws DataAccessException;

	/**
	 * Read the entity instance of the given class with the given id,
	 * throwing an exception if not found. A detached copy of the entity object
	 * will be returned, allowing for modifications outside the current transaction,
	 * with the changes to be merged into a later transaction.
	 * <p>Retrieves read-write objects from the TopLink UnitOfWork in case of a
	 * non-read-only transaction, and read-only objects else.
	 * @param entityClass the entity class
	 * @param id the id of the desired object
	 * @return a copy of the entity instance
	 * @throws org.springframework.orm.ObjectRetrievalFailureException if not found
	 * @throws org.springframework.dao.DataAccessException in case of TopLink errors
	 * @see oracle.toplink.queryframework.ReadObjectQuery#setSelectionKey(java.util.Vector)
	 * @see oracle.toplink.sessions.Session#copyObject(Object)
	 */
	Object readAndCopy(Class entityClass, Object id) throws DataAccessException;

	/**
	 * Read the entity instance of the given class with the given id,
	 * throwing an exception if not found. A detached copy of the entity object
	 * will be returned, allowing for modifications outside the current transaction,
	 * with the changes to be merged into a later transaction.
	 * @param entityClass the entity class
	 * @param id the id of the desired object
	 * @param enforceReadOnly whether to always retrieve read-only objects from
	 * the plain TopLink Session (else, read-write objects will be retrieved
	 * from the TopLink UnitOfWork in case of a non-read-only transaction)
	 * @return a copy of the entity instance
	 * @throws org.springframework.orm.ObjectRetrievalFailureException if not found
	 * @throws org.springframework.dao.DataAccessException in case of TopLink errors
	 * @see oracle.toplink.queryframework.ReadObjectQuery#setSelectionKey(java.util.Vector)
	 * @see oracle.toplink.sessions.Session#copyObject(Object)
	 */
	Object readAndCopy(Class entityClass, Object id, boolean enforceReadOnly) throws DataAccessException;

	/**
	 * Read the entity instance of the given class with the given composite id,
	 * throwing an exception if not found. A detached copy of the entity object
	 * will be returned, allowing for modifications outside the current transaction,
	 * with the changes to be merged into a later transaction.
	 * <p>Retrieves read-write objects from the TopLink UnitOfWork in case of a
	 * non-read-only transaction, and read-only objects else.
	 * @param entityClass the entity class
	 * @param keys the composite id elements of the desired object
	 * @return a copy of the entity instance
	 * @throws org.springframework.orm.ObjectRetrievalFailureException if not found
	 * @throws org.springframework.dao.DataAccessException in case of TopLink errors
	 * @see oracle.toplink.queryframework.ReadObjectQuery#setSelectionKey(java.util.Vector)
	 * @see oracle.toplink.sessions.Session#copyObject(Object)
	 */
	Object readAndCopy(Class entityClass, Object[] keys) throws DataAccessException;

	/**
	 * Read the entity instance of the given class with the given composite id,
	 * throwing an exception if not found. A detached copy of the entity object
	 * will be returned, allowing for modifications outside the current transaction,
	 * with the changes to be merged into a later transaction.
	 * @param entityClass the entity class
	 * @param keys the composite id elements of the desired object
	 * @param enforceReadOnly whether to always retrieve read-only objects from
	 * the plain TopLink Session (else, read-write objects will be retrieved
	 * from the TopLink UnitOfWork in case of a non-read-only transaction)
	 * @return a copy of the entity instance
	 * @throws org.springframework.orm.ObjectRetrievalFailureException if not found
	 * @throws org.springframework.dao.DataAccessException in case of TopLink errors
	 * @see oracle.toplink.queryframework.ReadObjectQuery#setSelectionKey(java.util.Vector)
	 * @see oracle.toplink.sessions.Session#copyObject(Object)
	 */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?