DynamicQuery Liferay
Getting a list of TagsAsset using DynamicQuery
public List getTagsAsset(Date inicio, Date fin) {
List results = Collections
.synchronizedList(new ArrayList());
ClassLoader loader = PortalClassLoaderUtil.getClassLoader();
DynamicQueryFactory fc = DynamicQueryFactoryUtil
.getDynamicQueryFactory();
DynamicQuery dq0 = fc.forClass(TagsAsset.class, loader).add(
PropertyFactoryUtil.forName("groupId").eq(
PortalUtil.getScopeGroupId(request)))
.add(
PropertyFactoryUtil.forName("publishDate").between(
inicio, fin));
try {
results = TagsEntryLocalServiceUtil.dynamicQuery(dq0);
} catch (SystemException e) {
e.printStackTrace();
}
return results;
}
Post a Comment