Class EntityCache
- java.lang.Object
-
- net.lecousin.reactive.data.relational.model.EntityCache
-
public class EntityCache extends Object
Cache of entity instances, to use the same instance when loading the same primary key in a database query.- Author:
- Guillaume Le Cousin
-
-
Constructor Summary
Constructors Constructor Description EntityCache()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> EntityInstance<T>
getInstance(T entity)
<T> EntityInstance<T>
getInstanceById(Class<T> type, Object id)
<T> EntityInstance<T>
getOrSetInstance(EntityInstance<T> instance)
Get it from cache or add it to cache.<T> void
setInstanceById(Object id, EntityInstance<T> instance)
-
-
-
Method Detail
-
getInstanceById
public <T> EntityInstance<T> getInstanceById(Class<T> type, Object id)
-
setInstanceById
public <T> void setInstanceById(Object id, EntityInstance<T> instance)
-
getOrSetInstance
public <T> EntityInstance<T> getOrSetInstance(EntityInstance<T> instance)
Get it from cache or add it to cache.
-
getInstance
public <T> EntityInstance<T> getInstance(T entity)
-
-