org.lambico.test.spring.hibernate
Class DaoUtils

java.lang.Object
  extended by org.lambico.test.spring.hibernate.DaoUtils

public final class DaoUtils
extends java.lang.Object

Utils for the DAO tools.

Version:
$Revision: 899e24150c82 $
Author:
Lucio Benfante

Method Summary
static GenericDaoBase getDaoFor(java.lang.Class daoEntityType, org.springframework.beans.factory.ListableBeanFactory beanFactory)
          Get the DAO for the specific entity class type.
static java.util.Map<java.lang.String,java.lang.Object> getDaos(org.springframework.beans.factory.ListableBeanFactory beanFactory)
          Return a map of DAOs from a bean container.
static boolean isDao(java.lang.Object o)
          Check if an object is a DAO.
static boolean isDaoFor(java.lang.Object o, java.lang.Class daoEntityType)
          Check if an object is a DAO for a specific entity class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDaos

public static java.util.Map<java.lang.String,java.lang.Object> getDaos(org.springframework.beans.factory.ListableBeanFactory beanFactory)
Return a map of DAOs from a bean container.

Parameters:
beanFactory - The bean container.
Returns:
A map of daos. The key is the id of the bean in the container.

isDao

public static boolean isDao(java.lang.Object o)
Check if an object is a DAO.

Parameters:
o - The object to check.
Returns:
true if the object is recognized as a DAO.

isDaoFor

public static boolean isDaoFor(java.lang.Object o,
                               java.lang.Class daoEntityType)
Check if an object is a DAO for a specific entity class.

Parameters:
o - The object to check.
daoEntityType - The entity class type.
Returns:
true if the object is o DAO for the entity.

getDaoFor

public static GenericDaoBase getDaoFor(java.lang.Class daoEntityType,
                                       org.springframework.beans.factory.ListableBeanFactory beanFactory)
Get the DAO for the specific entity class type.

Parameters:
daoEntityType - The entity class type.
beanFactory - The context in wich searching for the DAO.
Returns:
The DAO fot the specific entity class type. null if it can't be found.


Copyright © 2009-2010 Lambico Team. All Rights Reserved.