jhomenet.server.dao
Interface GenericDao<T,ID extends java.io.Serializable>

All Known Subinterfaces:
ConditionDao, EventDao, HardwareDao, HardwareDataDao, PlanDao, ResponseDao, TriggerDao, UserDao
All Known Implementing Classes:
ConditionDaoTxt, ConditionDaoXml, GenericHibernateDAO, HardwareDaoTxt, HardwareDaoXml, HardwareDataDaoHibernate, HardwareDataDaoTxt, HardwareDataDaoXml, HibernateDAOFactory.ConditionDaoHibernate, HibernateDAOFactory.EventDaoHibernate, HibernateDAOFactory.HardwareDaoHibernate, HibernateDAOFactory.PlanDaoHibernate, HibernateDAOFactory.ResponseDaoHibernate, HibernateDAOFactory.TriggerDaoHibernate, PlanDaoTxt, PlanDaoXml, ResponseDaoTxt, ResponseDaoXml, UserDaoHibernate

public interface GenericDao<T,ID extends java.io.Serializable>

A generic data access object (DAO) based on the GenericDAO class found in the Hibernate distribution.

All CRUD (create, read, update, delete) basic data access operations are isolated in this interface and shared accross all DAO implementations. The current design is for a state-management oriented persistence layer (for example, there is no UDPATE statement function) that provides automatic transactional dirty checking of business objects in persistent state. Id: $Id: $

Author:
Dave Irwin (jhomenet at gmail dot com)

Method Summary
 void clear()
          Affects every managed instance in the current persistence context!
 java.util.List<T> findAll()
          List of all of the entities.
 java.util.List<T> findByExample(T exampleInstance, java.lang.String... excludeProperty)
          Find an entity by example.
 T findById(ID id, boolean lock)
          Find an entity object given the entity's ID.
 void flush()
          Affects every managed instance in the current persistence context!
 T makePersistent(T entity)
          Make an entity object persistent.
 void makeTransient(T entity)
          Make a currently persistent entity object transient.
 

Method Detail

findById

T findById(ID id,
           boolean lock)
Find an entity object given the entity's ID.

Parameters:
id -
lock -
Returns:

findAll

java.util.List<T> findAll()
List of all of the entities.

Returns:
A list of the entities.

findByExample

java.util.List<T> findByExample(T exampleInstance,
                                java.lang.String... excludeProperty)
Find an entity by example.

Parameters:
exampleInstance -
excludeProperty -
Returns:

makePersistent

T makePersistent(T entity)
Make an entity object persistent.

Parameters:
entity - The entity object to persist
Returns:
A reference to the persisted entity object

makeTransient

void makeTransient(T entity)
Make a currently persistent entity object transient.

Parameters:
entity - The entity object to make persistent

flush

void flush()
Affects every managed instance in the current persistence context!


clear

void clear()
Affects every managed instance in the current persistence context!



Copyright © 2004-2007 David Irwin. All Rights Reserved.