ariba.ui.meta.persistence
Class ObjectContext
java.lang.Object
ariba.ui.meta.persistence.ObjectContext
- Direct Known Subclasses:
- JPAContext
public abstract class ObjectContext
- extends Object
ObjectContext
public ObjectContext()
get
public static ObjectContext get()
peek
public static ObjectContext peek()
create
public <T> T create(String className)
create
public <T> T create(Class<T> tClass)
recordForInsert
public void recordForInsert(Object o)
- Records object for insert on next save(). Some contexts may persist here, others
may defer the persist until just pre-save, to give the newly created object a change
to be fully initialized prior to persist()
- Parameters:
o - object instance to be inserted
userMap
public Map userMap()
- Map for storage of additional state associated with this context
merge
public abstract <T> T merge(T t)
remove
public abstract void remove(Object o)
find
public abstract <T> T find(Class<T> tClass,
Object primaryKey)
findOne
public <T> T findOne(Class<T> tClass,
Map<String,Object> fieldValues)
getPrimaryKey
public abstract Object getPrimaryKey(Object o)
save
public abstract void save()
lock
public abstract void lock(Object o)
contains
public abstract boolean contains(Object o)
executeQuery
public List executeQuery(QuerySpecification spec)
executeNamedQuery
public abstract List executeNamedQuery(String s,
Map<String,Object> params)
getDelegate
public abstract Object getDelegate()
executeQuery
public <T> List<T> executeQuery(Class<T> tClass,
Map<String,Object> fieldValues)
processorForQuery
public abstract QueryProcessor processorForQuery(QuerySpecification spec)
typeProvider
public TypeProvider typeProvider(String entityName)
registerQueryFilterProviderForEntityClass
public static void registerQueryFilterProviderForEntityClass(String entityClass,
ObjectContext.EntityQueryFilterProvider filter)
unregisterQueryFilterProviderForEntityClass
public static void unregisterQueryFilterProviderForEntityClass(String entityClass)
bind
public static void bind(ObjectContext ctx)
unbind
public static void unbind()
bindNewContext
public static void bindNewContext(String groupName)
bindNewContext
public static void bindNewContext()
bindNestedContext
public static void bindNestedContext()
createContext
public static ObjectContext createContext()
createChangeWatch
public ObjectContext.ChangeWatch createChangeWatch()
groupName_debug
public String groupName_debug()
getProvider
public static ObjectContext.Provider getProvider()
setProvider
public static void setProvider(ObjectContext.Provider provider)
createNestedContext
public ObjectContext createNestedContext()
- Create a nested ObjectContext. Nested contexts have visibility to their parent's uncommited
changes, and commit to their parent's in-memory objects rather than to to database.
Nested Contexts are useful for modal UI flows, where an operation may be cancelled and
doing so should leave the parent's objects unaffected -- by "sandboxing" these changes in
copies of objects in a nested context, the Cancel is handled by simply discarding the child context,
and Okay by doing a save().
NOTE: not all ObjectContext implementations can support Nested Contexts. (e.g. such support is
not part of the JPA EntityManager specification)
- Returns:
- the new child context instance
getParentContext
public ObjectContext getParentContext()
- Returns parent context for a nested child context
- Returns:
- the parent context, or null if not nested.
AribaWeb User Interface Development Framework
Copyright © 2000-2009 Ariba, Inc. All Rights Reserved.