|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Session
The Session represents the active interaction with a datastore.
| Method Summary | ||
|---|---|---|
void |
attach(Object o)
Attaches an object the current session |
|
Transaction |
beginTransaction()
Starts a transaction |
|
void |
clear()
Clears any pending changes to the datastore |
|
void |
clear(Object o)
Clear a specific object |
|
boolean |
contains(Object o)
Whether the object is contained within the first level cache |
|
Query |
createQuery(Class type)
Creates a query instance for the give type |
|
void |
delete(Iterable objects)
Deletes one or many objects |
|
void |
delete(Object obj)
Deletes a single object |
|
void |
disconnect()
Disconnects from the datastore. |
|
void |
flush()
Flushes any pending changes to the datastore |
|
Object |
getAttribute(Object entity,
String attributeName)
Obtains an attribute for the given entity |
|
Datastore |
getDatastore()
The Datastore that created this Session |
|
javax.persistence.FlushModeType |
getFlushMode()
Obtains the current FlushModeType |
|
MappingContext |
getMappingContext()
Obtains the MappingContext instance |
|
Object |
getNativeInterface()
|
|
Persister |
getPersister(Object o)
The persister for the given object |
|
Transaction |
getTransaction()
Obtains the current transaction instance |
|
boolean |
isConnected()
|
|
|
lock(Class<T> type,
Serializable key)
Retrieves an individual object, using a write lock to prevent loss of updates |
|
void |
lock(Object o)
Obtains a write lock on the given object |
|
List<Serializable> |
persist(Iterable objects)
Persists several objects returning their identifiers in the order specified by the Iterable |
|
Serializable |
persist(Object o)
Stores and object and returns its key |
|
|
proxy(Class<T> type,
Serializable key)
Retrieves a proxy for the given key |
|
void |
refresh(Object o)
Refreshes the given objects state |
|
|
retrieve(Class<T> type,
Serializable key)
Retrieves an individual object |
|
List |
retrieveAll(Class type,
Iterable keys)
Retrieves several objects for the specified keys |
|
List |
retrieveAll(Class type,
Serializable... keys)
Retrieves several objects for the specified keys |
|
void |
setAttribute(Object entity,
String attributeName,
Object value)
Associates an attribute with the given persistent entity. |
|
void |
setFlushMode(javax.persistence.FlushModeType flushMode)
The flush mode, defaults to FlushModeType.AUTO |
|
void |
unlock(Object o)
Releases a lock, if not called all locked objects should be released by disconnect() |
|
| Methods inherited from interface org.springframework.datastore.engine.EntityInterceptorAware |
|---|
addEntityInterceptor, setEntityInterceptors |
| Method Detail |
|---|
void setAttribute(Object entity,
String attributeName,
Object value)
entity - The persistent instance (must be associated with this Session)attributeName - The attribute namevalue - The value
Object getAttribute(Object entity,
String attributeName)
entity - The entityattributeName - The attribute
boolean isConnected()
void disconnect()
Transaction beginTransaction()
MappingContext getMappingContext()
Serializable persist(Object o)
o - The object
void refresh(Object o)
o - The object to refreshvoid attach(Object o)
o - The object to attachvoid flush()
void clear()
void clear(Object o)
o - The object to clearboolean contains(Object o)
o - The object to check
void setFlushMode(javax.persistence.FlushModeType flushMode)
flushMode - The FlushModeTypejavax.persistence.FlushModeType getFlushMode()
void lock(Object o)
o - The object to lockvoid unlock(Object o)
disconnect()
o - The object to unlockList<Serializable> persist(Iterable objects)
objects - The Objects
<T> T retrieve(Class<T> type,
Serializable key)
type - The typekey - The key
<T> T proxy(Class<T> type,
Serializable key)
type - The typekey - The key
<T> T lock(Class<T> type,
Serializable key)
type - The typekey - The key
void delete(Iterable objects)
objects - The objects to deletevoid delete(Object obj)
obj - The object to delete
List retrieveAll(Class type,
Iterable keys)
type - The typekeys - The keys
List retrieveAll(Class type,
Serializable... keys)
type - The typekeys - The keys
Query createQuery(Class type)
type - The type
Object getNativeInterface()
Persister getPersister(Object o)
o - The object
Transaction getTransaction()
Datastore getDatastore()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||