|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.dao.support.DaoSupport
org.springframework.orm.hibernate3.support.HibernateDaoSupport
com.ferri.persistence.dao.commons.GenericBaseDAOImpl<E,PK>
public abstract class GenericBaseDAOImpl<E extends BaseVO,PK extends Serializable>
Field Summary | |
---|---|
private Class<E> |
internalClassType
|
protected org.apache.log4j.Logger |
logger
|
Fields inherited from interface com.ferri.persistence.dao.commons.GenericBaseDAO |
---|
ORDER_BY, SEPARATOR_COMMA, SEPARATOR_DOT |
Constructor Summary | |
---|---|
GenericBaseDAOImpl()
|
Method Summary | |
---|---|
Collection<E> |
create(Collection<E> entities)
Persist the given transient collection instance, first assigning a generated identifier. |
PK |
create(E entity)
Persist the given transient instance, first assigning a generated identifier. |
Collection<E> |
find(String queryString,
Object[] values)
find Entity instances. |
Collection<E> |
findByCriteria(org.hibernate.criterion.DetachedCriteria criteria)
findByExample Entity instances. |
Collection<E> |
findByExample(E entity)
findByExample Entity instances. |
org.hibernate.criterion.DetachedCriteria |
getCriteria()
Obtain a criteria for the entity class |
Class<E> |
getEntityClass()
Specify a Class entity. |
protected String |
getEntityClassName()
|
String |
getQueryOrderedBy(String entityName,
String query,
org.hibernate.criterion.Order... orders)
Contruct order by from entityName, query and Order Order |
protected String |
headEntityClassNameTo(String message)
Append the message after the Entity Class Name. |
void |
initialize()
Execute the first operations to complete the instanciation. |
private void |
initiateEntityType()
|
E |
load(PK key)
Loads a Entity instance by identifier. |
Collection<E> |
loadAll()
Return all objects related to the implementation of this DAO with no filter. |
Collection<E> |
loadAllOrderBy(org.hibernate.criterion.Order... orders)
Return all objects related to the implementation of this DAO with no filter and ordered by orders. |
Collection<E> |
loadAllOrderby(String propertyName,
Boolean ascending)
Return all objects related to the implementation of this DAO with no filter, ordered by propertyName and ascending. |
void |
remove(Collection<E> entities)
Removes all entities in the given entities |
void |
remove(E entity)
Remove a persistent instance from the datastore. |
void |
removeByPk(PK id)
Remove a persistent instance from the datastore. |
void |
save(E entity)
Save the persistent state associated with the given identifier. |
void |
saveOrUpdate(Collection<E> entities)
saveOrUpdate the persistent collection state associated with the given identifier. |
void |
saveOrUpdate(E entity)
saveOrUpdate the persistent state associated with the given identifier. |
void |
update(E entity)
Update a persistent instance from the datastore. |
Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport |
---|
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory |
Methods inherited from class org.springframework.dao.support.DaoSupport |
---|
afterPropertiesSet, initDao |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected org.apache.log4j.Logger logger
private Class<E extends BaseVO> internalClassType
Constructor Detail |
---|
public GenericBaseDAOImpl()
Method Detail |
---|
public Class<E> getEntityClass()
private void initiateEntityType() throws GenericClassNotFound, GenericTypeNotFound
GenericClassNotFound
- if the given class dont have the expected parent class
GenericTypeNotFound
- if the given type is not foundpublic void initialize() throws GenericClassNotFound, GenericTypeNotFound
Initializable
initialize
in interface Initializable
GenericClassNotFound
- if the given class dont have the expected parent class
GenericTypeNotFound
- if the given type is not foundInitializable.initialize()
protected String getEntityClassName()
protected String headEntityClassNameTo(String message)
message
- the message to append.
public org.hibernate.criterion.DetachedCriteria getCriteria()
GenericBaseDAO
getCriteria
in interface GenericBaseDAO<E extends BaseVO,PK extends Serializable>
public String getQueryOrderedBy(String entityName, String query, org.hibernate.criterion.Order... orders)
Order
getQueryOrderedBy
in interface GenericBaseDAO<E extends BaseVO,PK extends Serializable>
entityName
- the entity namequery
- the queryorders
- the orders
public E load(PK key)
GenericBaseDAO
load
in interface GenericBaseDAO<E extends BaseVO,PK extends Serializable>
public Collection<E> loadAll()
GenericBaseDAO
loadAll
in interface GenericBaseDAO<E extends BaseVO,PK extends Serializable>
public Collection<E> loadAllOrderby(String propertyName, Boolean ascending)
GenericBaseDAO
loadAllOrderby
in interface GenericBaseDAO<E extends BaseVO,PK extends Serializable>
public Collection<E> loadAllOrderBy(org.hibernate.criterion.Order... orders)
GenericBaseDAO
loadAllOrderBy
in interface GenericBaseDAO<E extends BaseVO,PK extends Serializable>
public Collection<E> findByExample(E entity)
GenericBaseDAO
findByExample
in interface GenericBaseDAO<E extends BaseVO,PK extends Serializable>
entity
- the identifier
public Collection<E> find(String queryString, Object[] values)
GenericBaseDAO
find
in interface GenericBaseDAO<E extends BaseVO,PK extends Serializable>
public Collection<E> findByCriteria(org.hibernate.criterion.DetachedCriteria criteria)
GenericBaseDAO
findByCriteria
in interface GenericBaseDAO<E extends BaseVO,PK extends Serializable>
public PK create(E entity)
GenericBaseDAO
create
in interface GenericBaseDAO<E extends BaseVO,PK extends Serializable>
entity
- a transient instance of a persistent class.
public Collection<E> create(Collection<E> entities)
GenericBaseDAO
create
in interface GenericBaseDAO<E extends BaseVO,PK extends Serializable>
entities
- the collection to persist.
public void saveOrUpdate(E entity)
GenericBaseDAO
saveOrUpdate
in interface GenericBaseDAO<E extends BaseVO,PK extends Serializable>
entity
- a transient instance containing saved Or Updated state.public void saveOrUpdate(Collection<E> entities)
GenericBaseDAO
saveOrUpdate
in interface GenericBaseDAO<E extends BaseVO,PK extends Serializable>
entities
- the collection to saveOrUpdate.public void save(E entity)
GenericBaseDAO
save
in interface GenericBaseDAO<E extends BaseVO,PK extends Serializable>
entity
- a transient instance containing saved Or Updated state.public void update(E entity)
GenericBaseDAO
update
in interface GenericBaseDAO<E extends BaseVO,PK extends Serializable>
entity
- the instance to be updated.public void removeByPk(PK id)
GenericBaseDAO
removeByPk
in interface GenericBaseDAO<E extends BaseVO,PK extends Serializable>
id
- the instance ID to be removed.public void remove(E entity)
GenericBaseDAO
remove
in interface GenericBaseDAO<E extends BaseVO,PK extends Serializable>
entity
- the instance to be removed.public void remove(Collection<E> entities)
GenericBaseDAO
entities collection.
- Specified by:
remove
in interface GenericBaseDAO<E extends BaseVO,PK extends Serializable>
- Parameters:
entities
- the collection remove.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |