net.smartlab.web
Interface DataAccessObject

All Known Implementing Classes:
BusinessObjectFactory, HistorizedBusinessObjectFactory

public interface DataAccessObject

This interface should be implemented by classes which provide some form of persistence.

Author:
rlogiacco,gperrone

Nested Class Summary
static class DataAccessObject.SearchInfo
          Instances of this class represents a set of criterias to be used in persistence tier searches.
 
Method Summary
 java.lang.Object findByKey(java.io.Serializable key)
          Retrieves from the persistence tier the object which primary key equals the one specified.
 java.util.Collection list(DataAccessObject.SearchInfo info)
          Returns a collection of objects representing all the persistence tier informations matching the specified search criterias.
 void remove(java.lang.Object object)
          Permanently deletes an instance from the persistence tier.
 void update(java.lang.Object object)
          Ensures the persistence tier representation of the object is consistent with the in memory representation.
 

Method Detail

findByKey

java.lang.Object findByKey(java.io.Serializable key)
                           throws DAOException
Retrieves from the persistence tier the object which primary key equals the one specified.

Parameters:
key - the primary key used to search the instance into the persistence tier.
Returns:
an object representing the datas stored in the persistence tier associated with the specified key.
Throws:
DAOException - if an error occur while accessing the persistence tier.
UndefinedKeyException - if the specified primary key is not present on the persistence tier.

remove

void remove(java.lang.Object object)
            throws DAOException
Permanently deletes an instance from the persistence tier.

Parameters:
object - the instance representing the informations to be deleted from the store.
Throws:
DAOException - if an error occur while accessing the persistence tier.

update

void update(java.lang.Object object)
            throws DAOException
Ensures the persistence tier representation of the object is consistent with the in memory representation. If the object doesn't exist yet into the persistence tier it must be added and a new primary key assigned to the object.

Parameters:
object - the object to be persisted.
Throws:
DAOException - if an error occur while accessing the persistence tier

list

java.util.Collection list(DataAccessObject.SearchInfo info)
                          throws DAOException
Returns a collection of objects representing all the persistence tier informations matching the specified search criterias.

Parameters:
info - the criterias to be used to search the persistence tier.
Returns:
a collection of matching entities.
Throws:
DAOException - if an error occur while accessing the persistence tier


Copyright © 2004-2009 The SmartWeb Team. All Rights Reserved.