Package org.opennms.netmgt.dao.hibernate
Class GenericHibernateAccessor
- java.lang.Object
-
- org.springframework.dao.support.DaoSupport
-
- org.springframework.orm.hibernate3.support.HibernateDaoSupport
-
- org.opennms.netmgt.dao.hibernate.GenericHibernateAccessor
-
- All Implemented Interfaces:
GenericPersistenceAccessor
,org.springframework.beans.factory.InitializingBean
public class GenericHibernateAccessor extends org.springframework.orm.hibernate3.support.HibernateDaoSupport implements GenericPersistenceAccessor
-
-
Field Summary
Fields Modifier and Type Field Description protected HibernateCriteriaConverter
criteriaConverter
-
Constructor Summary
Constructors Constructor Description GenericHibernateAccessor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> void
delete(T entity)
<T> void
deleteAll(java.lang.Class<T> clazz)
<T> void
deleteAll(java.util.Collection<T> entities)
<T> java.util.List<T>
executeNativeQuery(java.lang.String sql, java.util.Map<java.lang.String,java.lang.Object> parameterMap)
Executes a native SQL query.<T> java.util.List<T>
find(java.lang.String query)
<T> java.util.List<T>
find(java.lang.String query, java.lang.Object... values)
<T> java.util.List<T>
findAll(java.lang.Class<T> entityClass)
java.util.List
findMatching(Criteria criteria)
<T> java.util.List<T>
findUsingNamedParameters(java.lang.String query, java.lang.String[] paramNames, java.lang.Object[] values)
<T> java.util.List<T>
findUsingNamedParameters(java.lang.String query, java.lang.String[] paramNames, java.lang.Object[] values, java.lang.Integer offset, java.lang.Integer limit)
<T> T
get(java.lang.Class<T> entityType, java.io.Serializable entityId)
<T> T
save(T entity)
<T> void
saveAll(java.util.Collection<T> entities)
<T> void
update(T entity)
-
-
-
Field Detail
-
criteriaConverter
protected final HibernateCriteriaConverter criteriaConverter
-
-
Method Detail
-
find
public <T> java.util.List<T> find(java.lang.String query)
- Specified by:
find
in interfaceGenericPersistenceAccessor
-
find
public <T> java.util.List<T> find(java.lang.String query, java.lang.Object... values)
- Specified by:
find
in interfaceGenericPersistenceAccessor
-
findUsingNamedParameters
public <T> java.util.List<T> findUsingNamedParameters(java.lang.String query, java.lang.String[] paramNames, java.lang.Object[] values)
- Specified by:
findUsingNamedParameters
in interfaceGenericPersistenceAccessor
-
findUsingNamedParameters
public <T> java.util.List<T> findUsingNamedParameters(java.lang.String query, java.lang.String[] paramNames, java.lang.Object[] values, java.lang.Integer offset, java.lang.Integer limit)
- Specified by:
findUsingNamedParameters
in interfaceGenericPersistenceAccessor
-
executeNativeQuery
public <T> java.util.List<T> executeNativeQuery(java.lang.String sql, java.util.Map<java.lang.String,java.lang.Object> parameterMap)
Description copied from interface:GenericPersistenceAccessor
Executes a native SQL query. Use with care.- Specified by:
executeNativeQuery
in interfaceGenericPersistenceAccessor
- Parameters:
sql
- The SQL query to executeparameterMap
- An optional parameters map to apply to the query.- Returns:
- The result.
-
get
public <T> T get(java.lang.Class<T> entityType, java.io.Serializable entityId)
- Specified by:
get
in interfaceGenericPersistenceAccessor
-
findMatching
public java.util.List findMatching(Criteria criteria)
- Specified by:
findMatching
in interfaceGenericPersistenceAccessor
-
saveAll
public <T> void saveAll(java.util.Collection<T> entities)
- Specified by:
saveAll
in interfaceGenericPersistenceAccessor
-
save
public <T> T save(T entity)
- Specified by:
save
in interfaceGenericPersistenceAccessor
-
update
public <T> void update(T entity)
- Specified by:
update
in interfaceGenericPersistenceAccessor
-
delete
public <T> void delete(T entity)
- Specified by:
delete
in interfaceGenericPersistenceAccessor
-
deleteAll
public <T> void deleteAll(java.lang.Class<T> clazz)
- Specified by:
deleteAll
in interfaceGenericPersistenceAccessor
-
deleteAll
public <T> void deleteAll(java.util.Collection<T> entities)
- Specified by:
deleteAll
in interfaceGenericPersistenceAccessor
-
findAll
public <T> java.util.List<T> findAll(java.lang.Class<T> entityClass) throws org.springframework.dao.DataAccessException
- Specified by:
findAll
in interfaceGenericPersistenceAccessor
- Throws:
org.springframework.dao.DataAccessException
-
-