org.springframework.dao.support
Class DataAccessUtils

java.lang.Object
  extended byorg.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:
26.05.2004
Author:
Juergen Hoeller

Constructor Summary
DataAccessUtils()
           
 
Method Summary
static java.lang.Object requiredUniqueResult(java.util.Collection results)
          Return a unique result object from the given Collection.
static java.lang.Object uniqueResult(java.util.Collection 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
 

Constructor Detail

DataAccessUtils

public DataAccessUtils()
Method Detail

uniqueResult

public static java.lang.Object uniqueResult(java.util.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 found.

Parameters:
results - the result Collection
Returns:
the unique result object, or null if none
Throws:
IncorrectResultSizeDataAccessException - if more than one result object has been found in the given Collection

requiredUniqueResult

public static java.lang.Object requiredUniqueResult(java.util.Collection results)
                                             throws IncorrectResultSizeDataAccessException
Return a unique result object from the given Collection. Throws an exception if 0 or more than 1 result objects found.

Parameters:
results - the result Collection
Returns:
the unique result object, or null if none
Throws:
IncorrectResultSizeDataAccessException - if more than one result object has been found in the given Collection


Copyright (C) 2003-2004 The Spring Framework Project.