com.fatwire.assetapi.query
Class SimpleQuery

java.lang.Object
  extended by com.fatwire.assetapi.query.SimpleQuery
All Implemented Interfaces:
Query

public class SimpleQuery
extends java.lang.Object
implements Query

This class presents a helpful way to create Queries based on commonly used patterns.


Constructor Summary
SimpleQuery(java.lang.String assetType, java.lang.String subtype)
          Builds Query with asset type.
SimpleQuery(java.lang.String assetType, java.lang.String subtype, Condition cond, java.util.List<java.lang.String> attributeNames)
          Builds a Query for an asset type, a Condition and a List of attributes.
SimpleQuery(java.lang.String assetType, java.lang.String subtype, Condition cond, java.util.List<java.lang.String> attributeNames, java.util.List<SortOrder> sortOrder)
          Builds a Query with all invarients specified...
 
Method Summary
 java.lang.String getAssetType()
          Returns asset type this query is built for
 java.util.List<java.lang.String> getAttributeNames()
          Lists name of the attributes requested in the Query
 Condition getCondition()
          Returns Condition for this Query, if any,
 QueryProperties getProperties()
          Gets properties associated with this Query instance.
 java.util.List<SortOrder> getSortOrder()
          Returns list of SortOrders.
 java.lang.String getSubtype()
          Returns asset type this query is built for
 void setAttributes(java.util.List<java.lang.String> attributeNames)
          Sets(resets) the names of attributes this Query uses.
 void setCondition(Condition cond)
          Sets(resets) Condition used for thsi query
 void setProperties(QueryProperties props)
           
 void setSortOrder(java.util.List<SortOrder> sort)
          Sets(resets) sort order to be used in this Query.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleQuery

public SimpleQuery(java.lang.String assetType,
                   java.lang.String subtype)
Builds Query with asset type. This query will result in all assets instances returned including all multi lingual assets.

Parameters:
assetType - name of the asset type

SimpleQuery

public SimpleQuery(java.lang.String assetType,
                   java.lang.String subtype,
                   Condition cond,
                   java.util.List<java.lang.String> attributeNames)
Builds a Query for an asset type, a Condition and a List of attributes. This query results in asset instances containing only the requested attributes satisfying a given Condition. null for attributeNames result in all attributes returned.

Parameters:
assetType - Name of the asset type
cond - data Condition to be satisfied by returning data
attributeNames - names of the attributes that will be made part of the result.

SimpleQuery

public SimpleQuery(java.lang.String assetType,
                   java.lang.String subtype,
                   Condition cond,
                   java.util.List<java.lang.String> attributeNames,
                   java.util.List<SortOrder> sortOrder)
Builds a Query with all invarients specified...

Parameters:
assetType - Name of the asset type
cond - data Condition to be satisfied by returning data
attributeNames - names of the attributes that will be made part of the result.
sortOrder - Sorting criteria.
Method Detail

getAssetType

public java.lang.String getAssetType()
Returns asset type this query is built for

Specified by:
getAssetType in interface Query
Returns:
Name of the asset type this Query is built for

getSubtype

public java.lang.String getSubtype()
Returns asset type this query is built for

Specified by:
getSubtype in interface Query
Returns:
Name of the asset type this Query is built for

getCondition

public Condition getCondition()
Returns Condition for this Query, if any,

Specified by:
getCondition in interface Query
Returns:
Condition used to build this Query

setCondition

public void setCondition(Condition cond)
Sets(resets) Condition used for thsi query

Parameters:
cond -

getAttributeNames

public java.util.List<java.lang.String> getAttributeNames()
Lists name of the attributes requested in the Query

Specified by:
getAttributeNames in interface Query
Returns:
List of attribute names

setAttributes

public void setAttributes(java.util.List<java.lang.String> attributeNames)
Sets(resets) the names of attributes this Query uses.

Parameters:
attributeNames - List of Attribute names

getSortOrder

public java.util.List<SortOrder> getSortOrder()
Returns list of SortOrders.

Specified by:
getSortOrder in interface Query
Returns:
List of SortOrders

setSortOrder

public void setSortOrder(java.util.List<SortOrder> sort)
Sets(resets) sort order to be used in this Query.

Parameters:
sort - List of SortOrder

getProperties

public QueryProperties getProperties()
Gets properties associated with this Query instance.

Specified by:
getProperties in interface Query
Returns:
properties

setProperties

public void setProperties(QueryProperties props)