• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java RestrictionsFactoryUtil类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil的典型用法代码示例。如果您正苦于以下问题:Java RestrictionsFactoryUtil类的具体用法?Java RestrictionsFactoryUtil怎么用?Java RestrictionsFactoryUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



RestrictionsFactoryUtil类属于com.liferay.portal.kernel.dao.orm包,在下文中一共展示了RestrictionsFactoryUtil类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: parseStructureData

import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil; //导入依赖的package包/类
/**
 * Set structure data.
 * 
 * There's no method for fetching
 * structure by key so we are using DynamicQuery here.
 * 
 * @param structureKey
 * @return
 * @throws PortalException 
 */
protected JSONObject parseStructureData(TermCollector tc, Locale locale) throws PortalException {

	DynamicQuery structureQuery = _ddmStructureLocalService.dynamicQuery();
	structureQuery.add(
		RestrictionsFactoryUtil.eq("structureKey", tc.getTerm()));

	List<DDMStructure> structures =
		DDMStructureLocalServiceUtil.dynamicQuery(structureQuery);
	
	DDMStructure structure =  structures.get(0);

	JSONObject item = JSONFactoryUtil.createJSONObject();

	item.put("frequency", tc.getFrequency());
	item.put("groupName", _groupLocalService.getGroup(structure.getGroupId()).getName(
				locale, true));
	item.put("name", structure.getName(locale, true));
	item.put("term", tc.getTerm());
	
	return item;
}
 
开发者ID:peerkar,项目名称:liferay-gsearch,代码行数:32,代码来源:WebContentStructureFacetTranslator.java


示例2: getMostUsedSearchStringNotNull

import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil; //导入依赖的package包/类
public List<Logging> getMostUsedSearchStringNotNull() {
	
	try {
		DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(Logging.class);
		
		Criterion criterion = RestrictionsFactoryUtil.not(RestrictionsFactoryUtil.like("searchString", "null"));
		dynamicQuery.add(criterion);
				
		Order defaultOrder = OrderFactoryUtil.desc("passel");
		dynamicQuery.addOrder(defaultOrder); 
						
		return dynamicQuery(dynamicQuery);
	} catch (SystemException e) {
		e.printStackTrace();
	}
	return null;
}
 
开发者ID:fraunhoferfokus,项目名称:govapps,代码行数:18,代码来源:LoggingLocalServiceImpl.java


示例3: getMostViewdApplications

import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil; //导入依赖的package包/类
public List<Application> getMostViewdApplications() {
	
	try {
		DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(Application.class);
		
		Criterion criterion = RestrictionsFactoryUtil.gt("detailsViewed", new Long(0));
		dynamicQuery.add(criterion);
				
		Order defaultOrder = OrderFactoryUtil.desc("detailsViewed");
		dynamicQuery.addOrder(defaultOrder); 
						
		return dynamicQuery(dynamicQuery);
	} catch (SystemException e) {
		e.printStackTrace();
	}
	return null;
}
 
开发者ID:fraunhoferfokus,项目名称:govapps,代码行数:18,代码来源:ApplicationLocalServiceImpl.java


示例4: getMostClickedApplications

import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil; //导入依赖的package包/类
public List<Application> getMostClickedApplications() {
	
	try {
		DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(Application.class);
		
		Criterion criterion = RestrictionsFactoryUtil.gt("linkClicked", new Long(0));
		dynamicQuery.add(criterion);
				
		Order defaultOrder = OrderFactoryUtil.desc("linkClicked");
		dynamicQuery.addOrder(defaultOrder); 
						
		return dynamicQuery(dynamicQuery);
	} catch (SystemException e) {
		e.printStackTrace();
	}
	return null;
}
 
开发者ID:fraunhoferfokus,项目名称:govapps,代码行数:18,代码来源:ApplicationLocalServiceImpl.java


示例5: getRelAppIds

import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil; //导入依赖的package包/类
public List<Long>  getRelAppIds(long appId) throws SystemException {
	List<Long> result = new ArrayList<Long>();
	
	DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(RelatedApplications.class);
	Criterion criterionOr   = null;
	criterionOr = RestrictionsFactoryUtil.or(RestrictionsFactoryUtil.eq("applicationId", appId), RestrictionsFactoryUtil.eq("applicationId2", appId));
	dynamicQuery.add(criterionOr);		
	List<RelatedApplications> relatedApplicationsList = dynamicQuery(dynamicQuery);
	
	for (RelatedApplications relatedApplications: relatedApplicationsList) {
		if (relatedApplications.getApplicationId() == appId && !result.contains(relatedApplications.getApplicationId2() )) {
			result.add(relatedApplications.getApplicationId2());
		}
		if (relatedApplications.getApplicationId2() == appId && !result.contains(relatedApplications.getApplicationId() )) {
			result.add(relatedApplications.getApplicationId());
		}			
	}
	
	return result;
	
}
 
开发者ID:fraunhoferfokus,项目名称:govapps,代码行数:22,代码来源:RelatedApplicationsLocalServiceImpl.java


示例6: findByclassName_classPK_filterByActions

import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil; //导入依赖的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);
}
 
开发者ID:TelefonicaED,项目名称:liferaylms-portlet,代码行数:24,代码来源:AuditEntryLocalServiceImpl.java


示例7: getComunidadesDisponiveis

import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil; //导入依赖的package包/类
/**
 * Lista todas as comunidades públicas, privadas e restritas da companhia
 * 
 * @throws SystemException
 */
@SuppressWarnings("unchecked")
public List<Group> getComunidadesDisponiveis(final long companyId) throws SystemException {

	final long groupClassNameId = ClassNameLocalServiceUtil.getClassNameId(Group.class);

	final DynamicQuery query = DynamicQueryFactoryUtil.forClass(Group.class, PortalClassLoaderUtil.getClassLoader());
	query.add(RestrictionsFactoryUtil.eq("companyId", companyId));
	query.add(RestrictionsFactoryUtil.eq("classNameId", groupClassNameId));
	query.add(RestrictionsFactoryUtil.in("type", new Object[] { GroupConstants.TYPE_SITE_OPEN, GroupConstants.TYPE_SITE_PRIVATE,
			GroupConstants.TYPE_SITE_RESTRICTED }));
	query.add(RestrictionsFactoryUtil.eq("parentGroupId", GroupConstants.DEFAULT_PARENT_GROUP_ID));
	query.add(RestrictionsFactoryUtil.eq("active", true));
	query.add(RestrictionsFactoryUtil.ne("name", GroupConstants.CONTROL_PANEL));
	query.addOrder(OrderFactoryUtil.asc("name"));

	return (List<Group>) GroupLocalServiceUtil.dynamicQuery(query);
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:23,代码来源:DashboardLocalServiceImpl.java


示例8: getMessagesForExport

import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil; //导入依赖的package包/类
public final ChatRoomMessage[] getMessagesForExport(long roomId) throws SystemException, PortalException {

		ChatRoom room = getChatRoomLocalService().getChatRoom(roomId);
		DynamicQuery q = DynamicQueryFactoryUtil
		        .forClass(ChatRoomMessage.class)
		        .add(PropertyFactoryUtil.forName(CHAT_ROOM_ID_FIELD).eq(roomId))
		        .add(PropertyFactoryUtil.forName(MESSAGE_PUBLIC_FIELD).eq(true))
		        .add(PropertyFactoryUtil.forName(ADMIN_MESSAGE_FIELD).eq(false))
		        .add(PropertyFactoryUtil.forName(MESSAGE_STATUS_FIELD).eq(MessageStatus.Approved.getValue()))
		        .add(RestrictionsFactoryUtil.or(PropertyFactoryUtil.forName("senderType").eq(UserType.SpecialGuest.getValue()),
		                PropertyFactoryUtil.forName("messageType").in(new Object[] { MessageType.Standard.getValue(), MessageType.Approved.getValue() })));
		if (room.getStatus() != RoomStatus.Exported.getValue()) {
			q.addOrder(OrderFactoryUtil.asc(MESSAGE_TS_FIELD));
		} else {
			q.addOrder(OrderFactoryUtil.asc("exportedPosition"));
		}

		List<?> lm = getChatRoomMessageLocalService().dynamicQuery(q);
		ChatRoomMessage[] result = new ChatRoomMessage[lm.size()];
		return lm.toArray(result);

	}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:23,代码来源:ChatRoomServiceImpl.java


示例9: getVotosByUsuarioId

import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil; //导入依赖的package包/类
/**
 * Conta os votos por usuário
 * 
 * @param groupId
 * @param userId
 * @return
 * @throws SystemException
 */
public int getVotosByUsuarioId(long groupId, long userId)
		throws SystemException {

	DynamicQuery dqEixo = DynamicQueryFactoryUtil.forClass(Eixo.class);
	dqEixo.setProjection(ProjectionFactoryUtil.property("eixoId"));
	dqEixo.add(RestrictionsFactoryUtil.eq("groupId", groupId));

	DynamicQuery dqProposta = DynamicQueryFactoryUtil
			.forClass(Proposta.class);
	dqProposta.setProjection(ProjectionFactoryUtil.property("propostaId"));
	dqProposta.add(PropertyFactoryUtil.forName("eixoId").in(dqEixo));

	DynamicQuery dq = DynamicQueryFactoryUtil.forClass(Voto.class);
	dq.add(RestrictionsFactoryUtil.eq("userId", userId));
	dq.add(PropertyFactoryUtil.forName("propostaId").in(dqProposta));
	dq.setProjection(ProjectionFactoryUtil.sum("numeroVotos"));
	List<?> ret = dynamicQuery(dq);
	if (ret.isEmpty() || ret.get(0) == null)
		return 0;
	else
		return ((Number) ret.get(0)).intValue();
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:31,代码来源:VotoLocalServiceImpl.java


示例10: getComunidades

import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil; //导入依赖的package包/类
/**
 * Lista todas as comunidades públicas, privadas e restritas da companhia
 * 
 * @throws SystemException
 */
private List<Group> getComunidades(long companyId) throws SystemException {

	long groupClassNameId = ClassNameLocalServiceUtil
			.getClassNameId(Group.class);

	DynamicQuery query = DynamicQueryFactoryUtil.forClass(Group.class,
			PortalClassLoaderUtil.getClassLoader());
	query.add(RestrictionsFactoryUtil.eq("companyId", companyId));
	query.add(RestrictionsFactoryUtil.eq("classNameId", groupClassNameId));
	query.add(RestrictionsFactoryUtil.in("type", new Object[] {
			GroupConstants.TYPE_SITE_OPEN,
			GroupConstants.TYPE_SITE_PRIVATE,
			GroupConstants.TYPE_SITE_RESTRICTED }));
	query.add(RestrictionsFactoryUtil.eq("parentGroupId",
			GroupConstants.DEFAULT_PARENT_GROUP_ID));
	query.add(RestrictionsFactoryUtil.eq("active", true));
	query.add(RestrictionsFactoryUtil.ne("name",
			GroupConstants.CONTROL_PANEL));
	query.addOrder(OrderFactoryUtil.asc("name"));

	@SuppressWarnings("unchecked")
	List<Group> ret = GroupLocalServiceUtil.dynamicQuery(query);
	return ret;
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:30,代码来源:ContadorAcessoLocalServiceImpl.java


示例11: getGruposFilhos

import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil; //导入依赖的package包/类
/**
 * @param group
 * 
 * @return
 * @throws SystemException
 */
private List<Long> getGruposFilhos(Group group) throws SystemException {
	List<Long> grupos = new ArrayList<Long>();

	long layoutClassNameId = ClassNameLocalServiceUtil
			.getClassNameId(Layout.class);
	DynamicQuery query = DynamicQueryFactoryUtil.forClass(Group.class);
	query.add(RestrictionsFactoryUtil.eq("companyId", group.getCompanyId()));
	query.add(RestrictionsFactoryUtil.eq("classNameId", layoutClassNameId));
	query.add(RestrictionsFactoryUtil.eq("parentGroupId",
			group.getGroupId()));
	query.add(RestrictionsFactoryUtil.eq("active", true));
	@SuppressWarnings("unchecked")
	List<Group> filhos = GroupLocalServiceUtil.dynamicQuery(query);
	for (Group filho : filhos)
		grupos.add(filho.getGroupId());
	return grupos;
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:24,代码来源:ContadorAcessoLocalServiceImpl.java


示例12: getComunidadesDisponiveis

import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil; //导入依赖的package包/类
/**
 * Lista todas as comunidades públicas, privadas e restritas da companhia
 * 
 * @throws SystemException
 */
@SuppressWarnings("unchecked")
public List<Group> getComunidadesDisponiveis(final long companyId)
		throws SystemException {

	final long groupClassNameId = ClassNameLocalServiceUtil
			.getClassNameId(Group.class);

	final DynamicQuery query = DynamicQueryFactoryUtil.forClass(
			Group.class, PortalClassLoaderUtil.getClassLoader());
	query.add(RestrictionsFactoryUtil.eq("companyId", companyId));
	query.add(RestrictionsFactoryUtil.eq("classNameId", groupClassNameId));
	query.add(RestrictionsFactoryUtil.in("type", new Object[] {
			GroupConstants.TYPE_SITE_OPEN,
			GroupConstants.TYPE_SITE_PRIVATE,
			GroupConstants.TYPE_SITE_RESTRICTED }));
	query.add(RestrictionsFactoryUtil.eq("parentGroupId",
			GroupConstants.DEFAULT_PARENT_GROUP_ID));
	query.add(RestrictionsFactoryUtil.eq("active", true));
	query.add(RestrictionsFactoryUtil.ne("name",
			GroupConstants.CONTROL_PANEL));
	query.addOrder(OrderFactoryUtil.asc("name"));

	return (List<Group>) GroupLocalServiceUtil.dynamicQuery(query);
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:30,代码来源:ParticipacaoLocalServiceImpl.java


示例13: generateSQLCriterion

import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil; //导入依赖的package包/类
public static Criterion generateSQLCriterion(String sql) {
	if (Validator.isNull(sql)) {
		return null;
	}

	sql = PortalUtil.transformSQL(sql);

	return RestrictionsFactoryUtil.sqlRestriction(sql);
}
 
开发者ID:jorgediaz-lr,项目名称:servicebuilder-reflection,代码行数:10,代码来源:ModelUtil.java


示例14: getNewApplications

import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil; //导入依赖的package包/类
public List<List> getNewApplications(long companyId, int year, int month, int day, int count) throws SystemException {	
	_log.debug("getNewApplications2: ");
	List<List> result  = new ArrayList<List>();
	try {
		Date modifiedDate = PortalUtil.getDate(month, day, year);
		Date now = new Date();
		
		DynamicQuery dynamicQuery = DynamicQueryFactoryUtil.forClass(Application.class);
		Criterion criterion = null;
		
		criterion = RestrictionsFactoryUtil.between("modifiedDate",modifiedDate,now);

		dynamicQuery.add(criterion);
		dynamicQuery.add(PropertyFactoryUtil.forName("lifeCycleStatus").eq(E_Stati.APPLICATION_STATUS_VERIFIED.getIntStatus()));
		
		Order defaultOrder = OrderFactoryUtil.desc("modifiedDate");
		dynamicQuery.addOrder(defaultOrder); 
				
		dynamicQuery.setLimit(0, count);
		
		List<Application> applications = ApplicationLocalServiceUtil.dynamicQuery(dynamicQuery);
		
	
		for (Application application: applications) {
			List toAdd = new ArrayList();
			toAdd.add(application);
						
			if (application.getLogoImageId() != 0) {
				DLFileEntry fe;
				fe = DLFileEntryLocalServiceUtil.getDLFileEntry(application.getLogoImageId());
							//String iconUrl = "http://localhost/documents/10180/0/" + HttpUtil.encodeURL(fe.getTitle(), true);
				String iconUrl = "http://localhost/documents/10180/0/" + 
					HttpUtil.encodeURL(HtmlUtil.unescape(fe.getTitle())) + 
					StringPool.SLASH + 
					fe.getUuid() +
					"?version=" + fe.getVersion() +
					"&t=" + fe.getModifiedDate().getTime() +
					"&imageThumbnail=1";
								
				toAdd.add(iconUrl);
			}
					
			result.add(toAdd);				
		}
	} catch (Exception e) {
		_log.error(e.getMessage());
		e.printStackTrace();
	}
	return result;		
}
 
开发者ID:fraunhoferfokus,项目名称:govapps,代码行数:51,代码来源:ApplicationServiceImpl.java


示例15: getAttributeRangeCriterion

import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil; //导入依赖的package包/类
protected Criterion getAttributeRangeCriterion(
	Model model, String attribute, Object value, boolean isStartValue) {

	if (!model.hasAttribute(attribute)) {
		return RestrictionsFactoryUtil.disjunction();
	}

	Property property = model.getProperty(attribute);

	if (isStartValue) {
		return property.ge(value);
	}

	return property.lt(value);
}
 
开发者ID:jorgediaz-lr,项目名称:staging-checker,代码行数:16,代码来源:StagingCheckerModelFactory.java


示例16: getSiteGroupIds

import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public List<Long> getSiteGroupIds() {

	ModelFactory modelFactory = new ModelFactory();

	Model model = modelFactory.getModelObject(Group.class);

	Conjunction stagingSites = RestrictionsFactoryUtil.conjunction();
	stagingSites.add(model.getProperty("site").eq(false));
	stagingSites.add(model.getProperty("liveGroupId").ne(0L));

	Projection projection = model.getPropertyProjection("liveGroupId");

	List<Order> orders = Collections.singletonList(
		OrderFactoryUtil.asc("name"));

	try {
		return (List<Long>)model.executeDynamicQuery(
			stagingSites, projection, orders);
	}
	catch (Exception e) {
		if (_log.isWarnEnabled()) {
			_log.warn(e, e);
		}

		return new ArrayList<Long>();
	}
}
 
开发者ID:jorgediaz-lr,项目名称:staging-checker,代码行数:29,代码来源:StagingCheckerPortlet.java


示例17: getAttributeCriterion

import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil; //导入依赖的package包/类
@Override
public <T> Criterion getAttributeCriterion(String attribute, List<T> list) {

	if (!this.hasAttribute(attribute) || Validator.isNull(list)) {
		return null;
	}

	Property property = getProperty(attribute);

	if (list.size() == 1) {
		return property.eq(list.get(0));
	}

	int maxNumClauses = MAX_NUMBER_OF_CLAUSES;

	if (list.size() <= maxNumClauses) {
		return property.in(list);
	}

	Disjunction disjunction = RestrictionsFactoryUtil.disjunction();

	int numberOfDisjuntions =
		((list.size() + maxNumClauses - 1) / maxNumClauses);

	for (int i = 0; i<numberOfDisjuntions; i++) {
		int start = i * maxNumClauses;
		int end = Math.min(start + maxNumClauses, list.size());

		List<T> subList = list.subList(start, end);
		disjunction.add(property.in(subList));
	}

	return disjunction;
}
 
开发者ID:jorgediaz-lr,项目名称:servicebuilder-reflection,代码行数:35,代码来源:ModelImpl.java


示例18: getAddress

import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil; //导入依赖的package包/类
@Override
public AHAddr getAddress(final String street, final String number,
        final long regionId) {
	AHAddr result = null;

	try {
		final DynamicQuery dyQuery = DynamicQueryFactoryUtil
		        .forClass(AHAddr.class);

		final Criterion term1 = RestrictionsFactoryUtil.ilike("street",
		        street);
		final Criterion term2 = RestrictionsFactoryUtil
		        .eq("number", number);
		final Criterion term3 = RestrictionsFactoryUtil.eq("regionId",
		        regionId);
		final Criterion allTerms = RestrictionsFactoryUtil.and(term3,
		        RestrictionsFactoryUtil.and(term1, term2));

		dyQuery.add(allTerms);
		final List addrs = this.dynamicQuery(dyQuery);
		if (addrs.size() > 0) {
			for (final Object addr : addrs) {
				if (addr instanceof AHAddr) {
					result = (AHAddr) addr;
					break;
				}
			}
		}
	} catch (final Throwable t) {
		m_objLog.error(t);
	}
	return result;
}
 
开发者ID:fraunhoferfokus,项目名称:particity,代码行数:34,代码来源:AHAddrLocalServiceImpl.java


示例19: getRegion

import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil; //导入依赖的package包/类
@Override
public AHRegion getRegion(final String city, final String country,
        final String zip) {
	AHRegion result = null;

	try {
		final DynamicQuery dyQuery = DynamicQueryFactoryUtil
		        .forClass(AHRegion.class);

		final Criterion term1 = RestrictionsFactoryUtil.ilike(
		        "primaryKey.city", city);
		final Criterion term2 = RestrictionsFactoryUtil.ilike(
		        "primaryKey.country", country);
		final Criterion term3 = RestrictionsFactoryUtil.eq(
		        "primaryKey.zip", zip);
		final Criterion allTerms = RestrictionsFactoryUtil.and(term3,
		        RestrictionsFactoryUtil.and(term1, term2));

		dyQuery.add(allTerms);
		final List regions = this.dynamicQuery(dyQuery);

		if (regions.size() > 0) {
			for (final Object region : regions) {
				if (region instanceof AHRegion) {
					result = (AHRegion) region;
					break;
				}
			}
		}
	} catch (final SystemException e) {
		m_objLog.error(e);
	}

	return result;
}
 
开发者ID:fraunhoferfokus,项目名称:particity,代码行数:36,代码来源:AHRegionLocalServiceImpl.java


示例20: findOpenAndEnterableClosedRooms

import com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil; //导入依赖的package包/类
private ChatRoomBean[] findOpenAndEnterableClosedRooms(DynamicQuery q) throws SystemException {
	// Configurando query

	User user = getCurrentUser();

	if (user != null) {
		q.add(RestrictionsFactoryUtil.or(
		        PropertyFactoryUtil.forName("status").eq(RoomStatus.Opened.getValue()),
		        RestrictionsFactoryUtil.and(PropertyFactoryUtil.forName("status").eq(RoomStatus.Closed.getValue()),
		                PropertyFactoryUtil.forName("openPolicy").eq(RoomOpenPolicy.Manual.getValue()))));
	} else {
		q.add(PropertyFactoryUtil.forName("status").eq(RoomStatus.Opened.getValue()));

	}
	q.addOrder(OrderFactoryUtil.desc("groupId"));
	q.addOrder(OrderFactoryUtil.desc("createDate"));
	q.addOrder(OrderFactoryUtil.desc("roomId"));

	@SuppressWarnings("unchecked")
	List<ChatRoom> rs = (List<ChatRoom>) getChatRoomLocalService().dynamicQuery(q);
	List<ChatRoomBean> retorno = new ArrayList<ChatRoomBean>();

	// Verificando permissões
	for (ChatRoom chatRoom : rs) {
		ChatPermissionChecker checker = getChatPermissionChecker(chatRoom);

		if (checker.isCanJoin() || checker.isCanSpy()) {

			boolean isOpen = chatRoom.getStatus() == RoomStatus.Opened.getValue();
			ChatRoomBean room = convertToChatRoomBean(chatRoom, checker.isCanJoin(), checker.isCanSpy(), isOpen);
			retorno.add(room);
		}
	}

	ChatRoomBean[] result = new ChatRoomBean[(retorno.size())];
	return retorno.toArray(result);
}
 
开发者ID:camaradosdeputadosoficial,项目名称:edemocracia,代码行数:38,代码来源:ChatRoomServiceImpl.java



注:本文中的com.liferay.portal.kernel.dao.orm.RestrictionsFactoryUtil类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MongoURI类代码示例发布时间:2022-05-23
下一篇:
Java PsiBasedFormattingModel类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap