wt.inf.container
Class LookupSpec

java.lang.Object
  extended bywt.inf.container.LookupSpec
All Implemented Interfaces:
Cloneable, Serializable

public final class LookupSpec
extends Object
implements Cloneable, Serializable

Encapsulates the criteria needed to do a container-based lookup. The lookup will execute the queries in the querySpecs property in each container starting with startPoint and ending with endPoint. Usage //find all docs in proj and its parents Project2 proj = getProjectToStartIn(); //build a query for documents, this query will be executed in proj &its parents QuerySpec qs = new QuerySpec(WTDocumentMaster.class); LookupSpec ls = new LookupSpec(qs,WTContainerRef.newWTContainerRef(proj)); QueryResult qr = WTContainerHelper.service.lookup(ls); //filter out "overridden" docs. by default this is done by comparing the "name" property of the objects ls.setFilterOverrides(true); qr = WTContainerHelper.service.lookup(ls); //only fiind documents named "plan" ls.setFilterOverrides(false); qs.appendWhere(new SearchCondition(WTDocumentMaster.class, WTDocumentMaster.NAME, SearchCondiiton.EQUAL, "Plan"), new int[]{0}); qr = WTContainerHelper.service.lookup(ls); //only return the first doc named "plan" ls.setFirstMatchOnly(true); qr = WTContainerHelper.service.lookup(ls);

Supported API: false

Extendable: false

See Also:
Serialized Form

Field Summary
static int ACTIVE_ONLY
          

Supported API: false
private static String CLASSNAME
           
private static int DEFAULT_MODIFIERS
          Select all objects, regardless of delete state.
private static int DELETE_STATES
           
static int DELETED_AND_ACTIVE
          

Supported API: false
static int DELETED_ONLY
          Only select objects that are marked for delete.
private  Class endClass
           
private  WTContainerRef endPoint
           
static int FILTER_OVERRIDES
          

Supported API: false
static int FIRST_MATCH_ONLY
          

Supported API: false
private  int modifiers
           
static int ORDER_BY_CONTAINER
          

Supported API: false
static int ORDER_BY_CONTAINER_FIRST
          

Supported API: false
private  List orderBys
           
private  Comparator overrideComparator
           
private  List querySpecs
           
private static String RESOURCE
           
private  WTContainerRef startPoint
           
 
Constructor Summary
LookupSpec()
          

Supported API: false
LookupSpec(QuerySpec query_spec, WTContainerRef start_point)
          

Supported API: false
 
Method Summary
 boolean addOrderBy(OrderBy order_by)
          

Supported API: false
 boolean addOrderBys(OrderBy[] order_bys)
          

Supported API: false
 boolean addQuerySpec(QuerySpec query_spec)
          

Supported API: false
 boolean addQuerySpecs(QuerySpec[] query_specs)
          

Supported API: false
 Object clone()
          

Supported API: false
private  void endPointValidate(WTContainerRef a_EndPoint)
           
 int getDeleteState()
          Gets the value of the attribute: deleteState; Determines how mark for deleted containers are handled.
 Class getEndClass()
          Gets the value of the attribute: endClass; The class of parent container to stop searching at.
 WTContainerRef getEndPoint()
          Gets the value of the attribute: endPoint; The parent container to stop searching at.
 List getOrderBys()
          Gets the value of the attribute: orderBys; If there are mulitple specs in the querySpecs collection, then this property can be used to order their results.
 Comparator getOverrideComparator()
          Gets the value of the attribute: overrideComparator; If unspecified, the lookup will use a default instance of PropertyComparator to filter overrides.
 QuerySpec getQuerySpec()
          Deprecated. Replaced by the querySpecs property and the addQuerySpec(s) methods.
 List getQuerySpecs()
          Gets the value of the attribute: querySpecs; The queries to be executed in each container in the hierarchy.
 WTContainerRef getStartPoint()
          Gets the value of the attribute: startPoint; The container at which to start the lookup.
 boolean isFilterOverrides()
          Gets the value of the attribute: filterOverrides; Whether or not objects that are "overridden" by objects in child containers are returned.
 boolean isFirstMatchOnly()
          Gets the value of the attribute: firstMatchOnly; Whether or not only the first matching result should be returned.
 boolean isOrderByContainer()
          Gets the value of the attribute: orderByContainer; When true, the results of the lookup are ordered first by container, and then by any additional order bys specified in the orderBys property.
 boolean isOrderByContainerFirst()
          Gets the value of the attribute: orderByContainerFirst; Determines how the container sorting is prioirtized.
 void setDeleteState(int a_DeleteState)
          Sets the value of the attribute: deleteState; Determines how mark for deleted containers are handled.
 void setEndClass(Class a_EndClass)
          Sets the value of the attribute: endClass; The class of parent container to stop searching at.
 void setEndPoint(WTContainerRef a_EndPoint)
          Sets the value of the attribute: endPoint; The parent container to stop searching at.
 void setFilterOverrides(boolean a_FilterOverrides)
          Sets the value of the attribute: filterOverrides; Whether or not objects that are "overridden" by objects in child containers are returned.
 void setFirstMatchOnly(boolean a_FirstMatchOnly)
          Sets the value of the attribute: firstMatchOnly; Whether or not only the first matching result should be returned.
 void setOrderByContainer(boolean a_OrderByContainer)
          Sets the value of the attribute: orderByContainer; When true, the results of the lookup are ordered first by container, and then by any additional order bys specified in the orderBys property.
 void setOrderByContainerFirst(boolean a_OrderByContainerFirst)
          Sets the value of the attribute: orderByContainerFirst; Determines how the container sorting is prioirtized.
 void setOrderBys(List a_OrderBys)
          Sets the value of the attribute: orderBys; If there are mulitple specs in the querySpecs collection, then this property can be used to order their results.
 void setOverrideComparator(Comparator a_OverrideComparator)
          Sets the value of the attribute: overrideComparator; If unspecified, the lookup will use a default instance of PropertyComparator to filter overrides.
 void setQuerySpec(QuerySpec a_QuerySpec)
          Deprecated. Replaced by the querySpecs property and the addQuerySpec(s) methods.
 void setQuerySpecs(List a_QuerySpecs)
          Sets the value of the attribute: querySpecs; The queries to be executed in each container in the hierarchy.
 void setStartPoint(WTContainerRef a_StartPoint)
          Sets the value of the attribute: startPoint; The container at which to start the lookup.
private  void startPointValidate(WTContainerRef a_StartPoint)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RESOURCE

private static final String RESOURCE
See Also:
Constant Field Values

CLASSNAME

private static final String CLASSNAME

endClass

private Class endClass

endPoint

private WTContainerRef endPoint

orderBys

private List orderBys

overrideComparator

private Comparator overrideComparator

querySpecs

private List querySpecs

startPoint

private WTContainerRef startPoint

FILTER_OVERRIDES

public static final int FILTER_OVERRIDES


Supported API: false

See Also:
isFilterOverrides(), Constant Field Values

FIRST_MATCH_ONLY

public static final int FIRST_MATCH_ONLY


Supported API: false

See Also:
isFirstMatchOnly(), Constant Field Values

ACTIVE_ONLY

public static final int ACTIVE_ONLY


Supported API: false

See Also:
getDeleteState(), Constant Field Values

DELETED_ONLY

public static final int DELETED_ONLY
Only select objects that are marked for delete.

Supported API: false

See Also:
Constant Field Values

DELETED_AND_ACTIVE

public static final int DELETED_AND_ACTIVE


Supported API: false

See Also:
getDeleteState(), Constant Field Values

ORDER_BY_CONTAINER

public static final int ORDER_BY_CONTAINER


Supported API: false

See Also:
isOrderByContainer(), Constant Field Values

ORDER_BY_CONTAINER_FIRST

public static final int ORDER_BY_CONTAINER_FIRST


Supported API: false

See Also:
isOrderByContainerFirst(), Constant Field Values

DELETE_STATES

private static final int DELETE_STATES
See Also:
Constant Field Values

DEFAULT_MODIFIERS

private static final int DEFAULT_MODIFIERS
Select all objects, regardless of delete state.

See Also:
Constant Field Values

modifiers

private int modifiers
Constructor Detail

LookupSpec

public LookupSpec()


Supported API: false


LookupSpec

public LookupSpec(QuerySpec query_spec,
                  WTContainerRef start_point)
           throws WTException


Supported API: false

Parameters:
query_spec -
start_point -
Throws:
WTException
Method Detail

getDeleteState

public int getDeleteState()
Gets the value of the attribute: deleteState; Determines how mark for deleted containers are handled. The options are: Note that unrestorable containers are never included.

Supported API: false

Returns:
int

setDeleteState

public void setDeleteState(int a_DeleteState)
                    throws WTPropertyVetoException
Sets the value of the attribute: deleteState; Determines how mark for deleted containers are handled. The options are: Note that unrestorable containers are never included.

Supported API: false

Parameters:
a_DeleteState -
Throws:
WTPropertyVetoException

getEndClass

public Class getEndClass()
Gets the value of the attribute: endClass; The class of parent container to stop searching at. If the endPoint property is speciified, then endClass is ignored.
If neither endPoint nor endClass are specified, then the default end class is used. The default end class is configured by the wt.inf.container.LookupSpec.defaultEndClass property in wt.properties. If this property is undefined, then the ExchangeContainer is used for an end class.


Supported API: false

Returns:
Class
See Also:
endPoint

setEndClass

public void setEndClass(Class a_EndClass)
                 throws WTPropertyVetoException
Sets the value of the attribute: endClass; The class of parent container to stop searching at. If the endPoint property is speciified, then endClass is ignored.
If neither endPoint nor endClass are specified, then the default end class is used. The default end class is configured by the wt.inf.container.LookupSpec.defaultEndClass property in wt.properties. If this property is undefined, then the ExchangeContainer is used for an end class.


Supported API: false

Parameters:
a_EndClass -
Throws:
WTPropertyVetoException
See Also:
endPoint

getEndPoint

public WTContainerRef getEndPoint()
Gets the value of the attribute: endPoint; The parent container to stop searching at. If this container is not specified or is not a parent of the startPoint, then the endClass property is used.
If neither endPoint nor endClass are specified, then the default end class is used. The default end class is configured by the wt.inf.container.LookupSpec.defaultEndClass property in wt.properties. If this property is undefined, then the ExchangeContainer is used for an end class.


Supported API: false

Returns:
WTContainerRef
See Also:
endClass

setEndPoint

public void setEndPoint(WTContainerRef a_EndPoint)
                 throws WTPropertyVetoException
Sets the value of the attribute: endPoint; The parent container to stop searching at. If this container is not specified or is not a parent of the startPoint, then the endClass property is used.
If neither endPoint nor endClass are specified, then the default end class is used. The default end class is configured by the wt.inf.container.LookupSpec.defaultEndClass property in wt.properties. If this property is undefined, then the ExchangeContainer is used for an end class.


Supported API: false

Parameters:
a_EndPoint -
Throws:
WTPropertyVetoException
See Also:
endClass

endPointValidate

private void endPointValidate(WTContainerRef a_EndPoint)
                       throws WTPropertyVetoException
Parameters:
a_EndPoint -
Throws:
WTPropertyVetoException

isFilterOverrides

public boolean isFilterOverrides()
Gets the value of the attribute: filterOverrides; Whether or not objects that are "overridden" by objects in child containers are returned. If true, then the comparator specified by the overrideComparator property is used. If no overrideComparator is specified, then the lookup will create an instance of PropertyComparator. This instance will compare the resulting objects by their "name" property. If no "name" property is found, the lookup will throw an exception. filterOverrides is ignored if firstMatchOnly is true.

Default: false

Supported API: false

Returns:
boolean
See Also:
OverrideComparator, overrideComparator

setFilterOverrides

public void setFilterOverrides(boolean a_FilterOverrides)
                        throws WTPropertyVetoException
Sets the value of the attribute: filterOverrides; Whether or not objects that are "overridden" by objects in child containers are returned. If true, then the comparator specified by the overrideComparator property is used. If no overrideComparator is specified, then the lookup will create an instance of PropertyComparator. This instance will compare the resulting objects by their "name" property. If no "name" property is found, the lookup will throw an exception. filterOverrides is ignored if firstMatchOnly is true.

Default: false

Supported API: false

Parameters:
a_FilterOverrides -
Throws:
WTPropertyVetoException
See Also:
OverrideComparator, overrideComparator

isFirstMatchOnly

public boolean isFirstMatchOnly()
Gets the value of the attribute: firstMatchOnly; Whether or not only the first matching result should be returned.

Default: false

Supported API: false

Returns:
boolean

setFirstMatchOnly

public void setFirstMatchOnly(boolean a_FirstMatchOnly)
                       throws WTPropertyVetoException
Sets the value of the attribute: firstMatchOnly; Whether or not only the first matching result should be returned.

Default: false

Supported API: false

Parameters:
a_FirstMatchOnly -
Throws:
WTPropertyVetoException

isOrderByContainer

public boolean isOrderByContainer()
Gets the value of the attribute: orderByContainer; When true, the results of the lookup are ordered first by container, and then by any additional order bys specified in the orderBys property.

When this property is false, the firstMatchOnly, filterOverrides, and orderBys properties are ignored.

Default: true

Supported API: false

Returns:
boolean

setOrderByContainer

public void setOrderByContainer(boolean a_OrderByContainer)
                         throws WTPropertyVetoException
Sets the value of the attribute: orderByContainer; When true, the results of the lookup are ordered first by container, and then by any additional order bys specified in the orderBys property.

When this property is false, the firstMatchOnly, filterOverrides, and orderBys properties are ignored.

Default: true

Supported API: false

Parameters:
a_OrderByContainer -
Throws:
WTPropertyVetoException

isOrderByContainerFirst

public boolean isOrderByContainerFirst()
Gets the value of the attribute: orderByContainerFirst; Determines how the container sorting is prioirtized. When true, the results are first sorted by container hierarchy, and then by the Collection of OrderBy instances. When false, the results are sorted by container after the other order bys are applied.

Default: true

Supported API: false

Returns:
boolean

setOrderByContainerFirst

public void setOrderByContainerFirst(boolean a_OrderByContainerFirst)
                              throws WTPropertyVetoException
Sets the value of the attribute: orderByContainerFirst; Determines how the container sorting is prioirtized. When true, the results are first sorted by container hierarchy, and then by the Collection of OrderBy instances. When false, the results are sorted by container after the other order bys are applied.

Default: true

Supported API: false

Parameters:
a_OrderByContainerFirst -
Throws:
WTPropertyVetoException

getOrderBys

public List getOrderBys()
Gets the value of the attribute: orderBys; If there are mulitple specs in the querySpecs collection, then this property can be used to order their results. If the property is specified, the resulting query is ordered first by container, and then by the OrderBys in this List

Supported API: false

Returns:
List

setOrderBys

public void setOrderBys(List a_OrderBys)
                 throws WTPropertyVetoException
Sets the value of the attribute: orderBys; If there are mulitple specs in the querySpecs collection, then this property can be used to order their results. If the property is specified, the resulting query is ordered first by container, and then by the OrderBys in this List

Supported API: false

Parameters:
a_OrderBys -
Throws:
WTPropertyVetoException

getOverrideComparator

public Comparator getOverrideComparator()
Gets the value of the attribute: overrideComparator; If unspecified, the lookup will use a default instance of PropertyComparator to filter overrides.

Supported API: false

Returns:
Comparator
See Also:
#filterOverrides, PropertyComparator

setOverrideComparator

public void setOverrideComparator(Comparator a_OverrideComparator)
                           throws WTPropertyVetoException
Sets the value of the attribute: overrideComparator; If unspecified, the lookup will use a default instance of PropertyComparator to filter overrides.

Supported API: false

Parameters:
a_OverrideComparator -
Throws:
WTPropertyVetoException
See Also:
#filterOverrides, PropertyComparator

getQuerySpec

public QuerySpec getQuerySpec()
Deprecated. Replaced by the querySpecs property and the addQuerySpec(s) methods.

Gets the value of the attribute: querySpec;

Supported API: false

Returns:
QuerySpec
See Also:
querySpecs

setQuerySpec

public void setQuerySpec(QuerySpec a_QuerySpec)
                  throws WTPropertyVetoException
Deprecated. Replaced by the querySpecs property and the addQuerySpec(s) methods.

Sets the value of the attribute: querySpec;

Supported API: false

Parameters:
a_QuerySpec -
Throws:
WTPropertyVetoException
See Also:
querySpecs

getQuerySpecs

public List getQuerySpecs()
Gets the value of the attribute: querySpecs; The queries to be executed in each container in the hierarchy. If there is more than one QuerySpec, the results of each query will be unioned together. For each QuerySpec, the class at from index 0 must be the class that is to be looked up.

Supported API: false

Returns:
List

setQuerySpecs

public void setQuerySpecs(List a_QuerySpecs)
                   throws WTPropertyVetoException
Sets the value of the attribute: querySpecs; The queries to be executed in each container in the hierarchy. If there is more than one QuerySpec, the results of each query will be unioned together. For each QuerySpec, the class at from index 0 must be the class that is to be looked up.

Supported API: false

Parameters:
a_QuerySpecs -
Throws:
WTPropertyVetoException

getStartPoint

public WTContainerRef getStartPoint()
Gets the value of the attribute: startPoint; The container at which to start the lookup.

Supported API: false

Returns:
WTContainerRef

setStartPoint

public void setStartPoint(WTContainerRef a_StartPoint)
                   throws WTPropertyVetoException
Sets the value of the attribute: startPoint; The container at which to start the lookup.

Supported API: false

Parameters:
a_StartPoint -
Throws:
WTPropertyVetoException

startPointValidate

private void startPointValidate(WTContainerRef a_StartPoint)
                         throws WTPropertyVetoException
Parameters:
a_StartPoint -
Throws:
WTPropertyVetoException

addOrderBy

public boolean addOrderBy(OrderBy order_by)


Supported API: false

Parameters:
order_by -
Returns:
boolean
See Also:
orderBys

addOrderBys

public boolean addOrderBys(OrderBy[] order_bys)


Supported API: false

Parameters:
order_bys -
Returns:
boolean
See Also:
orderBys

addQuerySpec

public boolean addQuerySpec(QuerySpec query_spec)


Supported API: false

Parameters:
query_spec -
Returns:
boolean
See Also:
querySpecs

addQuerySpecs

public boolean addQuerySpecs(QuerySpec[] query_specs)


Supported API: false

Parameters:
query_specs -
Returns:
boolean
See Also:
querySpecs

clone

public Object clone()
             throws CloneNotSupportedException


Supported API: false

Returns:
Object
Throws:
CloneNotSupportedException

toString

public String toString()