List of usage examples for com.liferay.portal.kernel.dao.orm Property le
public Criterion le(Object value);
From source file:com.liferay.exportimport.lar.DeletionSystemEventExporter.java
License:Open Source License
protected void addCreateDateProperty(PortletDataContext portletDataContext, DynamicQuery dynamicQuery) { if (!portletDataContext.hasDateRange()) { return;//w w w. j a v a 2s .co m } Property createDateProperty = PropertyFactoryUtil.forName("createDate"); Date startDate = portletDataContext.getStartDate(); dynamicQuery.add(createDateProperty.ge(startDate)); Date endDate = portletDataContext.getEndDate(); dynamicQuery.add(createDateProperty.le(endDate)); }
From source file:com.liferay.exportimport.lar.PortletDataContextImpl.java
License:Open Source License
@Override public Criterion getDateRangeCriteria(String propertyName) { if (!hasDateRange()) { return null; }/*ww w . j av a 2 s. com*/ Conjunction conjunction = RestrictionsFactoryUtil.conjunction(); Property property = PropertyFactoryUtil.forName(propertyName); conjunction.add(property.le(_endDate)); conjunction.add(property.ge(_startDate)); return conjunction; }
From source file:com.liferay.journal.verify.JournalServiceVerifyProcess.java
License:Open Source License
protected void updateResourcePrimKey() throws PortalException { ActionableDynamicQuery actionableDynamicQuery = _journalArticleLocalService.getActionableDynamicQuery(); actionableDynamicQuery.setAddCriteriaMethod(new ActionableDynamicQuery.AddCriteriaMethod() { @Override//from ww w. j av a2 s. c om public void addCriteria(DynamicQuery dynamicQuery) { Property resourcePrimKey = PropertyFactoryUtil.forName("resourcePrimKey"); dynamicQuery.add(resourcePrimKey.le(0L)); } }); if (_log.isDebugEnabled()) { long count = actionableDynamicQuery.performCount(); _log.debug("Processing " + count + " default article versions in draft mode"); } actionableDynamicQuery .setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod<JournalArticle>() { @Override public void performAction(JournalArticle article) throws PortalException { long groupId = article.getGroupId(); String articleId = article.getArticleId(); double version = article.getVersion(); _journalArticleLocalService.checkArticleResourcePrimKey(groupId, articleId, version); } }); actionableDynamicQuery.performActions(); }
From source file:com.liferay.polls.service.persistence.PollsQuestionExportActionableDynamicQuery.java
License:Open Source License
protected long getModelDeletionCount() throws PortalException, SystemException { ActionableDynamicQuery actionableDynamicQuery = new SystemEventActionableDynamicQuery() { @Override/* w w w.ja v a2 s. c o m*/ protected void addCriteria(DynamicQuery dynamicQuery) { Property classNameIdProperty = PropertyFactoryUtil.forName("classNameId"); dynamicQuery.add(classNameIdProperty.eq(PortalUtil.getClassNameId(PollsQuestion.class.getName()))); Property typeProperty = PropertyFactoryUtil.forName("type"); dynamicQuery.add(typeProperty.eq(SystemEventConstants.TYPE_DELETE)); _addCreateDateProperty(dynamicQuery); } @Override protected void performAction(Object object) { } private void _addCreateDateProperty(DynamicQuery dynamicQuery) { if (!_portletDataContext.hasDateRange()) { return; } Property createDateProperty = PropertyFactoryUtil.forName("createDate"); Date startDate = _portletDataContext.getStartDate(); dynamicQuery.add(createDateProperty.ge(startDate)); Date endDate = _portletDataContext.getEndDate(); dynamicQuery.add(createDateProperty.le(endDate)); } }; actionableDynamicQuery.setGroupId(_portletDataContext.getScopeGroupId()); return actionableDynamicQuery.performCount(); }
From source file:com.liferay.sync.internal.messaging.SyncMaintenanceMessageListener.java
License:Open Source License
@Override protected void doReceive(Message message) throws Exception { _syncDLFileVersionDiffLocalService.deleteExpiredSyncDLFileVersionDiffs(); if (SyncServiceConfigurationValues.SYNC_FILE_DIFF_CACHE_ENABLED) { try {//from ww w. j a v a 2s . c o m _syncDLFileVersionDiffLocalService.deleteExpiredSyncDLFileVersionDiffs(); } catch (Exception e) { _log.error(e, e); } } try { ActionableDynamicQuery actionableDynamicQuery = _dlSyncEventLocalService.getActionableDynamicQuery(); actionableDynamicQuery.setAddCriteriaMethod(new ActionableDynamicQuery.AddCriteriaMethod() { @Override public void addCriteria(DynamicQuery dynamicQuery) { Property modifiedTime = PropertyFactoryUtil.forName("modifiedTime"); long latestModifiedTime = _syncDLObjectLocalService.getLatestModifiedTime(); dynamicQuery.add(modifiedTime.le(latestModifiedTime - Time.HOUR)); } }); actionableDynamicQuery .setPerformActionMethod(new ActionableDynamicQuery.PerformActionMethod<DLSyncEvent>() { @Override public void performAction(DLSyncEvent dlSyncEvent) throws PortalException { _dlSyncEventLocalService.deleteDLSyncEvent(dlSyncEvent); } }); actionableDynamicQuery.performActions(); } catch (Exception e) { _log.error(e, e); } }