org.janux.bus.persistence
Interface GenericDaoWrite<T,ID extends Serializable>

Type Parameters:
T - The type of the domain object for which this instance is to be used.
ID - The type of the id of the domain object for which this instance is to be used.
All Known Subinterfaces:
AccountDaoGeneric<T>, AccountPartyDaoGeneric<T>, CityDaoGeneric<T>, CountryDaoGeneric<T>, OrganizationDaoGeneric<T>, PartyDaoGeneric<T>, PermissionContextDaoGeneric<T>, PersonDaoGeneric<T>, PostalAddressDaoGeneric<T>, RoleDaoGeneric<T>, StateProvinceDaoGeneric<T>

public interface GenericDaoWrite<T,ID extends Serializable>

Interface for a Data Access Object that can be used for a single specified type domain object for write operations. A single instance implementing this interface can be used only for the type of domain object specified in the type parameters.

Author:
Daniel Mora

Method Summary
 void attachClean(T persistentObject)
          Reattach an object with the current session.
 void clear()
           
 void delete(T persistentObject)
          deletes an object from persistent storage
 void evict(T persistentObject)
           
 void flush()
           
 T merge(T persistentObject)
          Copied from the Hibernate docs: Copy the state of the given object onto the persistent object with the same identifier.
 void refresh(T persistentObject)
          Retrieves an object from persistent storage and refreshes its state in memory
 T save(T persistentObject)
          Saves an object into persistent storage
 T saveOrUpdate(T persistentObject)
          Used when it is desireable to save objects, whether or not they have been saved before or not; this method will first check whether the object already exists in storage, and will than call Save or Update, accordingly
 T update(T persistentObject)
          Updates an already existing object, throws an exception if the object has not yet been saved
 

Method Detail

update

T update(T persistentObject)
         throws DataAccessException
Updates an already existing object, throws an exception if the object has not yet been saved

Throws:
DataAccessException

save

T save(T persistentObject)
       throws DataAccessException
Saves an object into persistent storage

Throws:
DataAccessException

saveOrUpdate

T saveOrUpdate(T persistentObject)
               throws DataAccessException
Used when it is desireable to save objects, whether or not they have been saved before or not; this method will first check whether the object already exists in storage, and will than call Save or Update, accordingly

Throws:
DataAccessException

delete

void delete(T persistentObject)
            throws DataAccessException
deletes an object from persistent storage

Throws:
DataAccessException

refresh

void refresh(T persistentObject)
             throws DataAccessException
Retrieves an object from persistent storage and refreshes its state in memory

Throws:
DataAccessException

merge

T merge(T persistentObject)
        throws DataAccessException
Copied from the Hibernate docs: Copy the state of the given object onto the persistent object with the same identifier. If there is no persistent instance currently associated with the session, it will be loaded. Return the persistent instance. If the given instance is unsaved, save a copy of and return it as a newly persistent instance. The given instance does not become associated with the session. The semantics of this method are defined by JSR-220.

Throws:
DataAccessException

evict

void evict(T persistentObject)
           throws DataAccessException
Throws:
DataAccessException

flush

void flush()

clear

void clear()

attachClean

void attachClean(T persistentObject)
                 throws DataAccessException
Reattach an object with the current session. This will not execute a select to the database so the detached instance has to be unmodified.

Parameters:
persistentObject -
Throws:
DataAccessException


Copyright © 2005-2013 Janux. All Rights Reserved.