java.lang.Object
io.ebeaninternal.server.transaction.DefaultPersistenceContext
- All Implemented Interfaces:
PersistenceContext,SpiPersistenceContext
Default implementation of PersistenceContext.
Ensures only one instance of a bean is used according to its type and unique id.
PersistenceContext lives on a Transaction and as such is expected to only have a single thread accessing it at a time. This is not expected to be used concurrently.
Duplicate beans are ones having the same type and unique id value. These are considered duplicates and replaced by the bean instance that was already loaded into the PersistenceContext.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.ebean.bean.PersistenceContext
PersistenceContext.WithOption -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidclear()voidvoidvoiddirtyBeans(SpiBeanTypeManager manager) Return the list of dirty beans held by this persistence context.voidReturn an object given its type and unique id.getWithOption(Class<?> rootType, Object id) voidputIfAbsent(Class<?> rootType, Object id, Object bean) inttoString()
-
Constructor Details
-
DefaultPersistenceContext
public DefaultPersistenceContext()Create a new PersistenceContext.
-
-
Method Details
-
beginIterate
public void beginIterate()- Specified by:
beginIteratein interfacePersistenceContext
-
endIterate
public void endIterate()- Specified by:
endIteratein interfacePersistenceContext
-
put
- Specified by:
putin interfacePersistenceContext
-
putIfAbsent
- Specified by:
putIfAbsentin interfacePersistenceContext
-
get
Return an object given its type and unique id.- Specified by:
getin interfacePersistenceContext
-
getWithOption
- Specified by:
getWithOptionin interfacePersistenceContext
-
size
- Specified by:
sizein interfacePersistenceContext
-
clear
public void clear()- Specified by:
clearin interfacePersistenceContext
-
clear
- Specified by:
clearin interfacePersistenceContext
-
deleted
- Specified by:
deletedin interfacePersistenceContext
-
clear
- Specified by:
clearin interfacePersistenceContext
-
dirtyBeans
Description copied from interface:SpiPersistenceContextReturn the list of dirty beans held by this persistence context.- Specified by:
dirtyBeansin interfaceSpiPersistenceContext
-
toString
-