net.sf.derquinsej.hib3
Interface GeneralDAO

All Superinterfaces:
DAO
All Known Subinterfaces:
Repository
All Known Implementing Classes:
GeneralDAOImpl, RepositoryImpl

public interface GeneralDAO
extends DAO

General DAO interface.

Author:
Andres Rodriguez

Method Summary
 void delete(Object entity)
          Deletes an entity instance.
<T> void
deleteById(Class<T> type, Serializable id)
          Deletes an entity instance.
<T> List<T>
findAll(Class<T> type)
          Returns all entities of the persistent type.
<T> T
findById(Class<T> type, Serializable id, boolean lock)
          Finds an entity by ID.
 void save(Object entity)
          Saves an entity.
 void saveOrUpdate(Object entity)
          Saves or updates an entity, depending upon resolution of the unsaved-value checks.
 void update(Object entity)
          Updates an entity.
 
Methods inherited from interface net.sf.derquinsej.hib3.DAO
clear, flush, sync
 

Method Detail

findById

<T> T findById(Class<T> type,
               Serializable id,
               boolean lock)
Finds an entity by ID.

Parameters:
type - Entity type.
id - ID.
lock - If the entity shall be locked.
Returns:
The requested entity or null if it is not found.

findAll

<T> List<T> findAll(Class<T> type)
Returns all entities of the persistent type.

Parameters:
type - Entity type.
Returns:
A list with all the instances.

save

void save(Object entity)
Saves an entity.

Parameters:
entity - Entity to save.

update

void update(Object entity)
Updates an entity.

Parameters:
entity - Entity to update.

saveOrUpdate

void saveOrUpdate(Object entity)
Saves or updates an entity, depending upon resolution of the unsaved-value checks.

Parameters:
entity - Entity to persist.

delete

void delete(Object entity)
Deletes an entity instance.

Parameters:
entity - Instance to delete.

deleteById

<T> void deleteById(Class<T> type,
                    Serializable id)
Deletes an entity instance.

Parameters:
type - Entity type.
id - Id of the instance to delete.


Copyright © 2011. All Rights Reserved.