org.milyn.scribe
Interface Dao<E>


public interface Dao<E>

The DAO interface

Provides the most basic DAO operations to manipulate a data source.

Author:
maurice.zeijen@smies.com

Method Summary
 E delete(E entity)
          Deletes the entity instance from the datasource
 E insert(E entity)
          Inserts the entity instance in to the datasource
 E update(E entity)
          Updates the entity instance in the datasource
 

Method Detail

insert

E insert(E entity)
Inserts the entity instance in to the datasource

Parameters:
entity - The entity object to insert
Returns:
The inserted entity. The Dao should only return an entity that represents the inserted entity but is a different object then the one that was used as the parameter. If this is not the case then NULL should be returned.
Throws:
java.lang.UnsupportedOperationException - Indicates that this Dao doesn't support the insert operation.

update

E update(E entity)
Updates the entity instance in the datasource

Parameters:
entity - The entity object to update
Returns:
The updated entity. The Dao should only return an entity that represents the updated entity but is a different object then the one that was used as the parameter. If this is not the case then NULL should be returned.
Throws:
java.lang.UnsupportedOperationException - Indicates that this Dao doesn't support the update operation.

delete

E delete(E entity)
Deletes the entity instance from the datasource

Parameters:
entity - The entity object to delete
Returns:
The deleted entity. The Dao should only return an entity that represents the deleted entity but is a different object then the one that was used as the parameter. If this is not the case then NULL should be returned.
Throws:
java.lang.UnsupportedOperationException - Indicates that this Dao doesn't support the delete operation.


Copyright © 2011. All Rights Reserved.