public abstract class JDOSupport<T> extends Object
Modifier and Type | Class and Description |
---|---|
static class |
JDOSupport.PersistenceManagerBuilder
Manages persistence managers in a way
that doesn't cause problems when the web application is unloaded.
|
static class |
JDOSupport.TransactionAspect
Manages integration of JDO transactions with Spring.
|
static interface |
JDOSupport.WithinSingleTransaction
Mark a method (of a subclass of
JDOSupport ) as having a
transaction wrapped around it. |
Modifier | Constructor and Description |
---|---|
protected |
JDOSupport(Class<T> contextClass)
Instantiate this class, supplying it a handle to the class that will be
used to provide context for queries and accesses.
|
Modifier and Type | Method and Description |
---|---|
protected void |
delete(T value)
Delete a persistence-coupled instance of the context class.
|
protected T |
detach(T value)
Make a non-persistent (i.e., will hold its value past the end of the
transaction) copy of a persistence-coupled instance of the context class.
|
protected T |
getById(Object id)
Look up an instance of the context class by its identity.
|
protected boolean |
isPersistent()
Has this class actually been configured with a persistence manager by
Spring?
|
protected javax.jdo.Query |
namedQuery(String name)
Get an instance of a named query attached to the context class (as an
annotation).
|
protected T |
persist(T value)
Make an instance of the context class persist in the database.
|
protected javax.jdo.Query<T> |
query(String filter)
Get an instance of a query in JDOQL.
|
void |
setPersistenceManagerBuilder(JDOSupport.PersistenceManagerBuilder persistenceManagerBuilder) |
public void setPersistenceManagerBuilder(JDOSupport.PersistenceManagerBuilder persistenceManagerBuilder)
persistenceManagerBuilder
- The JDO engine to use for managing persistence.protected boolean isPersistent()
@Nonnull protected javax.jdo.Query<T> query(@Nonnull String filter)
filter
- The filter part of the query.@Nonnull protected javax.jdo.Query namedQuery(@Nonnull String name)
Query
because
not all queries return instances of the context class.name
- The name of the query.Query
@Nullable protected T persist(@Nullable T value)
value
- The instance to persist.@Nullable protected T detach(@Nullable T value)
value
- The value to decouple.@Nullable protected T getById(Object id)
id
- The identity of the object.Copyright © 2015–2018 The Apache Software Foundation. All rights reserved.