wt.fc
Class PersistenceHelper

java.lang.Object
  extended by wt.fc.PersistenceHelper
All Implemented Interfaces:
Serializable

public class PersistenceHelper
extends Object
implements Serializable

The class contains utility methods associated with the PersistenceManager.

Supported API: true

Extendable: false

See Also:
Serialized Form

Field Summary
static PersistenceManager manager
          

Supported API: true
 
Method Summary
static wt.query.NavigateSpec buildNavigateSpec(Object source, String role, Class linkClass, boolean onlyOtherSide)
          This method builds a query specification for navigating an association.
static Timestamp getCreateStamp(Persistable obj)
          Retrives the create timestamp for the given Persistable object.
static Timestamp getModifyStamp(Persistable obj)
          Retrives the modify timestamp for the given Persistable object.
static ObjectIdentifier getObjectIdentifier(Persistable obj)
          Retrives the object identifier for the given Persistable object.
static boolean isDeleted(Persistable obj)
          Returns true if the specified persistable object is marked as deleted.
static boolean isEquivalent(Persistable obj1, Persistable obj2)
          Returns true if the two given objects are equivalent persistable object.
static boolean isPersistent(Object obj)
          Returns true if the given object is Peristable and has already been saved in the database.
static boolean isPersistent(Persistable obj)
          Returns true if the given Persistable object is saved in the datastore.
static QueryResult navigate(Object source, String role, Class linkClass, boolean onlyOtherSide)
          Retrieves objects related to the specfied source object(s) role and link class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

manager

public static final PersistenceManager manager


Supported API: true

Method Detail

getCreateStamp

public static Timestamp getCreateStamp(Persistable obj)
Retrives the create timestamp for the given Persistable object.

Supported API: true

Parameters:
obj -
Returns:
Timestamp

getModifyStamp

public static Timestamp getModifyStamp(Persistable obj)
Retrives the modify timestamp for the given Persistable object.

Supported API: true

Parameters:
obj -
Returns:
Timestamp

getObjectIdentifier

public static ObjectIdentifier getObjectIdentifier(Persistable obj)
Retrives the object identifier for the given Persistable object.

Supported API: true

Parameters:
obj -
Returns:
ObjectIdentifier

isDeleted

public static boolean isDeleted(Persistable obj)
Returns true if the specified persistable object is marked as deleted.

Supported API: true

Parameters:
obj -
Returns:
boolean

isEquivalent

public static boolean isEquivalent(Persistable obj1,
                                   Persistable obj2)
Returns true if the two given objects are equivalent persistable object. Two objects are equivalent if they are Persistable and their ObjectIdentifiers are equal.

Supported API: true

Parameters:
obj1 -
obj2 -
Returns:
boolean

isPersistent

public static boolean isPersistent(Persistable obj)
Returns true if the given Persistable object is saved in the datastore.

Supported API: true

Parameters:
obj -
Returns:
boolean

isPersistent

public static boolean isPersistent(Object obj)
Returns true if the given object is Peristable and has already been saved in the database.

Supported API: true

Parameters:
obj -
Returns:
boolean

buildNavigateSpec

public static wt.query.NavigateSpec buildNavigateSpec(Object source,
                                                      String role,
                                                      Class linkClass,
                                                      boolean onlyOtherSide)
                                               throws WTException
This method builds a query specification for navigating an association.

Supported API: true

Parameters:
source - The source of the navigate operation. This argument can be a single Persistable object or a WTCollection of Persistable objects.
role - The role to navigate to.
linkClass - The association link class to navigate.
onlyOtherSide - Indicates that only the other side objects of the association should be returned. If false, then the link objects are returned (the other side object can be obtained via the link object's getter method).
Returns:
NavigateSpec
Throws:
WTException

navigate

public static QueryResult navigate(Object source,
                                   String role,
                                   Class linkClass,
                                   boolean onlyOtherSide)
                            throws WTException
Retrieves objects related to the specfied source object(s) role and link class.

Supported API: true

Parameters:
source - The source of the navigate operation. This argument can be a single Persistable object or a WTCollection of Persistable objects.
role - The role to navigate to.
linkClass - The association link class to navigate.
onlyOtherSide - Indicates that only the other side objects of the association should be returned. If false, then the link objects are returned (the other side object can be obtained via the link object's getter method).
Returns:
QueryResult
Throws:
WTException