Save This Page
Home » spring-framework-2.5.6-with-dependencies » org.springframework » dao » support » [javadoc | source]
org.springframework.dao.support
abstract public class: DataAccessUtils [javadoc | source]
java.lang.Object
   org.springframework.dao.support.DataAccessUtils
Miscellaneous utility methods for DAO implementations. Useful with any data access technology.
Method from org.springframework.dao.support.DataAccessUtils Summary:
intResult,   longResult,   objectResult,   requiredSingleResult,   requiredUniqueResult,   singleResult,   translateIfNecessary,   uniqueResult
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.springframework.dao.support.DataAccessUtils Detail:
 public static int intResult(Collection results) throws TypeMismatchDataAccessException, IncorrectResultSizeDataAccessException 
    Return a unique int result from the given Collection. Throws an exception if 0 or more than 1 result objects found, of if the unique result object is not convertable to an int.
 public static long longResult(Collection results) throws TypeMismatchDataAccessException, IncorrectResultSizeDataAccessException 
    Return a unique long result from the given Collection. Throws an exception if 0 or more than 1 result objects found, of if the unique result object is not convertable to a long.
 public static Object objectResult(Collection results,
    Class requiredType) throws TypeMismatchDataAccessException, IncorrectResultSizeDataAccessException 
    Return a unique result object from the given Collection. Throws an exception if 0 or more than 1 result objects found, of if the unique result object is not convertable to the specified required type.
 public static Object requiredSingleResult(Collection results) throws IncorrectResultSizeDataAccessException 
    Return a single result object from the given Collection.

    Throws an exception if 0 or more than 1 element found.

 public static Object requiredUniqueResult(Collection results) throws IncorrectResultSizeDataAccessException 
    Return a unique result object from the given Collection.

    Throws an exception if 0 or more than 1 instance found.

 public static Object singleResult(Collection results) throws IncorrectResultSizeDataAccessException 
    Return a single result object from the given Collection.

    Returns null if 0 result objects found; throws an exception if more than 1 element found.

 public static RuntimeException translateIfNecessary(RuntimeException rawException,
    PersistenceExceptionTranslator pet) 
    Return a translated exception if this is appropriate, otherwise return the input exception.
 public static Object uniqueResult(Collection results) throws IncorrectResultSizeDataAccessException 
    Return a unique result object from the given Collection.

    Returns null if 0 result objects found; throws an exception if more than 1 instance found.