org.springframework.dao.support

Class DataAccessUtils

  • java.lang.Object
    • org.springframework.dao.support.DataAccessUtils


  • public abstract class DataAccessUtils
    extends java.lang.Object
    Miscellaneous utility methods for DAO implementations. Useful with any data access technology.
    Since:
    1.0.2
    Author:
    Juergen Hoeller
    • Constructor Summary

      Constructors 
      Constructor and Description
      DataAccessUtils() 
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static int intResult(java.util.Collection<?> results)
      Return a unique int result from the given Collection.
      static long longResult(java.util.Collection<?> results)
      Return a unique long result from the given Collection.
      static <T> T nullableSingleResult(java.util.Collection<T> results)
      Return a single result object from the given Collection.
      static <T> T objectResult(java.util.Collection<?> results, java.lang.Class<T> requiredType)
      Return a unique result object from the given Collection.
      static <T> T requiredSingleResult(java.util.Collection<T> results)
      Return a single result object from the given Collection.
      static <T> T requiredUniqueResult(java.util.Collection<T> results)
      Return a unique result object from the given Collection.
      static <T> T singleResult(java.util.Collection<T> results)
      Return a single result object from the given Collection.
      static java.lang.RuntimeException translateIfNecessary(java.lang.RuntimeException rawException, PersistenceExceptionTranslator pet)
      Return a translated exception if this is appropriate, otherwise return the given exception as-is.
      static <T> T uniqueResult(java.util.Collection<T> results)
      Return a unique result object from the given Collection.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait