本文整理汇总了Java中com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil类的典型用法代码示例。如果您正苦于以下问题:Java PropertyFactoryUtil类的具体用法?Java PropertyFactoryUtil怎么用?Java PropertyFactoryUtil使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PropertyFactoryUtil类属于com.liferay.portal.kernel.dao.orm包,在下文中一共展示了PropertyFactoryUtil类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTemplateUUID
import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil; //导入依赖的package包/类
public static String getTemplateUUID(final String templateKey, final long groupId)
throws SystemException, PortalException {
DynamicQuery dq = DDMTemplateLocalServiceUtil.dynamicQuery()
.add(PropertyFactoryUtil.forName("templateKey").eq(templateKey));
List<DDMTemplate> templateList = new ArrayList<DDMTemplate>();
String uuid = "NOT FOUND!!!!";
try {
DDMTemplate template = null;
templateList = DDMTemplateLocalServiceUtil.dynamicQuery(dq);
if (templateList != null && templateList.size() > 0 && templateList.get(0) != null) {
uuid = templateList.get(0).getUuid();
}
} catch (SystemException e) {
LOG.error("Tempate with key " + templateKey + " not found !!", e);
}
return uuid;
}
示例2: asignCorrectionsToP2PActivities
import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil; //导入依赖的package包/类
public void asignCorrectionsToP2PActivities(){
if(log.isDebugEnabled())log.debug("Check P2P asign corrections");
//Obtener la lista de actividades p2p de todos los usuarios.
List<P2pActivity> activities = null;
//Seleccionamos las actividades p2p entre ayer y antes de ayer.
DynamicQuery consulta = DynamicQueryFactoryUtil.forClass(P2pActivity.class)
.add(PropertyFactoryUtil.forName("asignationsCompleted").eq(false));
try {
activities = (List<P2pActivity>)P2pActivityLocalServiceUtil.dynamicQuery(consulta);
} catch (SystemException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
if(activities != null){
//Recorrer todas las activities.
for(P2pActivity activity:activities){
asignCorrectionP2PActivity(activity);
}
}
}
示例3: getByGroupIdUserId
import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil; //导入依赖的package包/类
public List<LearningActivityResult> getByGroupIdUserId(long groupId,long userId){
List<LearningActivityResult> results = new ArrayList<LearningActivityResult>();
ClassLoader classLoader = (ClassLoader) PortletBeanLocatorUtil.locate(ClpSerializer.getServletContextName(), "portletClassLoader");
DynamicQuery dq2 = DynamicQueryFactoryUtil.forClass(LearningActivity.class, classLoader)
.add(PropertyFactoryUtil.forName("groupId").eq(groupId))
.setProjection(ProjectionFactoryUtil.property("actId"));
DynamicQuery dq = DynamicQueryFactoryUtil.forClass(LearningActivityResult.class, classLoader)
.add(PropertyFactoryUtil.forName("userId").eq(userId))
.add(PropertyFactoryUtil.forName("actId").in(dq2));
try {
results = (List<LearningActivityResult>)learningActivityResultPersistence.findWithDynamicQuery(dq);
} catch (SystemException e) {
e.printStackTrace();
}
log.debug("::getByModuleId:"+results.size());
return results;
}
示例4: getMandatoryByGroupIdUserId
import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil; //导入依赖的package包/类
public List<LearningActivityResult> getMandatoryByGroupIdUserId(long groupId,long userId){
List<LearningActivityResult> results = new ArrayList<LearningActivityResult>();
ClassLoader classLoader = (ClassLoader) PortletBeanLocatorUtil.locate(ClpSerializer.getServletContextName(), "portletClassLoader");
DynamicQuery dq2 = DynamicQueryFactoryUtil.forClass(LearningActivity.class, classLoader)
.add(PropertyFactoryUtil.forName("groupId").eq(groupId))
.add(PropertyFactoryUtil.forName("weightinmodule").gt(0L))
.setProjection(ProjectionFactoryUtil.property("actId"));
DynamicQuery dq = DynamicQueryFactoryUtil.forClass(LearningActivityResult.class, classLoader)
.add(PropertyFactoryUtil.forName("userId").eq(userId))
.add(PropertyFactoryUtil.forName("actId").in(dq2));
try {
results = (List<LearningActivityResult>)learningActivityResultPersistence.findWithDynamicQuery(dq);
} catch (SystemException e) {
e.printStackTrace();
}
log.debug("::getByModuleIdPassed:"+results.size());
return results;
}
示例5: getByModuleIdUserId
import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil; //导入依赖的package包/类
public List<LearningActivityResult> getByModuleIdUserId(long moduleId,long userId){
List<LearningActivityResult> results = new ArrayList<LearningActivityResult>();
ClassLoader classLoader = (ClassLoader) PortletBeanLocatorUtil.locate(ClpSerializer.getServletContextName(), "portletClassLoader");
DynamicQuery dq2 = DynamicQueryFactoryUtil.forClass(LearningActivity.class, classLoader)
.add(PropertyFactoryUtil.forName("moduleId").eq(moduleId))
.setProjection(ProjectionFactoryUtil.property("actId"));
DynamicQuery dq = DynamicQueryFactoryUtil.forClass(LearningActivityResult.class, classLoader)
.add(PropertyFactoryUtil.forName("userId").eq(userId))
.add(PropertyFactoryUtil.forName("actId").in(dq2));
try {
results = (List<LearningActivityResult>)learningActivityResultPersistence.findWithDynamicQuery(dq);
} catch (SystemException e) {
e.printStackTrace();
}
log.debug("::getByModuleId:"+results.size());
return results;
}
示例6: getByModuleIdUserIdPassed
import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil; //导入依赖的package包/类
public List<LearningActivityResult> getByModuleIdUserIdPassed(long moduleId,long userId){
List<LearningActivityResult> results = new ArrayList<LearningActivityResult>();
ClassLoader classLoader = (ClassLoader) PortletBeanLocatorUtil.locate(ClpSerializer.getServletContextName(), "portletClassLoader");
DynamicQuery dq2 = DynamicQueryFactoryUtil.forClass(LearningActivity.class, classLoader)
.add(PropertyFactoryUtil.forName("moduleId").eq(moduleId))
.setProjection(ProjectionFactoryUtil.property("actId"));
DynamicQuery dq = DynamicQueryFactoryUtil.forClass(LearningActivityResult.class, classLoader)
.add(PropertyFactoryUtil.forName("userId").eq(userId))
.add(PropertyFactoryUtil.forName("passed").eq(true))
.add(PropertyFactoryUtil.forName("actId").in(dq2));
try {
results = (List<LearningActivityResult>)learningActivityResultPersistence.findWithDynamicQuery(dq);
} catch (SystemException e) {
e.printStackTrace();
}
log.debug("::getByModuleIdPassed:"+results.size());
return results;
}
示例7: getMandatoryByModuleIdUserIdPassed
import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil; //导入依赖的package包/类
public List<LearningActivityResult> getMandatoryByModuleIdUserIdPassed(long moduleId,long userId){
List<LearningActivityResult> results = new ArrayList<LearningActivityResult>();
ClassLoader classLoader = (ClassLoader) PortletBeanLocatorUtil.locate(ClpSerializer.getServletContextName(), "portletClassLoader");
DynamicQuery dq2 = DynamicQueryFactoryUtil.forClass(LearningActivity.class, classLoader)
.add(PropertyFactoryUtil.forName("moduleId").eq(moduleId))
.add(PropertyFactoryUtil.forName("weightinmodule").gt(0L))
.setProjection(ProjectionFactoryUtil.property("actId"));
DynamicQuery dq = DynamicQueryFactoryUtil.forClass(LearningActivityResult.class, classLoader)
.add(PropertyFactoryUtil.forName("userId").eq(userId))
.add(PropertyFactoryUtil.forName("passed").eq(true))
.add(PropertyFactoryUtil.forName("actId").in(dq2));
try {
results = (List<LearningActivityResult>)learningActivityResultPersistence.findWithDynamicQuery(dq);
} catch (SystemException e) {
e.printStackTrace();
}
log.debug("::getByModuleIdPassed:"+results.size());
return results;
}
示例8: countMandatoryByModuleIdUserIdPassed
import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil; //导入依赖的package包/类
public int countMandatoryByModuleIdUserIdPassed(long moduleId,long userId){
ClassLoader classLoader = (ClassLoader) PortletBeanLocatorUtil.locate(ClpSerializer.getServletContextName(), "portletClassLoader");
DynamicQuery dq2 = DynamicQueryFactoryUtil.forClass(LearningActivity.class, classLoader)
.add(PropertyFactoryUtil.forName("moduleId").eq(moduleId))
.add(PropertyFactoryUtil.forName("weightinmodule").gt(0L))
.setProjection(ProjectionFactoryUtil.property("actId"));
DynamicQuery dq = DynamicQueryFactoryUtil.forClass(LearningActivityResult.class, classLoader)
.add(PropertyFactoryUtil.forName("userId").eq(userId))
.add(PropertyFactoryUtil.forName("passed").eq(true))
.add(PropertyFactoryUtil.forName("actId").in(dq2));
try {
return (int) LearningActivityResultLocalServiceUtil.dynamicQueryCount(dq);
} catch (SystemException e) {
e.printStackTrace();
}
return 0;
}
示例9: getUsersByLearningActivity
import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public List<User> getUsersByLearningActivity(long actId) throws SystemException, PortalException
{
List<User> users = new ArrayList<User>();
ClassLoader classLoader = (ClassLoader) PortletBeanLocatorUtil.locate(ClpSerializer.getServletContextName(), "portletClassLoader");
DynamicQuery consulta = DynamicQueryFactoryUtil.forClass(LearningActivityTry.class, classLoader)
.add(PropertyFactoryUtil.forName("actId").eq(new Long(actId)));
List<LearningActivityTry> activities = (List<LearningActivityTry>)learningActivityTryPersistence.findWithDynamicQuery(consulta);
for(LearningActivityTry activity:activities){
Long uId = activity.getUserId();
User u = UserLocalServiceUtil.getUserById(uId.longValue());
if(u!=null && !users.contains(u))
users.add(u);
}
return users;
}
示例10: getLastLearningActivityTryByActivityAndUser
import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public LearningActivityTry getLastLearningActivityTryByActivityAndUser(long actId,long userId) throws SystemException, PortalException
{
DynamicQuery consulta = DynamicQueryFactoryUtil.forClass(LearningActivityTry.class, (ClassLoader)PortletBeanLocatorUtil.locate(ClpSerializer.getServletContextName(),
"portletClassLoader"))
.add(PropertyFactoryUtil.forName("actId").eq(new Long(actId)))
.add(PropertyFactoryUtil.forName("userId").eq(new Long(userId)))
.addOrder(PropertyFactoryUtil.forName("endDate").desc());
List<LearningActivityTry> activities = (List<LearningActivityTry>)learningActivityTryPersistence.findWithDynamicQuery(consulta);
for(LearningActivityTry activity:activities){
//Necesitamos la primera, que est� ordenada por la �ltima realizada.
return activity;
}
return null;
}
示例11: getLearningActivityTryNotFinishedByActUser
import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public LearningActivityTry getLearningActivityTryNotFinishedByActUser(long actId,long userId) throws SystemException, PortalException
{
DynamicQuery consulta = DynamicQueryFactoryUtil.forClass(LearningActivityTry.class, (ClassLoader)PortletBeanLocatorUtil.locate(ClpSerializer.getServletContextName(),
"portletClassLoader"))
.add(PropertyFactoryUtil.forName("actId").eq(new Long(actId)))
.add(PropertyFactoryUtil.forName("userId").eq(new Long(userId)))
.add(PropertyFactoryUtil.forName("endDate").isNull())
.addOrder(PropertyFactoryUtil.forName("startDate").desc());
List<LearningActivityTry> activities = (List<LearningActivityTry>)learningActivityTryPersistence.findWithDynamicQuery(consulta);
for(LearningActivityTry activity:activities){
//Necesitamos la primera, que est� ordenada por la �ltima realizada.
return activity;
}
return null;
}
示例12: getListModuleResultByModuleAndUser
import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil; //导入依赖的package包/类
/**
* No deber�a haber nunca m�s de un result para el mismo usuario y modulo.
* Se hace para eliminar los duplicados.
* @param moduleId
* @param userId
* @return La lista de todos los moduleresult del usuario
* @throws SystemException
*/
public List<ModuleResult> getListModuleResultByModuleAndUser(long moduleId, long userId) throws SystemException {
List<ModuleResult> res = new ArrayList<ModuleResult>();
ClassLoader classLoader = (ClassLoader) PortletBeanLocatorUtil.locate(ClpSerializer.getServletContextName(), "portletClassLoader");
DynamicQuery consulta = DynamicQueryFactoryUtil.forClass(ModuleResult.class, classLoader)
.add(PropertyFactoryUtil.forName("moduleId").eq(moduleId))
.add(PropertyFactoryUtil.forName("userId").eq(userId));
List<ModuleResult> results = moduleResultPersistence.findWithDynamicQuery(consulta);
if(results!=null && !results.isEmpty()){
res = results;
}
return res;
}
示例13: getPreviusModule
import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil; //导入依赖的package包/类
public Module getPreviusModule(Module theModule) throws SystemException {
ClassLoader classLoader = (ClassLoader) PortletBeanLocatorUtil.locate(ClpSerializer.getServletContextName(), "portletClassLoader");
DynamicQuery dq=DynamicQueryFactoryUtil.forClass(Module.class, classLoader);
Criterion criterion=PropertyFactoryUtil.forName("ordern").lt(theModule.getOrdern());
dq.add(criterion);
criterion=PropertyFactoryUtil.forName("groupId").eq(theModule.getGroupId());
dq.add(criterion);
Order createOrder=OrderFactoryUtil.getOrderFactory().desc("ordern");
dq.addOrder(createOrder);
@SuppressWarnings("unchecked")
List<Module> modulesp=(List<Module>)moduleLocalService.dynamicQuery(dq,0,1);
if(modulesp!=null&& modulesp.size()>0)
{
return modulesp.get(0);
}
else
{
return null;
}
}
示例14: getNextModule
import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil; //导入依赖的package包/类
public Module getNextModule(Module theModule) throws SystemException {
ClassLoader classLoader = (ClassLoader) PortletBeanLocatorUtil.locate(ClpSerializer.getServletContextName(), "portletClassLoader");
DynamicQuery dq=DynamicQueryFactoryUtil.forClass(Module.class, classLoader);
Criterion criterion=PropertyFactoryUtil.forName("ordern").gt(theModule.getOrdern());
dq.add(criterion);
criterion=PropertyFactoryUtil.forName("groupId").eq(theModule.getGroupId());
dq.add(criterion);
Order createOrder=OrderFactoryUtil.getOrderFactory().asc("ordern");
dq.addOrder(createOrder);
@SuppressWarnings("unchecked")
List<Module> modulesp=(List<Module>)moduleLocalService.dynamicQuery(dq,0,1);
if(modulesp!=null&& modulesp.size()>0)
{
return modulesp.get(0);
}
else
{
return null;
}
}
示例15: findByclassName_classPK_filterByActions
import com.liferay.portal.kernel.dao.orm.PropertyFactoryUtil; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public List<AuditEntry> findByclassName_classPK_filterByActions(String className, long classPK, List<String> actions)
throws SystemException
{
DynamicQuery dq = auditEntryLocalService.dynamicQuery();
Criterion criterion=PropertyFactoryUtil.forName("classname").eq(className);
if(classPK>0)
{
criterion=RestrictionsFactoryUtil.and(criterion, PropertyFactoryUtil.forName("classPK").eq(classPK));
}
Criterion criterionAux = criterion;
for (int i=0; i<actions.size(); i++) {
if(i==0){
criterion = RestrictionsFactoryUtil.and(criterion, PropertyFactoryUtil.forName("action").eq(actions.get(i)));
}else{
Criterion criterionAnd = RestrictionsFactoryUtil.and(criterionAux , PropertyFactoryUtil.forName("action").eq(actions.get(i)));
criterion = RestrictionsFactoryUtil.or(criterion, criterionAnd);
}
}
dq.add(criterion);
return auditEntryLocalService.dynamicQuery(dq);
}