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 ofGenericDAO
- Since:
- 4.0
- Author:
- Marco Meschieri - LogicalDOC
-
-
Constructor Summary
Constructors Constructor Description HibernateGenericDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
delete(long genericId, int code)
This method deletes an entity and you can give a deletion codeGeneric
findByAlternateKey(String type, String subtype, Long qualifier, long tenantId)
Finds a Generic by it's alternate keyList<Generic>
findByTypeAndSubtype(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 defaultboolean
store(Generic entity)
This method persists the entity object-
Methods inherited from class com.logicaldoc.core.HibernatePersistentObjectDAO
bulkUpdate, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDbms, getSessionFactory, isOracle, jdbcUpdate, jdbcUpdate, query, queryForInt, queryForList, queryForList, queryForLong, queryForObject, queryForRowSet, 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, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDbms, isOracle, jdbcUpdate, jdbcUpdate, query, queryForInt, queryForList, queryForList, queryForLong, queryForObject, queryForRowSet, queryForString
-
-
-
-
Method Detail
-
delete
public boolean delete(long genericId, int code) throws PersistenceException
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- Returns:
- if the record has been successfully deleted
- Throws:
PersistenceException
- raised in case of errors in the database
-
findByAlternateKey
public Generic findByAlternateKey(String type, String subtype, Long qualifier, long tenantId)
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
-
findByTypeAndSubtype
public List<Generic> findByTypeAndSubtype(String type, String subtype, Long qualifier, Long tenantId)
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
-
initialize
public void initialize(Generic generic)
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
public boolean store(Generic entity) throws PersistenceException
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- Returns:
- True if successfully stored in a database
- Throws:
PersistenceException
- raised in case of errors in the database
-
-