public class RASAttributeCollectionSearchQuery extends BaseSearchQuery
Following code snippet illustrates how to build a search criteria to search by the DisplayName
RASAttributeCollectionSearchQuery query = new RASAttributeCollectionSearchQuery(RASAttributeCollectionSearchQuery.SEARCH_PROPERTY.DISPLAY_NAME, false, ComparatorType.EQUALITY, "DisplayName Value to searchBy", BaseSearchQuery.MATCHER.EXACT); getRASAttributeCollections ( query );
To build more complex search criteria, use the Constructor for complex search query.
Consider the following example to search AttributeCollections by a specific description and display name. Obviously, the two criteria (below) have to be AND-ed.
List<RASAttributeCollectionSearchQuery> list = new ArrayList<RASAttributeCollectionSearchQuery>(); list.add(new RASAttributeCollectionSearchQuery( RASAttributeCollectionSearchQuery.SEARCH_PROPERTY.DISPLAY_NAME, false, ComparatorType.EQUALITY, "The Display Name", BaseSearchQuery.MATCHER.EXACT)); list.add(new RASAttributeCollectionSearchQuery( RASAttributeCollectionSearchQuery.SEARCH_PROPERTY.DESCRIPTION, false, ComparatorType.EQUALITY, "The Description", BaseSearchQuery.MATCHER.EXACT)); RASAttributeCollectionSearchQuery query = new RASAttributeCollectionSearchQuery(list, false, false);
Similarly, we can have two criteria OR-ed as below.
List<RASAttributeCollectionSearchQuery> list = new ArrayList<RASAttributeCollectionSearchQuery>(); list.add(new RASAttributeCollectionSearchQuery( RASAttributeCollectionSearchQuery.SEARCH_PROPERTY.DISPLAY_NAME, false, ComparatorType.EQUALITY, "The Display Name", BaseSearchQuery.MATCHER.EXACT)); list.add(new RASAttributeCollectionSearchQuery( RASAttributeCollectionSearchQuery.SEARCH_PROPERTY.DESCRIPTION, false, ComparatorType.EQUALITY, "The Description", BaseSearchQuery.MATCHER.EXACT)); RASAttributeCollectionSearchQuery query = new RASAttributeCollectionSearchQuery(list, false, true);
Modifier and Type | Class and Description |
---|---|
static class |
RASAttributeCollectionSearchQuery.SEARCH_PROPERTY
Properties to search a attribute collection by.
|
SearchQuery.MATCHER
Constructor and Description |
---|
RASAttributeCollectionSearchQuery(java.util.List<RASAttributeCollectionSearchQuery> childQueries, boolean negation, boolean isORMatch)
Constructor for a complex RAS Attribute Collection Search Query
|
RASAttributeCollectionSearchQuery(RASAttributeCollectionSearchQuery.SEARCH_PROPERTY property, boolean negation, ComparatorType operator, java.lang.Object objectValue, SearchQuery.MATCHER matcher)
Constructor for a simple RAS Attribute Collection Search Query.
|
RASAttributeCollectionSearchQuery(RASAttributeCollectionSearchQuery.SEARCH_PROPERTY property, boolean negation, ComparatorType operator, java.lang.String value, SearchQuery.MATCHER matcher)
Constructor for a simple RAS Attribute Collection Search Query.
|
Modifier and Type | Method and Description |
---|---|
RASAttributeCollectionSearchQuery.SEARCH_PROPERTY |
getSearchByProperty()
Get the search property to use in the search.
|
RASAttributeCollectionSearchQuery[] |
getSearchQueryInOrder()
Get all added queries in the order they were added.
|
getBaseSearchQueryInOrder, getComparator, getEntityType, getQueries, toString
addBaseQuery, getPageInfo, getPreparedQueryId, getSearchByPropertyString, getSearchByValue, getSearchByValueObject, getSearchComparator, getSearchQueries, getSearchValueMatch, hasPageInfo, isANDMatch, isComplexQuery, isNegativeMatch, isORMatch, setPageInfo, setPreparedQueryId, unsetPageInfo
public RASAttributeCollectionSearchQuery(RASAttributeCollectionSearchQuery.SEARCH_PROPERTY property, boolean negation, ComparatorType operator, java.lang.String value, SearchQuery.MATCHER matcher)
property
- search property, See RASAttributeCollectionSearchQuery.SEARCH_PROPERTY
for list of valid valuesnegation
- whether the query result must be negated.operator
- comparison operator, See ComparatorType
for list of valid values.value
- value to be compared.matcher
- type of matcher, See MATCHER
for list of valid values.public RASAttributeCollectionSearchQuery(RASAttributeCollectionSearchQuery.SEARCH_PROPERTY property, boolean negation, ComparatorType operator, java.lang.Object objectValue, SearchQuery.MATCHER matcher)
property
- search property, See RASAttributeCollectionSearchQuery.SEARCH_PROPERTY
for list of valid valuesnegation
- whether the query result must be negated.operator
- comparison operator, See ComparatorType
for list of valid values.objectValue
- value to be compared.matcher
- type of matcher, See MATCHER
for list of valid values.public RASAttributeCollectionSearchQuery(java.util.List<RASAttributeCollectionSearchQuery> childQueries, boolean negation, boolean isORMatch)
childQueries
- child queries for the complex query.negation
- whether the query result must be negated.isORMatch
- whether the child queries are an OR match.public RASAttributeCollectionSearchQuery.SEARCH_PROPERTY getSearchByProperty()
public RASAttributeCollectionSearchQuery[] getSearchQueryInOrder()