T
- the class of the Liferay record(s) to be retrievedpublic abstract class MetadataQuery<T extends com.liferay.portal.model.BaseModel>
extends java.lang.Object
initDynamicQuery()
: initialize this query with a backing Liferay DynamicQuery
which will be specific to a Liferay
record (an extension of BaseModel
)execute()
: execute the DynamicQuery
and return a strongly-typed list of results (objects that extend BaseModel
.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
FIELD_NAME_DESCRIPTION |
static java.lang.String |
FIELD_NAME_FEATURE |
static java.lang.String |
FIELD_NAME_KEY |
static java.lang.String |
FIELD_NAME_LAST_UPDATED |
static java.lang.String |
FIELD_NAME_LOCALE |
static java.lang.String |
FIELD_NAME_OBJECT_ID |
static java.lang.String |
FIELD_NAME_REL |
static java.lang.String |
FIELD_NAME_SOURCE |
static java.lang.String |
FIELD_NAME_TYPE |
static java.lang.String |
FIELD_NAME_VALUE |
protected com.liferay.portal.kernel.dao.orm.DynamicQuery |
query |
Constructor and Description |
---|
MetadataQuery()
Constructs an empty metadata query
|
Modifier and Type | Method and Description |
---|---|
abstract java.util.List<T> |
execute()
Executes the
DynamicQuery and return objects that are instances of a class extending Liferay's base record model class
BaseModel . |
abstract void |
initDynamicQuery()
Initializes the
DynamicQuery with the name of a backing Liferay record class. |
void |
setDescription(java.lang.String description)
Adds criteria to the query: the value of the "description" field
TODO: wildcard/text search possible and useful?
|
void |
setFeature(java.lang.String feature)
Adds criteria to the query: the value of the "feature" field
|
void |
setKey(java.lang.String key)
Adds criteria to the query: the value of the "key" field
|
void |
setLocale(java.lang.String locale)
Adds criteria to the query: the value of the "locale" field
|
void |
setObjectId(long objectId)
Adds criteria to the query: the value of the "metadataObjectID" field
|
void |
setOrderAsc(java.lang.String orderField)
Orders this query ascending by the specified field; use one of the field constants on this class as the orderField
|
void |
setOrderDesc(java.lang.String orderField)
Orders this query descending by the specified field; use one of the field constants on this class as the orderField
|
void |
setRel(java.lang.String rel)
Adds criteria to the query: the value of the "rel" field
|
void |
setSource(java.lang.String source)
Adds criteria to the query: the value of the "source" field
|
void |
setType(java.lang.String type)
Adds criteria to the query: the value of the "type" field
|
void |
setValue(java.lang.String value)
Adds criteria to the query: the value of the "value" field
|
public static final java.lang.String FIELD_NAME_OBJECT_ID
public static final java.lang.String FIELD_NAME_KEY
public static final java.lang.String FIELD_NAME_REL
public static final java.lang.String FIELD_NAME_VALUE
public static final java.lang.String FIELD_NAME_FEATURE
public static final java.lang.String FIELD_NAME_TYPE
public static final java.lang.String FIELD_NAME_LOCALE
public static final java.lang.String FIELD_NAME_SOURCE
public static final java.lang.String FIELD_NAME_DESCRIPTION
public static final java.lang.String FIELD_NAME_LAST_UPDATED
protected com.liferay.portal.kernel.dao.orm.DynamicQuery query
public abstract void initDynamicQuery()
DynamicQuery
with the name of a backing Liferay record class. For example:
super.query = DynamicQueryFactoryUtil.forClass(MetadataRecord.class, PortalClassLoaderUtil.getClassLoader());public abstract java.util.List<T> execute() throws MetadataQueryException
DynamicQuery
and return objects that are instances of a class extending Liferay's base record model class
BaseModel
.MetadataQueryException
public void setObjectId(long objectId)
objectId
- the object ID to look forpublic void setKey(java.lang.String key)
key
- the key to look forpublic void setRel(java.lang.String rel)
rel
- the rel to look forpublic void setValue(java.lang.String value)
value
- the value to look forpublic void setFeature(java.lang.String feature)
feature
- the feature to look forpublic void setType(java.lang.String type)
type
- the type to look forpublic void setLocale(java.lang.String locale)
locale
- the locale to look forpublic void setSource(java.lang.String source)
source
- the source to look forpublic void setDescription(java.lang.String description)
description
- the description to look forpublic void setOrderAsc(java.lang.String orderField)
orderField
- the field to use for orderingpublic void setOrderDesc(java.lang.String orderField)
orderField
- the field to use for orderingCopyright 2003, 2014, Oracle and/or its affiliates. All rights reserved.