uk.ac.soton.itinnovation.grid.service.sla.dao
Interface GenericDAO<T,ID extends Serializable>

All Known Subinterfaces:
ActivityDAO, ResourcePoolDAO, ResourceWithUsageByMetricDAO, SlaDAO, SLATemplateDAO, UsageSummaryDAO, UsageSummaryElementDAO
All Known Implementing Classes:
ActivityDAOImpl, GenericHibernateDAO, ResourcePoolDAOImpl, ResourceWithUsageByMetricDAOImpl, SlaDAOImpl, SLATemplateDAOImpl, UsageSummaryDAOImpl, UsageSummaryElementDAOImpl

public interface GenericDAO<T,ID extends Serializable>


Method Summary
 void delete(T entity)
          Delete an entity.
 List<T> findAll()
          Find all entities
 T findById(ID id)
          Find the entity identified by id
 T findById(ID id, boolean lock)
          Find the entity identified by id and optionally acquire a pessimistic lock on the entity.
 void saveOrUpdate(T entity)
          Save or update entity
 

Method Detail

findById

T findById(ID id)
Find the entity identified by id

Parameters:
id - the identity property of the entity
Returns:
the entity or null

findById

T findById(ID id,
           boolean lock)
Find the entity identified by id and optionally acquire a pessimistic lock on the entity.

Parameters:
id - the unique id for the entity
lock - whether or not to obtain a pessimistic lock
Returns:
the entity or null if it does not exist

findAll

List<T> findAll()
Find all entities

Returns:
List of all entities

saveOrUpdate

void saveOrUpdate(T entity)
Save or update entity

Parameters:
entity - the entity to save or update

delete

void delete(T entity)
Delete an entity. The entity is passes as a parameter (rather than the id of the entity) because the hibernate delete API is like this.

Parameters:
entity - the entity to delete


Copyright © 2001-2007 University of Southampton IT Innovation Centre. All Rights Reserved.