com.hack23.cia.service.data.impl
Class AbstractGenericDAOImpl<T extends Serializable,ID extends Serializable>

Package class diagram package AbstractGenericDAOImpl
java.lang.Object
  extended by com.hack23.cia.service.data.impl.AbstractGenericDAOImpl<T,ID>
Type Parameters:
T - the generic type
ID - the generic type
All Implemented Interfaces:
AbstractGenericDAO<T,ID>
Direct Known Subclasses:
AgencyDAOImpl, CommitteeProposalComponentDataDAOImpl, CountrydetailsDAOImpl, CountryElementDAOImpl, CountryinfoEuElementDAOImpl, DataDAOImpl, DocumentContentDataDAOImpl, DocumentElementDAOImpl, DocumentStatusContainerDAOImpl, IndicatorElementDAOImpl, LanguageContentDataDAOImpl, MepinfoEuElementDAOImpl, PersonDataDAOImpl, UserDAOImpl, VoteDataDAOImpl, VoteinfoEuElementDAOImpl, VotesEuDataDAOImpl

@Repository
public abstract class AbstractGenericDAOImpl<T extends Serializable,ID extends Serializable>
extends Object
implements AbstractGenericDAO<T,ID>

The Class AbstractGenericDAOImpl.


Constructor Summary
protected AbstractGenericDAOImpl(Class<T> persistentClass)
          Instantiates a new abstract generic dao impl.
 
Method Summary
protected  void addCacheHints(javax.persistence.TypedQuery<?> typedQuery, String comment)
          Adds the cache hints.
 void delete(T entity)
          Delete.
 T findFirstByProperty(javax.persistence.metamodel.SingularAttribute<T,? extends Object> property, Object value)
          Find first by property.
 List<T> findListByProperty(javax.persistence.metamodel.SingularAttribute<T,? extends Object> property, Object value)
          Find list by property.
 List<T> getAll()
          Gets the all.
 javax.persistence.criteria.CriteriaBuilder getCriteriaBuilder()
          Gets the criteria builder.
protected  javax.persistence.EntityManager getEntityManager()
          Gets the entity manager.
protected  javax.persistence.metamodel.Metamodel getMetamodel()
          Gets the metamodel.
 Class<T> getPersistentClass()
          Gets the persistent class.
 T load(ID id)
          Load.
 T merge(T entity)
          Merge.
 void persist(List<T> list)
          Persist.
 void persist(T entity)
          Persist.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.hack23.cia.service.data.api.AbstractGenericDAO
getSize
 

Constructor Detail

AbstractGenericDAOImpl

protected AbstractGenericDAOImpl(Class<T> persistentClass)
Instantiates a new abstract generic dao impl.

Parameters:
persistentClass - the persistent class
Method Detail

addCacheHints

protected void addCacheHints(javax.persistence.TypedQuery<?> typedQuery,
                             String comment)
Adds the cache hints.

Parameters:
typedQuery - the typed query
comment - the comment

delete

public void delete(T entity)
Description copied from interface: AbstractGenericDAO
Delete.

Specified by:
delete in interface AbstractGenericDAO<T extends Serializable,ID extends Serializable>
Parameters:
entity - the entity

findFirstByProperty

public T findFirstByProperty(javax.persistence.metamodel.SingularAttribute<T,? extends Object> property,
                             Object value)
Description copied from interface: AbstractGenericDAO
Find first by property.

Specified by:
findFirstByProperty in interface AbstractGenericDAO<T extends Serializable,ID extends Serializable>
Parameters:
property - the property
value - the value
Returns:
the t

findListByProperty

public List<T> findListByProperty(javax.persistence.metamodel.SingularAttribute<T,? extends Object> property,
                                  Object value)
Description copied from interface: AbstractGenericDAO
Find list by property.

Specified by:
findListByProperty in interface AbstractGenericDAO<T extends Serializable,ID extends Serializable>
Parameters:
property - the property
value - the value
Returns:
the list

getAll

public List<T> getAll()
Description copied from interface: AbstractGenericDAO
Gets the all.

Specified by:
getAll in interface AbstractGenericDAO<T extends Serializable,ID extends Serializable>
Returns:
the all

getCriteriaBuilder

public javax.persistence.criteria.CriteriaBuilder getCriteriaBuilder()
Gets the criteria builder.

Returns:
the criteria builder

getEntityManager

protected javax.persistence.EntityManager getEntityManager()
Gets the entity manager.

Returns:
the entity manager

getMetamodel

protected final javax.persistence.metamodel.Metamodel getMetamodel()
Gets the metamodel.

Returns:
the metamodel

getPersistentClass

public Class<T> getPersistentClass()
Gets the persistent class.

Returns:
the persistent class

load

public T load(ID id)
Description copied from interface: AbstractGenericDAO
Load.

Specified by:
load in interface AbstractGenericDAO<T extends Serializable,ID extends Serializable>
Parameters:
id - the id
Returns:
the t

merge

public T merge(T entity)
Description copied from interface: AbstractGenericDAO
Merge.

Specified by:
merge in interface AbstractGenericDAO<T extends Serializable,ID extends Serializable>
Parameters:
entity - the entity
Returns:
the t

persist

public void persist(List<T> list)
Description copied from interface: AbstractGenericDAO
Persist.

Specified by:
persist in interface AbstractGenericDAO<T extends Serializable,ID extends Serializable>
Parameters:
list - the list

persist

public void persist(T entity)
Description copied from interface: AbstractGenericDAO
Persist.

Specified by:
persist in interface AbstractGenericDAO<T extends Serializable,ID extends Serializable>
Parameters:
entity - the entity


Copyright © 2008-2011 www.hack23.com. All Rights Reserved.