|
SolarMetric Kodo JDO 3.3.5 generated on August 31 2005 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--kodo.runtime.KodoHelper
Helper methods for acquiring PersistenceManagerFactory
objects and obtaining information about persistence capable instances.
These methods build on the methods in JDOHelper
.
Constructor Summary | |
KodoHelper()
|
Method Summary | |
static void |
close(Object o)
Close the given resource. |
static DataCache |
getDataCache(Object o)
Returns the DataCache for the specified instance. |
static DataCache |
getDataCache(PersistenceManager pm,
Class forClass)
Returns the DataCache for the specified class in the context
of the given persistence manager. |
static DataCache |
getDataCache(PersistenceManagerFactory pmf,
Class forClass)
Returns the DataCache for the specified class in the context
of the given persistence manager factory. |
static String |
getDetachedObjectId(Object pc)
Returns the object id from a detached instance that uses datastore identity. |
static Object |
getDetachedState(Object pc)
Returns an opaque object containg state information for detached instances. |
static int |
getLockLevel(Object o)
Return the lock level of the specified object. |
static ClassMetaData |
getMetaData(Object o)
Returns the ClassMetaData associated with the
persistent type type . |
static ClassMetaData |
getMetaData(PersistenceManager pm,
Class cls)
Returns the ClassMetaData associated with the
persistent type cls . |
static ClassMetaData |
getMetaData(PersistenceManagerFactory factory,
Class cls)
Returns the ClassMetaData associated with the
persistent type cls . |
static Object |
getObjectId(Object o)
|
static KodoPersistenceManager |
getPersistenceManager(Object o)
|
static KodoPersistenceManagerFactory |
getPersistenceManagerFactory()
Returns a KodoPersistenceManagerFactory configured
based on the properties resource named by the system property
kodo.properties , or the resource
kodo.properties if no system property is
set. |
static KodoPersistenceManagerFactory |
getPersistenceManagerFactory(File propsFile)
JDO 2.0 Preview. |
static KodoPersistenceManagerFactory |
getPersistenceManagerFactory(File propsFile,
ClassLoader loader)
JDO 2.0 Preview. |
static KodoPersistenceManagerFactory |
getPersistenceManagerFactory(Properties props)
|
static KodoPersistenceManagerFactory |
getPersistenceManagerFactory(Properties props,
ClassLoader loader)
|
static KodoPersistenceManagerFactory |
getPersistenceManagerFactory(String propsResource)
JDO 2.0 Preview. |
static KodoPersistenceManagerFactory |
getPersistenceManagerFactory(String propsResource,
ClassLoader loader)
JDO 2.0 Preview. |
static KodoPersistenceManagerFactory |
getPersistenceManagerFactory(String jndiLocation,
Context context)
JDO 2.0 Preview. |
static KodoPersistenceManagerFactory |
getPersistenceManagerFactory(String jndiLocation,
Context context,
ClassLoader loader)
JDO 2.0 Preview. |
static SequenceGenerator |
getSequenceGenerator(Object o)
Returns a SequenceGenerator for the specified instance. |
static SequenceGenerator |
getSequenceGenerator(PersistenceManager pm,
Class forClass)
Returns a SequenceGenerator for the specified persistent class. |
static Object |
getTransactionalObjectId(Object o)
|
static Object |
getVersion(Object o)
Returns the current version indicator for o . |
static boolean |
isDeleted(Object o)
|
static boolean |
isDetached(Object pc)
Returns true if pc is a detached object
(one that can be reattached to a PersistenceManager via a
call to KodoPersistenceManager.attach(java.lang.Object) ); otherwise returns
false . |
static boolean |
isDirty(Object o)
|
static boolean |
isNew(Object o)
|
static boolean |
isPersistent(Object o)
|
static boolean |
isTransactional(Object o)
|
static void |
makeDirty(Object o,
String field)
|
static void |
setDetachedObjectId(Object pc,
String id)
Set the stringified object id into the detached persistent instance. |
static void |
setDetachedState(Object pc,
Object state)
Set the state for a detached instance. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public KodoHelper()
Method Detail |
public static KodoPersistenceManagerFactory getPersistenceManagerFactory()
KodoPersistenceManagerFactory
configured
based on the properties resource named by the system property
kodo.properties
, or the resource
kodo.properties
if no system property is
set. This method is equivalent to invoking getPersistenceManagerFactory(String)
with the appropriate
resource name.public static KodoPersistenceManagerFactory getPersistenceManagerFactory(String propsResource)
KodoPersistenceManagerFactory
configured based on the properties stored in the resource at
propsResource
. This method is equivalent to
invoking getPersistenceManagerFactory(String,ClassLoader)
with
Thread.currentThread().getContextClassLoader()
as
the loader
argument.public static KodoPersistenceManagerFactory getPersistenceManagerFactory(String propsResource, ClassLoader loader)
KodoPersistenceManagerFactory
configured based on the properties stored in the resource at
propsResource
. Loads the resource via
loader
, and creates a
KodoPersistenceManagerFactory
with loader
. Any IOException
s thrown during
resource loading will be wrapped in a JDOException
.public static KodoPersistenceManagerFactory getPersistenceManagerFactory(File propsFile)
KodoPersistenceManagerFactory
configured based on the properties stored in the file at
propsResource
. This method is equivalent to
invoking getPersistenceManagerFactory(File,ClassLoader)
with
Thread.currentThread().getContextClassLoader()
as
the loader
argument.public static KodoPersistenceManagerFactory getPersistenceManagerFactory(File propsFile, ClassLoader loader)
KodoPersistenceManagerFactory
configured based on the properties stored in the file at
propsResource
. Creates a
KodoPersistenceManagerFactory
with loader
. Any
IOException
s or FileNotFouldException
s thrown
during resource loading will be wrapped in a JDOException
.public static KodoPersistenceManagerFactory getPersistenceManagerFactory(String jndiLocation, Context context)
KodoPersistenceManagerFactory
at the JNDI location specified by jndiLocation
in the
context context
. If context
is
null
, new InitialContext()
will be
used. This method is equivalent to invoking
getPersistenceManagerFactory(String,Context,ClassLoader)
with Thread.currentThread().getContextClassLoader()
as
the loader
argument.public static KodoPersistenceManagerFactory getPersistenceManagerFactory(String jndiLocation, Context context, ClassLoader loader)
KodoPersistenceManagerFactory
at the JNDI location specified by jndiLocation
in the
context context
. If context
is
null
, new InitialContext()
will be
used. Creates a KodoPersistenceManagerFactory
with
loader
. Any NamingException
s thrown
will be wrapped in a JDOException
.public static ClassMetaData getMetaData(Object o)
ClassMetaData
associated with the
persistent type type
. Equivalent to
getMetaData(KodoHelper.getPersistenceManager(o),
o.getClass())
. Returns null if o
is
null
, or is not managed.public static ClassMetaData getMetaData(PersistenceManager pm, Class cls)
ClassMetaData
associated with the
persistent type cls
. Throws an exception if
either pm
or cls
are
null
.public static ClassMetaData getMetaData(PersistenceManagerFactory factory, Class cls)
ClassMetaData
associated with the
persistent type cls
. Throws an exception if
either factory
or cls
are
null
. If no metadata exists for the class,
returns null
.public static Object getVersion(Object o)
o
.public static SequenceGenerator getSequenceGenerator(Object o)
SequenceGenerator
for the specified instance. The
object must be managed by a persistence manager.public static SequenceGenerator getSequenceGenerator(PersistenceManager pm, Class forClass)
SequenceGenerator
for the specified persistent class.public static DataCache getDataCache(Object o)
DataCache
for the specified instance. The
object must be managed by a persistence manager.public static DataCache getDataCache(PersistenceManager pm, Class forClass)
DataCache
for the specified class in the context
of the given persistence manager.public static DataCache getDataCache(PersistenceManagerFactory pmf, Class forClass)
DataCache
for the specified class in the context
of the given persistence manager factory.public static int getLockLevel(Object o)
KodoPersistenceManager
public static void close(Object o)
public static KodoPersistenceManager getPersistenceManager(Object o)
JDOHelper
public static void makeDirty(Object o, String field)
JDOHelper
public static Object getObjectId(Object o)
JDOHelper
public static Object getTransactionalObjectId(Object o)
JDOHelper
public static boolean isDirty(Object o)
JDOHelper
public static boolean isTransactional(Object o)
JDOHelper
public static boolean isPersistent(Object o)
JDOHelper
public static boolean isNew(Object o)
JDOHelper
public static boolean isDeleted(Object o)
JDOHelper
public static KodoPersistenceManagerFactory getPersistenceManagerFactory(Properties props)
JDOHelper
public static KodoPersistenceManagerFactory getPersistenceManagerFactory(Properties props, ClassLoader loader)
JDOHelper
public static boolean isDetached(Object pc)
true
if pc
is a detached object
(one that can be reattached to a PersistenceManager
via a
call to KodoPersistenceManager.attach(java.lang.Object)
); otherwise returns
false
.public static void setDetachedState(Object pc, Object state)
pc
- the detached persistent instance into which to
set the statestate
- the state to set. the state is an opaque
data structure that is implementation-specific, and
should not be modified.getDetachedState(java.lang.Object)
,
KodoPersistenceManager.attach(java.lang.Object)
,
KodoPersistenceManager.detach(java.lang.Object)
public static Object getDetachedState(Object pc)
pc
- the detached persistent instancesetDetachedState(java.lang.Object, java.lang.Object)
,
KodoPersistenceManager.attach(java.lang.Object)
,
KodoPersistenceManager.detach(java.lang.Object)
public static void setDetachedObjectId(Object pc, String id)
pc
- the detached persistent instanceid
- the stringified object idgetDetachedObjectId(java.lang.Object)
,
KodoPersistenceManager.attach(java.lang.Object)
,
KodoPersistenceManager.detach(java.lang.Object)
public static String getDetachedObjectId(Object pc)
pc
- the detached persistent instancesetDetachedObjectId(java.lang.Object, java.lang.String)
,
KodoPersistenceManager.attach(java.lang.Object)
,
KodoPersistenceManager.detach(java.lang.Object)
|
SolarMetric Kodo JDO 3.3.5 generated on August 31 2005 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |