|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.errai.jpa.client.local.PersistenceContext
public class PersistenceContext
A container for all the live, in-memory objects in a particular entity manager.
Constructor Summary | |
---|---|
PersistenceContext(ErraiMetamodel mm)
Creates a new PersistenceContext that can track entities represented within the given metamodel. |
Method Summary | ||
---|---|---|
boolean |
contains(Key<?,?> key)
Returns true if this persistence context contains an entity retrievable by the given key. |
|
Set<Map.Entry<Key<?,?>,Object>> |
entrySet()
Returns the set of all entities in this persistence context. |
|
|
get(Key<X,?> key)
Looks up and returns the entity that matches the given key. |
|
|
put(Key<X,Y> key,
X object)
Stores the given object in the persistence context. |
|
void |
remove(Key<?,?> key)
Removes the entity having the given key from this persistence context. |
|
Collection<Object> |
values()
Returns the collection of all entities in this persistence context. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PersistenceContext(ErraiMetamodel mm)
mm
- The metamodel that knows about all the entity types that will be
stored in this Persistence Context. Not null.Method Detail |
---|
public <X,Y> void put(Key<X,Y> key, X object)
key
- The key to store the entity under. Care must be taken that this
key type reflects the actual runtime type of the given object.object
- The object to put into the persistence context.public void remove(Key<?,?> key)
key
- The key of the entity to remove. The key type must be an exact
match for the target object's runtime type.public <X> X get(Key<X,?> key)
key
- the key to look up. The entity type portion can be any supertype
of the matched entity. The ID is always an exact match. Must not
be null.
public boolean contains(Key<?,?> key)
get(Key)
.
key
- the identity of the entity to look for. Must not be null.
public Set<Map.Entry<Key<?,?>,Object>> entrySet()
public Collection<Object> values()
|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |