wt.dataops.objectcol.resolution
Class RelationshipQueryProcessor

java.lang.Object
  extended bywt.dataops.objectcol.resolution.AbsResolutionProcessor
      extended bywt.dataops.objectcol.resolution.BaseQueryProcessor
          extended bywt.dataops.objectcol.resolution.RelationshipQueryProcessor
All Implemented Interfaces:
CollectionQueryProcessor, Externalizable, RecursiveQueryProcessor, ResolutionProcessor, Serializable
Direct Known Subclasses:
O2VLinkAllIterDelegate, RelatedByRelationshipProcessor

public class RelationshipQueryProcessor
extends BaseQueryProcessor
implements RecursiveQueryProcessor, Externalizable



Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
private static String CLASSNAME
           
protected static String DOT
           
static long EXTERNALIZATION_VERSION_UID
           
protected  boolean firstTime
           
protected  LinkInfo linkInfo
           
protected static String O2O_ROLE_A_ATTR_NAME
           
protected static String O2O_ROLE_B_ATTR_NAME
           
private  Persistable[] objectsToExclude
           
protected static long OLD_FORMAT_VERSION_UID
           
private  String otherRole
           
private  Map recurseMap
           
private  boolean recursive
           
private  Class relClass
           
protected  Persistable[] resolvedSeeds
           
private static String RESOURCE
           
private  String roleName
           
private  Persistable[] seedObjects
           
private  Map seedTypes
           
(package private) static long serialVersionUID
           
protected  boolean shouldRecurseNow
           
 
Fields inherited from class wt.dataops.objectcol.resolution.AbsResolutionProcessor
 
Constructor Summary
RelationshipQueryProcessor()
           
 
Method Summary
protected  void appendRelationshipSeedJoin(QuerySpec spec, Persistable lseed, int relIdx)
           
protected  int appendRelationshipTargetJoin(QuerySpec spec)
           
protected  void appendRelationshipTargetJoinCondition(QuerySpec spec, Class relClass, int relIdx, Class tgtClass, int tgtIdx)
           
protected  boolean decideShouldRecurseNow(Class clazz)
           
protected  boolean decideShouldRecurseNow(StatementSpecHolder[] ispecs)
           
protected  int findRelationshipClassIndex(QuerySpec spec)
           
protected  void findSeedsRecursively(Persistable seed, Class seedType, WTSet allseeds)
           
protected  String getAttrNameForRole(String roleName)
           
protected  ObjectIdentifier getObjectIdentifier(Persistable obj)
           
 Persistable[] getObjectsToExclude()
          Gets the value of the attribute: objectsToExclude.
protected  String getOtherRole()
           
protected  String getOtherRole(String roleOne)
           
 Map getRecurseMap()
          Gets the value of the attribute: recurseMap.
 Class getRelClass()
          Gets the value of the attribute: relClass.
 String getRoleName()
          Gets the value of the attribute: roleName.
 Persistable[] getSeedObjects()
          Gets the value of the attribute: seedObjects.
 Map getSeedTypes()
          Gets the value of the attribute: seedTypes.
 void initialize(Class relClass, String roleName, Persistable[] seeds, Map seedTypes, boolean recursive)
          

Supported API: false
 boolean isRecursive()
          Gets the value of the attribute: recursive.
 StatementSpecHolder[] process(StatementSpecHolder[] specs, LogicalOperator operator)
          

Supported API: false
 void readExternal(ObjectInput input)
          Reads the non-transient fields of this class from an external source.
private  boolean readOldVersion(ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source, which is not the current version.
protected  boolean readVersion(RelationshipQueryProcessor thisObject, ObjectInput input, long readSerialVersionUID, boolean passThrough, boolean superDone)
          Reads the non-transient fields of this class from an external source.
protected  Class resolveRelationshipClass(Class tgtClass)
           
protected  Persistable[] resolveSeeds()
           
protected  Persistable[] resolveSeedsToRecurse(Persistable[] inseeds, boolean parentChoice)
           
private  void roleNameValidate(String a_RoleName)
           
 void setObjectsToExclude(Persistable[] a_ObjectsToExclude)
          Sets the value of the attribute: objectsToExclude.
 void setRecurseMap(Map a_RecurseMap)
          Sets the value of the attribute: recurseMap.
 void setRecursive(boolean a_Recursive)
          Sets the value of the attribute: recursive.
 void setRelClass(Class a_RelClass)
          Sets the value of the attribute: relClass.
 void setRoleName(String a_RoleName)
          Sets the value of the attribute: roleName.
 void setSeedObjects(Persistable[] a_SeedObjects)
          Sets the value of the attribute: seedObjects.
 void setSeeds(Persistable[] seeds)
          

Supported API: false
 void setSeedTypes(Map a_SeedTypes)
          Sets the value of the attribute: seedTypes.
protected  StatementSpecHolder updateQuerySpecWithRel(StatementSpecHolder specHolder, boolean recursive, LogicalOperator operator, List allspecs, boolean firstTime)
           
protected  StatementSpec updateQuerySpecWithRel(StatementSpecHolder specHolder, QuerySpec spec, boolean recursive, LogicalOperator operator, List allspecs, boolean firstTime)
           
 void writeExternal(ObjectOutput output)
          Writes the non-transient fields of this class to an external source.
 
Methods inherited from class wt.dataops.objectcol.resolution.BaseQueryProcessor
initialize, readVersion
 
Methods inherited from class wt.dataops.objectcol.resolution.AbsResolutionProcessor
getInputMap, getInputs, readVersion, setInputMap, setInputs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface wt.dataops.objectcol.resolution.ResolutionProcessor
getInputMap, setInputMap
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

relClass

private Class relClass

roleName

private String roleName

seedObjects

private Persistable[] seedObjects

recursive

private boolean recursive

seedTypes

private Map seedTypes

recurseMap

private Map recurseMap

objectsToExclude

private Persistable[] objectsToExclude

serialVersionUID

static final long serialVersionUID
See Also:
Constant Field Values

EXTERNALIZATION_VERSION_UID

public static final long EXTERNALIZATION_VERSION_UID
See Also:
Constant Field Values

OLD_FORMAT_VERSION_UID

protected static final long OLD_FORMAT_VERSION_UID
See Also:
Constant Field Values

linkInfo

protected LinkInfo linkInfo

DOT

protected static final String DOT
See Also:
Constant Field Values

O2O_ROLE_A_ATTR_NAME

protected static final String O2O_ROLE_A_ATTR_NAME
See Also:
Constant Field Values

O2O_ROLE_B_ATTR_NAME

protected static final String O2O_ROLE_B_ATTR_NAME
See Also:
Constant Field Values

otherRole

private String otherRole

firstTime

protected boolean firstTime

shouldRecurseNow

protected boolean shouldRecurseNow

resolvedSeeds

protected Persistable[] resolvedSeeds
Constructor Detail

RelationshipQueryProcessor

public RelationshipQueryProcessor()
Method Detail

writeExternal

public void writeExternal(ObjectOutput output)
                   throws IOException
Writes the non-transient fields of this class to an external source.

Supported API: false

Specified by:
writeExternal in interface Externalizable
Overrides:
writeExternal in class BaseQueryProcessor
Parameters:
output -
Throws:
IOException

readExternal

public void readExternal(ObjectInput input)
                  throws IOException,
                         ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Specified by:
readExternal in interface Externalizable
Overrides:
readExternal in class BaseQueryProcessor
Parameters:
input -
Throws:
IOException
ClassNotFoundException

readVersion

protected boolean readVersion(RelationshipQueryProcessor thisObject,
                              ObjectInput input,
                              long readSerialVersionUID,
                              boolean passThrough,
                              boolean superDone)
                       throws IOException,
                              ClassNotFoundException
Reads the non-transient fields of this class from an external source.

Supported API: false

Parameters:
thisObject -
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

readOldVersion

private boolean readOldVersion(ObjectInput input,
                               long readSerialVersionUID,
                               boolean passThrough,
                               boolean superDone)
                        throws IOException,
                               ClassNotFoundException
Reads the non-transient fields of this class from an external source, which is not the current version.

Parameters:
input -
readSerialVersionUID -
passThrough -
superDone -
Returns:
boolean
Throws:
IOException
ClassNotFoundException

getRelClass

public Class getRelClass()
Gets the value of the attribute: relClass.

Supported API: false

Returns:
Class

setRelClass

public void setRelClass(Class a_RelClass)
                 throws WTPropertyVetoException
Sets the value of the attribute: relClass.

Supported API: false

Parameters:
a_RelClass -
Throws:
WTPropertyVetoException

getRoleName

public String getRoleName()
Gets the value of the attribute: roleName.

Supported API: false

Returns:
String

setRoleName

public void setRoleName(String a_RoleName)
                 throws WTPropertyVetoException
Sets the value of the attribute: roleName.

Supported API: false

Parameters:
a_RoleName -
Throws:
WTPropertyVetoException

roleNameValidate

private void roleNameValidate(String a_RoleName)
                       throws WTPropertyVetoException
Parameters:
a_RoleName -
Throws:
WTPropertyVetoException

getSeedObjects

public Persistable[] getSeedObjects()
Gets the value of the attribute: seedObjects.

Supported API: false

Returns:
Persistable[]

setSeedObjects

public void setSeedObjects(Persistable[] a_SeedObjects)
                    throws WTPropertyVetoException
Sets the value of the attribute: seedObjects.

Supported API: false

Parameters:
a_SeedObjects -
Throws:
WTPropertyVetoException

isRecursive

public boolean isRecursive()
Gets the value of the attribute: recursive.

Supported API: false

Returns:
boolean

setRecursive

public void setRecursive(boolean a_Recursive)
                  throws WTPropertyVetoException
Sets the value of the attribute: recursive.

Supported API: false

Parameters:
a_Recursive -
Throws:
WTPropertyVetoException

getSeedTypes

public Map getSeedTypes()
Gets the value of the attribute: seedTypes.

Supported API: false

Returns:
Map

setSeedTypes

public void setSeedTypes(Map a_SeedTypes)
                  throws WTPropertyVetoException
Sets the value of the attribute: seedTypes.

Supported API: false

Parameters:
a_SeedTypes -
Throws:
WTPropertyVetoException

getRecurseMap

public Map getRecurseMap()
Gets the value of the attribute: recurseMap.

Supported API: false

Returns:
Map

setRecurseMap

public void setRecurseMap(Map a_RecurseMap)
                   throws WTPropertyVetoException
Sets the value of the attribute: recurseMap.

Supported API: false

Parameters:
a_RecurseMap -
Throws:
WTPropertyVetoException

getObjectsToExclude

public Persistable[] getObjectsToExclude()
Gets the value of the attribute: objectsToExclude.

Supported API: false

Returns:
Persistable[]

setObjectsToExclude

public void setObjectsToExclude(Persistable[] a_ObjectsToExclude)
                         throws WTPropertyVetoException
Sets the value of the attribute: objectsToExclude.

Supported API: false

Parameters:
a_ObjectsToExclude -
Throws:
WTPropertyVetoException

initialize

public void initialize(Class relClass,
                       String roleName,
                       Persistable[] seeds,
                       Map seedTypes,
                       boolean recursive)
                throws WTException


Supported API: false

Parameters:
relClass -
roleName -
seeds -
seedTypes -
recursive -
Throws:
WTException

setSeeds

public void setSeeds(Persistable[] seeds)
              throws WTException


Supported API: false

Specified by:
setSeeds in interface RecursiveQueryProcessor
Parameters:
seeds -
Throws:
WTException

process

public StatementSpecHolder[] process(StatementSpecHolder[] specs,
                                     LogicalOperator operator)
                              throws WTException,
                                     QueryException
Description copied from interface: CollectionQueryProcessor


Supported API: false

Specified by:
process in interface CollectionQueryProcessor
Overrides:
process in class BaseQueryProcessor
Parameters:
specs -
operator -
Returns:
StatementSpecHolder[]
Throws:
QueryException
WTException

updateQuerySpecWithRel

protected StatementSpecHolder updateQuerySpecWithRel(StatementSpecHolder specHolder,
                                                     boolean recursive,
                                                     LogicalOperator operator,
                                                     List allspecs,
                                                     boolean firstTime)
                                              throws WTException,
                                                     QueryException
Throws:
WTException
QueryException

updateQuerySpecWithRel

protected StatementSpec updateQuerySpecWithRel(StatementSpecHolder specHolder,
                                               QuerySpec spec,
                                               boolean recursive,
                                               LogicalOperator operator,
                                               List allspecs,
                                               boolean firstTime)
                                        throws QueryException,
                                               WTException
Throws:
QueryException
WTException

appendRelationshipTargetJoin

protected int appendRelationshipTargetJoin(QuerySpec spec)
                                    throws WTException
Throws:
WTException

appendRelationshipSeedJoin

protected void appendRelationshipSeedJoin(QuerySpec spec,
                                          Persistable lseed,
                                          int relIdx)
                                   throws WTException
Throws:
WTException

resolveRelationshipClass

protected Class resolveRelationshipClass(Class tgtClass)
                                  throws WTException
Throws:
WTException

appendRelationshipTargetJoinCondition

protected void appendRelationshipTargetJoinCondition(QuerySpec spec,
                                                     Class relClass,
                                                     int relIdx,
                                                     Class tgtClass,
                                                     int tgtIdx)
                                              throws WTException
Throws:
WTException

getOtherRole

protected String getOtherRole(String roleOne)
                       throws WTException
Throws:
WTException

getOtherRole

protected String getOtherRole()

resolveSeeds

protected Persistable[] resolveSeeds()
                              throws WTException
Throws:
WTException

findSeedsRecursively

protected void findSeedsRecursively(Persistable seed,
                                    Class seedType,
                                    WTSet allseeds)
                             throws QueryException,
                                    WTException
Throws:
QueryException
WTException

findRelationshipClassIndex

protected int findRelationshipClassIndex(QuerySpec spec)
                                  throws WTException
Throws:
WTException

decideShouldRecurseNow

protected boolean decideShouldRecurseNow(StatementSpecHolder[] ispecs)

decideShouldRecurseNow

protected boolean decideShouldRecurseNow(Class clazz)

getAttrNameForRole

protected String getAttrNameForRole(String roleName)
                             throws WTException
Throws:
WTException

getObjectIdentifier

protected ObjectIdentifier getObjectIdentifier(Persistable obj)

resolveSeedsToRecurse

protected Persistable[] resolveSeedsToRecurse(Persistable[] inseeds,
                                              boolean parentChoice)