org.jtheque.core.managers.persistence.context
Interface IDaoPersistenceContext

All Known Implementing Classes:
DaoPersistenceContext

public interface IDaoPersistenceContext

A dao persistence context specification.

Author:
Baptiste Wicht

Method Summary
 boolean delete(java.lang.String table, Entity d)
          Delete an Entity.
 boolean delete(java.lang.String table, int id)
          Delete an entity of a specific ID.
 void deleteAll(java.lang.String table)
          Delete all the entities of a certain class.
<T extends Entity>
T
getDataByID(java.lang.String table, int id, org.springframework.jdbc.core.simple.ParameterizedRowMapper<T> mapper)
          Return an entity of a specific ID.
<T extends Entity>
java.util.List<T>
getSortedList(java.lang.String table, org.springframework.jdbc.core.simple.ParameterizedRowMapper<T> mapper)
          Return all the entities of a certain class.
 boolean saveOrUpdate(Entity entity, QueryMapper mapper)
          Save or update an entity.
 

Method Detail

getSortedList

<T extends Entity> java.util.List<T> getSortedList(java.lang.String table,
                                                   org.springframework.jdbc.core.simple.ParameterizedRowMapper<T> mapper)
Return all the entities of a certain class.

Type Parameters:
T - The entity class type.
Parameters:
table - The entity table.
mapper - The row mapper.
Returns:
A List sorted by entity displayable text containing all the entity of the class.

getDataByID

<T extends Entity> T getDataByID(java.lang.String table,
                                 int id,
                                 org.springframework.jdbc.core.simple.ParameterizedRowMapper<T> mapper)
Return an entity of a specific ID.

Type Parameters:
T - The entity class type.
Parameters:
id - The searched id.
table - The entity table.
mapper - The row mapper.
Returns:
The entity.

delete

boolean delete(java.lang.String table,
               int id)
Delete an entity of a specific ID.

Parameters:
id - The searched id.
table - The entity table.
Returns:
true if the object is deleted else false.

delete

boolean delete(java.lang.String table,
               Entity d)
Delete an Entity.

Parameters:
d - The entity to delete.
table - The entity table.
Returns:
true if the object is deleted else false.

saveOrUpdate

boolean saveOrUpdate(Entity entity,
                     QueryMapper mapper)
Save or update an entity.

Parameters:
entity - The entity to save or update.
mapper - The query mapper.
Returns:
true if the object is saved else false.
Throws:
java.lang.IllegalArgumentException - if entity is null.

deleteAll

void deleteAll(java.lang.String table)
Delete all the entities of a certain class.

Parameters:
table - The entity table.


Copyright © 2009 JTheque. All Rights Reserved.