com.terracotta.management.dao
Interface GenericDao<T,ID extends Serializable>

All Known Subinterfaces:
UserInfoDao
All Known Implementing Classes:
IniFileUserInfoDao

public interface GenericDao<T,ID extends Serializable>

A generic dao interface for crud operations on model objects in the management application.

Author:
brandony

Method Summary
 void create(T data)
          Create the submitted obj.
 void createOrUpdate(T data)
          Create or update the submitted obj.
 void delete(T data)
          Deletes the submitted obj
 void evict(T data)
          Evicts the obj from persistent cache.
 void flush()
          Synchronizes persistence layer's state with the datastore.
 T getById(ID id)
          Returns the obj T with the given id, or null if there is no such entity.
 

Method Detail

getById

T getById(ID id)
          throws DataAccessException
Returns the obj T with the given id, or null if there is no such entity.

Parameters:
id - the id of the entity to return
Returns:
T or null
Throws:
DataAccessException

create

void create(T data)
            throws DataAccessException
Create the submitted obj.

Parameters:
data - obj to be created
Throws:
DataAccessException

createOrUpdate

void createOrUpdate(T data)
                    throws DataAccessException
Create or update the submitted obj.

Parameters:
data - the obj to create or update.
Throws:
DataAccessException

delete

void delete(T data)
            throws DataAccessException
Deletes the submitted obj

Parameters:
data - obj to delete
Throws:
DataAccessException

flush

void flush()
Synchronizes persistence layer's state with the datastore.


evict

void evict(T data)
Evicts the obj from persistent cache.

Parameters:
data - the obj to evict


Copyright © 2013 Terracotta, Inc.. All Rights Reserved.