| java.lang.Object it.biobytes.ammentos.PersistenceContext
PersistenceContext | public class PersistenceContext (Code) | | author: davide |
Method Summary | |
public void | closeIteration() | public void | commitTransaction() | public int | count(Class<T> c, Query qry) | public int | count(Class<T> c, QueryFilter filter) | public void | delete(T obj) Deletes the object. | public void | delete(Class<T> c, QueryFilter filter) Deletes all the objects of class c matching the provided QueryFilter. | public FrameworkCache | getCache() | public DataSource | getDataSource() | public EntityIterable | getIterable() | protected FrameworkState | getState() | protected Transaction | getTransaction() | protected boolean | isLoaded(Class<T> c, T obj) | public Iterable<T> | iterate(Class<T> c, Query qry) | public T | load(Class<T> c, Object primaryKey) | public List<T> | load(Class<T> c, Query qry) Loads the objects which match the provided query. | public List<T> | load(Class<T> c, QueryFilter filter) Loads the objects which match the provided query. | public T | loadUnique(Class<T> c, Query qry) This method represents a shortcut for loading objects with queries when the
expected return value is only one object. | public T | loadUnique(Class<T> c, QueryFilter filter) This method represents a shortcut for loading objects with queries when the
expected return value is only one object. | public List<T> | loadUpdatable(Class<T> c, Query qry) Returns an updatable list of objects which match the provided query. | public T | lookup(Class<T> c, Object primaryKey) Lookup the object of the provided class whith the specified primary key. | protected void | markAsLoaded(Class<T> c, T obj) | public void | openTransaction() | public void | openTransaction(int isolationLevel) | public void | override(T obj) Saves the provided object instance, regardless the object is already present
into the target domain. | public void | rollbackTransaction() | public void | save(T obj) Saves the provided object instance. | protected void | setDataSource(DataSource dataSource) | protected void | setIterable(EntityIterable iterable) | protected void | setState(FrameworkState state) | protected void | setTransaction(Transaction transaction) | protected void | unmarkAsLoaded(Class<T> c, T obj) |
delete | public void delete(Class<T> c, QueryFilter filter) throws PersistenceException(Code) | | Deletes all the objects of class c matching the provided QueryFilter.
If a transaction is opened this operation will be actually
performed when the commitTransaction() method will be called
|
isLoaded | protected boolean isLoaded(Class<T> c, T obj)(Code) | | |
loadUpdatable | public List<T> loadUpdatable(Class<T> c, Query qry) throws PersistenceException(Code) | | Returns an updatable list of objects which match the provided query. By
calling add() and remove() method on this list the objects will be
respectively saved or removed from their persistor.
|
lookup | public T lookup(Class<T> c, Object primaryKey) throws PersistenceException(Code) | | Lookup the object of the provided class whith the specified primary key.
This methods uses an internal caching mechanism which dramatically increases
the performance, so use this method instead of load(Class,String) whenever
is possible to obtain the best performance in retrieving objects.
Parameters: c - Parameters: primaryKey - throws: it.biobytes.ammentos.PersistenceException - |
markAsLoaded | protected void markAsLoaded(Class<T> c, T obj)(Code) | | |
override | public void override(T obj) throws PersistenceException(Code) | | Saves the provided object instance, regardless the object is already present
into the target domain. If the object is already present the call corresponds to
a normale save() method, otherwise a delete() method followed by a new save() method
is called.
Parameters: obj - The object to override throws: it.biobytes.ammentos.PersistenceException - If any errors occurr while saving the object |
save | public void save(T obj) throws PersistenceException(Code) | | Saves the provided object instance. If a transaction is opened this operation
will be actually performed when the commitTransaction() method will be called
Parameters: obj - The object to save throws: it.biobytes.ammentos.PersistenceException - If any errors occurr while saving the object |
unmarkAsLoaded | protected void unmarkAsLoaded(Class<T> c, T obj)(Code) | | |
|
|