|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.springframework.datastore.engine.EntityPersister
public abstract class EntityPersister
A Persister
specificly for persisting PersistentEntity instances
Field Summary | |
---|---|
protected List<EntityInterceptor> |
interceptors
|
protected ProxyFactory |
proxyFactory
|
protected Session |
session
|
Constructor Summary | |
---|---|
EntityPersister(MappingContext mappingContext,
PersistentEntity entity,
Session session)
|
Method Summary | |
---|---|
void |
addEntityInterceptor(EntityInterceptor interceptor)
Adds an EntityInterceptor |
protected EntityAccess |
createEntityAccess(PersistentEntity persistentEntity,
Object obj)
|
void |
delete(Iterable objects)
Deletes one or many objects |
void |
delete(Object obj)
Deletes a single object |
protected abstract void |
deleteEntities(PersistentEntity persistentEntity,
Iterable objects)
|
protected abstract void |
deleteEntity(PersistentEntity persistentEntity,
Object obj)
|
MappingContext |
getMappingContext()
|
Serializable |
getObjectIdentifier(Object obj)
Obtains an objects identifer |
PersistentEntity |
getPersistentEntity()
|
ProxyFactory |
getProxyFactory()
|
Class |
getType()
The type this persister persists |
List<Serializable> |
persist(Iterable objs)
Persists a number of objects at the same time and returns their keys in the order specified by the objs parameter |
Serializable |
persist(Object obj)
Persists an object returning the identifier |
protected abstract List<Serializable> |
persistEntities(PersistentEntity persistentEntity,
Iterable objs)
|
protected abstract Serializable |
persistEntity(PersistentEntity persistentEntity,
Object obj)
Persist the given persistent entity |
Object |
retrieve(Serializable key)
Retrieves an object for the given context and Key |
List<Object> |
retrieveAll(Iterable<Serializable> keys)
Batch retrieve several objects in one go |
List<Object> |
retrieveAll(Serializable[] keys)
Batch retrieve several objects in one go |
protected abstract List<Object> |
retrieveAllEntities(PersistentEntity persistentEntity,
Iterable<Serializable> keys)
|
protected abstract List<Object> |
retrieveAllEntities(PersistentEntity persistentEntity,
Serializable[] keys)
|
protected abstract Object |
retrieveEntity(PersistentEntity persistentEntity,
Serializable key)
Retrieve a PersistentEntity for the given mappingContext and key |
void |
setEntityInterceptors(List<EntityInterceptor> interceptors)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.springframework.datastore.engine.Persister |
---|
createQuery, proxy, refresh |
Field Detail |
---|
protected List<EntityInterceptor> interceptors
protected Session session
protected ProxyFactory proxyFactory
Constructor Detail |
---|
public EntityPersister(MappingContext mappingContext, PersistentEntity entity, Session session)
Method Detail |
---|
public ProxyFactory getProxyFactory()
public void addEntityInterceptor(EntityInterceptor interceptor)
EntityInterceptorAware
EntityInterceptor
addEntityInterceptor
in interface EntityInterceptorAware
interceptor
- The interceptor to addpublic void setEntityInterceptors(List<EntityInterceptor> interceptors)
setEntityInterceptors
in interface EntityInterceptorAware
interceptors
- A list of entity interceptorspublic MappingContext getMappingContext()
public PersistentEntity getPersistentEntity()
public Class getType()
Persister
getType
in interface Persister
public Serializable getObjectIdentifier(Object obj)
obj
- The object
public final Serializable persist(Object obj)
persist
in interface Persister
obj
- The object to persist
public List<Serializable> persist(Iterable objs)
Persister
persist
in interface Persister
objs
- The objects
public List<Object> retrieveAll(Iterable<Serializable> keys)
Persister
retrieveAll
in interface Persister
keys
- The keys
public List<Object> retrieveAll(Serializable[] keys)
Persister
retrieveAll
in interface Persister
keys
- The keys
protected abstract List<Object> retrieveAllEntities(PersistentEntity persistentEntity, Serializable[] keys)
protected abstract List<Object> retrieveAllEntities(PersistentEntity persistentEntity, Iterable<Serializable> keys)
protected abstract List<Serializable> persistEntities(PersistentEntity persistentEntity, Iterable objs)
public final Object retrieve(Serializable key)
Persister
retrieve
in interface Persister
key
- The key
protected abstract Object retrieveEntity(PersistentEntity persistentEntity, Serializable key)
persistentEntity
- The entitykey
- The key
protected abstract Serializable persistEntity(PersistentEntity persistentEntity, Object obj)
persistentEntity
- The PersistentEntityobj
-
public final void delete(Iterable objects)
Persister
delete
in interface Persister
objects
- The objects to delete. Must all be of the same type or an exception will be thrown.public void delete(Object obj)
Persister
delete
in interface Persister
obj
- The objectprotected abstract void deleteEntity(PersistentEntity persistentEntity, Object obj)
protected abstract void deleteEntities(PersistentEntity persistentEntity, Iterable objects)
protected EntityAccess createEntityAccess(PersistentEntity persistentEntity, Object obj)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |