|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.inf.container.LookupSpec
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
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 |
private static final String RESOURCE
private static final String CLASSNAME
private Class endClass
private WTContainerRef endPoint
private List orderBys
private Comparator overrideComparator
private List querySpecs
private WTContainerRef startPoint
public static final int FILTER_OVERRIDES
isFilterOverrides()
,
Constant Field Valuespublic static final int FIRST_MATCH_ONLY
isFirstMatchOnly()
,
Constant Field Valuespublic static final int ACTIVE_ONLY
getDeleteState()
,
Constant Field Valuespublic static final int DELETED_ONLY
public static final int DELETED_AND_ACTIVE
getDeleteState()
,
Constant Field Valuespublic static final int ORDER_BY_CONTAINER
isOrderByContainer()
,
Constant Field Valuespublic static final int ORDER_BY_CONTAINER_FIRST
isOrderByContainerFirst()
,
Constant Field Valuesprivate static final int DELETE_STATES
private static final int DEFAULT_MODIFIERS
private int modifiers
Constructor Detail |
public LookupSpec()
public LookupSpec(QuerySpec query_spec, WTContainerRef start_point) throws WTException
query_spec
- start_point
-
WTException
Method Detail |
public int getDeleteState()
public void setDeleteState(int a_DeleteState) throws WTPropertyVetoException
a_DeleteState
-
WTPropertyVetoException
public Class getEndClass()
endPoint
property is speciified,
then endClass
is ignored.
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.
endPoint
public void setEndClass(Class a_EndClass) throws WTPropertyVetoException
endPoint
property is speciified,
then endClass
is ignored.
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.
a_EndClass
-
WTPropertyVetoException
endPoint
public WTContainerRef getEndPoint()
startPoint
, then the endClass
property is used.
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.
endClass
public void setEndPoint(WTContainerRef a_EndPoint) throws WTPropertyVetoException
startPoint
, then the endClass
property is used.
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.
a_EndPoint
-
WTPropertyVetoException
endClass
private void endPointValidate(WTContainerRef a_EndPoint) throws WTPropertyVetoException
a_EndPoint
-
WTPropertyVetoException
public boolean isFilterOverrides()
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
OverrideComparator
,
overrideComparator
public void setFilterOverrides(boolean a_FilterOverrides) throws WTPropertyVetoException
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
a_FilterOverrides
-
WTPropertyVetoException
OverrideComparator
,
overrideComparator
public boolean isFirstMatchOnly()
Default: false
Supported API: false
public void setFirstMatchOnly(boolean a_FirstMatchOnly) throws WTPropertyVetoException
Default: false
Supported API: false
a_FirstMatchOnly
-
WTPropertyVetoException
public boolean isOrderByContainer()
orderBys
property.
When this property is false
, the firstMatchOnly
,
filterOverrides
, and orderBys
properties
are ignored.
Default: true
Supported API: false
public void setOrderByContainer(boolean a_OrderByContainer) throws WTPropertyVetoException
orderBys
property.
When this property is false
, the firstMatchOnly
,
filterOverrides
, and orderBys
properties
are ignored.
Default: true
Supported API: false
a_OrderByContainer
-
WTPropertyVetoException
public boolean isOrderByContainerFirst()
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
public void setOrderByContainerFirst(boolean a_OrderByContainerFirst) throws WTPropertyVetoException
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
a_OrderByContainerFirst
-
WTPropertyVetoException
public List getOrderBys()
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 OrderBy
s
in this List
public void setOrderBys(List a_OrderBys) throws WTPropertyVetoException
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 OrderBy
s
in this List
a_OrderBys
-
WTPropertyVetoException
public Comparator getOverrideComparator()
PropertyComparator
to filter overrides.
#filterOverrides
,
PropertyComparator
public void setOverrideComparator(Comparator a_OverrideComparator) throws WTPropertyVetoException
PropertyComparator
to filter overrides.
a_OverrideComparator
-
WTPropertyVetoException
#filterOverrides
,
PropertyComparator
public QuerySpec getQuerySpec()
querySpecs
property and the
addQuerySpec(s)
methods.
querySpecs
public void setQuerySpec(QuerySpec a_QuerySpec) throws WTPropertyVetoException
querySpecs
property and the
addQuerySpec(s)
methods.
a_QuerySpec
-
WTPropertyVetoException
querySpecs
public List getQuerySpecs()
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.
public void setQuerySpecs(List a_QuerySpecs) throws WTPropertyVetoException
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.
a_QuerySpecs
-
WTPropertyVetoException
public WTContainerRef getStartPoint()
public void setStartPoint(WTContainerRef a_StartPoint) throws WTPropertyVetoException
a_StartPoint
-
WTPropertyVetoException
private void startPointValidate(WTContainerRef a_StartPoint) throws WTPropertyVetoException
a_StartPoint
-
WTPropertyVetoException
public boolean addOrderBy(OrderBy order_by)
order_by
-
orderBys
public boolean addOrderBys(OrderBy[] order_bys)
order_bys
-
orderBys
public boolean addQuerySpec(QuerySpec query_spec)
query_spec
-
querySpecs
public boolean addQuerySpecs(QuerySpec[] query_specs)
query_specs
-
querySpecs
public Object clone() throws CloneNotSupportedException
CloneNotSupportedException
public String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |