Package com.logicaldoc.core.generic
Class HibernateGenericDAO
java.lang.Object
com.logicaldoc.core.HibernatePersistentObjectDAO<Generic>
com.logicaldoc.core.generic.HibernateGenericDAO
- All Implemented Interfaces:
GenericDAO
,PersistentObjectDAO<Generic>
public class HibernateGenericDAO
extends HibernatePersistentObjectDAO<Generic>
implements GenericDAO
Hibernate implementation of
GenericDAO
- Since:
- 4.0
- Author:
- Marco Meschieri - LogicalDOC
-
Field Summary
Fields inherited from interface com.logicaldoc.core.PersistentObjectDAO
ENTITY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
delete
(long genericId, int code) This method deletes an entity and you can give a deletion codefindByAlternateKey
(String type, String subtype, Long qualifier, long tenantId) Finds a Generic by it's alternate keyfindByTypeAndSubtype
(String type, String subtype, Long qualifier, Long tenantId) Finds a Generic by it's alternate key.void
initialize
(Generic generic) Doesn't do anything by defaultvoid
This method persists the entity objectMethods inherited from class com.logicaldoc.core.HibernatePersistentObjectDAO
bulkUpdate, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, getSessionFactory, isMySQL, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForObject, queryForResultSet, queryForString, setSessionFactory
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.logicaldoc.core.PersistentObjectDAO
bulkUpdate, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, isMySQL, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForObject, queryForResultSet, queryForString
-
Constructor Details
-
HibernateGenericDAO
public HibernateGenericDAO()
-
-
Method Details
-
delete
Description copied from interface:PersistentObjectDAO
This method deletes an entity and you can give a deletion code- Specified by:
delete
in interfacePersistentObjectDAO<Generic>
- Overrides:
delete
in classHibernatePersistentObjectDAO<Generic>
- Parameters:
genericId
- ID of the entity which should be deletedcode
- Deletion code- Throws:
PersistenceException
- raised in case of errors in the database
-
findByAlternateKey
public Generic findByAlternateKey(String type, String subtype, Long qualifier, long tenantId) throws PersistenceException Description copied from interface:GenericDAO
Finds a Generic by it's alternate key- Specified by:
findByAlternateKey
in interfaceGenericDAO
- Parameters:
type
- The type(you can use like jollies and can be null)subtype
- The sub-type(you can use like jollies and can be null)qualifier
- the qualifier, can be nulltenantId
- ID of the owning tenant- Returns:
- Wanted generic or null
- Throws:
PersistenceException
- Error in the database
-
findByTypeAndSubtype
public List<Generic> findByTypeAndSubtype(String type, String subtype, Long qualifier, Long tenantId) throws PersistenceException Description copied from interface:GenericDAO
Finds a Generic by it's alternate key. The search uses the like operator and each parameter can be null.- Specified by:
findByTypeAndSubtype
in interfaceGenericDAO
- Parameters:
type
- The type(you can use like jollies and can be null)subtype
- The sub-type(you can use like jollies and can be null)qualifier
- the qualifier, can be nulltenantId
- ID of the owning tenant (optional)- Returns:
- The collection of found Generics
- Throws:
PersistenceException
- Error in the database
-
initialize
Description copied from class:HibernatePersistentObjectDAO
Doesn't do anything by default- Specified by:
initialize
in interfacePersistentObjectDAO<Generic>
- Overrides:
initialize
in classHibernatePersistentObjectDAO<Generic>
- Parameters:
generic
- The entity to be initialised
-
store
Description copied from interface:PersistentObjectDAO
This method persists the entity object- Specified by:
store
in interfacePersistentObjectDAO<Generic>
- Overrides:
store
in classHibernatePersistentObjectDAO<Generic>
- Parameters:
entity
- entity to be stored- Throws:
PersistenceException
- raised in case of errors in the database
-