|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.endeca.portal.metadata.query.MetadataQuery<T>
T
- the class of the Liferay record(s) to be retrievedpublic abstract class MetadataQuery<T extends com.liferay.portal.model.BaseModel>
Base abstract class for issuing metadata queries to the portal database. This class provides basic getters and setters for all metadata fields with the following abstract methods intended to be implemented by a subclass:
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
.
Field Summary | |
---|---|
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 Summary | |
---|---|
MetadataQuery()
Constructs an empty metadata query |
Method Summary | |
---|---|
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 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
public MetadataQuery()
Method Detail |
---|
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 ordering
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |