org.kuali.student.r2.common.dao
Class GenericEntityDao<T>

java.lang.Object
  extended by org.kuali.student.r2.common.dao.GenericEntityDao<T>
All Implemented Interfaces:
EntityDao<T>
Direct Known Subclasses:
AppliedHoldDao, AppointmentDao, AppointmentSlotDao, AppointmentWindowDao, AtpAtpRelationDao, AtpDao, AtpMilestoneRelationDao, CheckDao, EnrollmentFeeDao, EnumContextValueDao, EnumeratedValueDao, EnumerationDao, ExtendedOrgDao, HoldIssueDao, InstructionDao, LifecycleDao, LprDao, LprRosterDao, LprRosterEntryDao, LprTransactionDao, LprTransactionItemDao, LrrDao, LuiDao, LuiLuiRelationDao, MilestoneDao, PopulationDao, PopulationRuleDao, ProcessDao, ResultScaleDao, ResultSourceDao, ResultValueDao, ResultValuesGroupDao, ScheduleRequestDao, SeatPoolDefinitionDao, SocDao, SocRolloverResultDao, SocRolloverResultItemDao, StateDao, TimeSlotDao, TypeDao, TypeTypeRelationDao

public class GenericEntityDao<T>
extends Object
implements EntityDao<T>

Author:
Igor

Field Summary
protected  EntityManager em
           
protected  Class<T> entityClass
          Entity class.
 
Constructor Summary
GenericEntityDao()
           
 
Method Summary
 T find(Serializable primaryKey)
          Find object by primary key.
 List<T> findAll()
          Load all entities of this type.
 List<T> findByIds(List<? extends Serializable> primaryKeys)
          Find objects of specified class by primary keys.
 EntityManager getEm()
           
protected
<K extends T>
Class<K>
getEntityClass()
           
 T merge(T entity)
          Merge detached object.
 void persist(T entity)
          Persist unsaved object.
 void remove(T entity)
          Remove entity from the persistent store.
 void setEm(EntityManager em)
           
 void update(T entity)
          Update detached object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

entityClass

protected Class<T> entityClass
Entity class.


em

protected EntityManager em
Constructor Detail

GenericEntityDao

public GenericEntityDao()
Method Detail

find

public T find(Serializable primaryKey)
Description copied from interface: EntityDao
Find object by primary key.

Specified by:
find in interface EntityDao<T>
Parameters:
primaryKey - Primary key
Returns:
Entity for given key

findByIds

public List<T> findByIds(List<? extends Serializable> primaryKeys)
                  throws DoesNotExistException
Description copied from interface: EntityDao
Find objects of specified class by primary keys.

Specified by:
findByIds in interface EntityDao<T>
Parameters:
primaryKeys - - list of Primary keys
Returns:
Entity for given key
Throws:
DoesNotExistException

findAll

public List<T> findAll()
Description copied from interface: EntityDao
Load all entities of this type.

Specified by:
findAll in interface EntityDao<T>
Returns:
List of entities

persist

public void persist(T entity)
Description copied from interface: EntityDao
Persist unsaved object.

Specified by:
persist in interface EntityDao<T>
Parameters:
entity - Entity to save

update

public void update(T entity)
Description copied from interface: EntityDao
Update detached object.

Specified by:
update in interface EntityDao<T>
Parameters:
entity - Entity to update

remove

public void remove(T entity)
Description copied from interface: EntityDao
Remove entity from the persistent store.

Specified by:
remove in interface EntityDao<T>
Parameters:
entity - Entity to remove

merge

public T merge(T entity)
Description copied from interface: EntityDao
Merge detached object.

Specified by:
merge in interface EntityDao<T>
Parameters:
entity - Entity to save
Returns:
Merged entity.

getEntityClass

protected <K extends T> Class<K> getEntityClass()

setEm

public void setEm(EntityManager em)

getEm

public EntityManager getEm()


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.