当前位置: 首页>>代码示例>>Java>>正文


Java BooleanBuilder.and方法代码示例

本文整理汇总了Java中com.querydsl.core.BooleanBuilder.and方法的典型用法代码示例。如果您正苦于以下问题:Java BooleanBuilder.and方法的具体用法?Java BooleanBuilder.and怎么用?Java BooleanBuilder.and使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.querydsl.core.BooleanBuilder的用法示例。


在下文中一共展示了BooleanBuilder.and方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildMapQuery

import com.querydsl.core.BooleanBuilder; //导入方法依赖的package包/类
private Predicate buildMapQuery(MapQuery query, MapPath<String, Object, SimplePath<Object>> properties) {

        if (query.isEmpty()) {
            return null;
        }

        BooleanBuilder predicate = new BooleanBuilder();

        if (query.getContainsKey() != null) {
            predicate.and(properties.containsKey(query.getContainsKey()));
        }

        if (query.getContainsValue() != null) {
            predicate.and(properties.containsValue(query.getContainsValue()));
        }

        if (!query.getHas().isEmpty()) {
            for (Iterator<String> iterator = query.getHas().keySet().iterator(); iterator.hasNext();) {
                String key = iterator.next();
                predicate.and(properties.contains(key, query.getHas().get(key)));
            }
        }

        return predicate;
    }
 
开发者ID:raptorbox,项目名称:raptor,代码行数:26,代码来源:TreeQueryBuilder.java

示例2: buildTextQuery

import com.querydsl.core.BooleanBuilder; //导入方法依赖的package包/类
private Predicate buildTextQuery(TextQuery txt, StringPath txtfield) {

        if (txt.isEmpty()) {
            return null;
        }

        BooleanBuilder predicate = new BooleanBuilder();

        if (txt.getContains() != null) {
            predicate.and(txtfield.contains(txt.getContains()));
        }

        if (txt.getStartWith() != null) {
            predicate.and(txtfield.startsWith(txt.getStartWith()));
        }

        if (txt.getEndWith() != null) {
            predicate.and(txtfield.endsWith(txt.getEndWith()));
        }

        if (txt.getEquals() != null) {
            predicate.and(txtfield.endsWith(txt.getEquals()));
        }

        return predicate;
    }
 
开发者ID:raptorbox,项目名称:raptor,代码行数:27,代码来源:DataQueryBuilder.java

示例3: buildAppUserListQuery

import com.querydsl.core.BooleanBuilder; //导入方法依赖的package包/类
private Predicate buildAppUserListQuery(StringListQuery query, ListPath<AppUser, QAppUser> list) {

        if (query.isEmpty()) {
            return null;
        }

        BooleanBuilder predicate = new BooleanBuilder();

        if (query.getIn() != null) {
            predicate.and(list.any().id.in(query.getIn()));
        }

        return predicate;
    }
 
开发者ID:raptorbox,项目名称:raptor,代码行数:15,代码来源:AppQueryBuilder.java

示例4: getDevices

import com.querydsl.core.BooleanBuilder; //导入方法依赖的package包/类
@RequestMapping(method = RequestMethod.GET)
@ApiOperation(value = "Return the user devices", notes = "", response = Device.class, nickname = "getDevices")
@PreAuthorize("@raptorSecurity.list(principal, 'device')")

public ResponseEntity<?> getDevices(
        @AuthenticationPrincipal User currentUser,
        Pageable pageable
) {

    String userId = currentUser.getId();
    if (currentUser.isAdmin()) {
        userId = null;
    }

    QDevice device = new QDevice("device");
    BooleanBuilder predicate = new BooleanBuilder();

    if (userId != null) {
        predicate.and(device.userId.eq(userId));
    }
    
    Page<Device> result = deviceService.search(predicate, pageable);
    
    return ResponseEntity.ok(result);
}
 
开发者ID:raptorbox,项目名称:raptor,代码行数:26,代码来源:InventoryController.java

示例5: extend

import com.querydsl.core.BooleanBuilder; //导入方法依赖的package包/类
@Override
public void extend(@Nonnull RequirementSearchContext context) {
    QVariableInstanceEntity variableEntity = new QVariableInstanceEntity(variableName);
    RequirementSearchQuery query = context.getQuery();
    RequirementSearchAliases $ = context.getAliases();

    createSelect(variableEntity, context);

    query.leftJoin($.flowInstance.variables, variableEntity).on(variableEntity.name.eq(variableName));

    QuickFilter quickFilter = context.getQuickFilter();
    if (context.getQuickFilter().hasFilter()) {
        BooleanBuilder filterBooleanBuilder = new BooleanBuilder();
        for (FilterToken token : quickFilter.listFilterTokens()) {
            BooleanBuilder tokenBooleanBuilder = new BooleanBuilder();
            for (String filter : token.getAllPossibleMatches()) {
                tokenBooleanBuilder.or(toChar(variableEntity).likeIgnoreCase(filter));
            }
            filterBooleanBuilder.and(tokenBooleanBuilder);
        }
        query.getQuickFilterWhereClause().or(filterBooleanBuilder);
    }
}
 
开发者ID:opensingular,项目名称:singular-server,代码行数:24,代码来源:FlowVariableRequirementSearchExtender.java

示例6: listByClub

import com.querydsl.core.BooleanBuilder; //导入方法依赖的package包/类
@Transactional(readOnly = true)
public List<HarvestPermitAreaDTO> listByClub(final long clubId, final Integer huntingYear) {
    final HuntingClub huntingClub = requireClubWithReadPermission(clubId);

    final BooleanBuilder builder = new BooleanBuilder(QHarvestPermitArea.harvestPermitArea.club.eq(huntingClub));

    if (huntingYear != null) {
        builder.and(QHarvestPermitArea.harvestPermitArea.huntingYear.eq(huntingYear));
    }

    return harvestPermitAreaDTOTransformer.transform(harvestPermitAreaRepository.findAllAsList(builder.getValue()));
}
 
开发者ID:suomenriistakeskus,项目名称:oma-riista-web,代码行数:13,代码来源:HarvestPermitAreaFeature.java

示例7: buildTextQuery

import com.querydsl.core.BooleanBuilder; //导入方法依赖的package包/类
private Predicate buildTextQuery(TextQuery txt, StringPath txtfield) {

        if (txt.isEmpty()) {
            return null;
        }

        BooleanBuilder predicate = new BooleanBuilder();

        if (txt.getContains() != null) {
            predicate.and(txtfield.contains(txt.getContains()));
        }

        if (txt.getStartWith() != null) {
            predicate.and(txtfield.startsWith(txt.getStartWith()));
        }

        if (txt.getEndWith() != null) {
            predicate.and(txtfield.endsWith(txt.getEndWith()));
        }

        if (txt.getEquals() != null) {
            predicate.and(txtfield.endsWith(txt.getEquals()));
        }

        if (!txt.getIn().isEmpty()) {
            predicate.and(txtfield.in(txt.getIn()));
        }

        return predicate;
    }
 
开发者ID:raptorbox,项目名称:raptor,代码行数:31,代码来源:TreeQueryBuilder.java

示例8: getPredicate

import com.querydsl.core.BooleanBuilder; //导入方法依赖的package包/类
public Predicate getPredicate() {

        QApp app = new QApp("app");

        BooleanBuilder predicate = new BooleanBuilder();

        if (query.getUserId() != null) {
            predicate.and(app.userId.eq(query.getUserId()));
        }

        // id
        Predicate pid = buildTextQuery(query.id, app.id);
        if (pid != null) {
            predicate.and(pid);
        }

        // name
        Predicate pname = buildTextQuery(query.name, app.name);
        if (pname != null) {
            predicate.and(pname);
        }

        // description
        Predicate pdesc = buildTextQuery(query.description, app.description);
        if (pdesc != null) {
            predicate.and(pdesc);
        }

        //users (id)
        Predicate users = buildAppUserListQuery(query.users, app.users);
        if (users != null) {
            predicate.and(users);
        }

        return predicate;
    }
 
开发者ID:raptorbox,项目名称:raptor,代码行数:37,代码来源:AppQueryBuilder.java

示例9: buildListQuery

import com.querydsl.core.BooleanBuilder; //导入方法依赖的package包/类
private Predicate buildListQuery(StringListQuery query, ListPath<String, StringPath> list) {

        if (query.isEmpty()) {
            return null;
        }

        BooleanBuilder predicate = new BooleanBuilder();

        if (query.getIn() != null && query.getIn().isEmpty()) {
            predicate.and(list.any().in(query.getIn()));
        }

        return predicate;
    }
 
开发者ID:raptorbox,项目名称:raptor,代码行数:15,代码来源:AppQueryBuilder.java

示例10: getNumberOfActiveAccomodationsForRoom

import com.querydsl.core.BooleanBuilder; //导入方法依赖的package包/类
@Override
public Long getNumberOfActiveAccomodationsForRoom(Long allocationEntityId) {
	QAccomodation accomodation = QAccomodation.accomodation;
	JPAQueryFactory queryFactory = new JPAQueryFactory(entityManager);
	BooleanBuilder builder = new BooleanBuilder();

	builder.and(accomodation.residence.state.eq(State.CURRENT));
	builder.and(accomodation.allocationEntity.id.eq(allocationEntityId));

	return queryFactory.from(accomodation).select(accomodation).where(builder)
			.fetchCount();
}
 
开发者ID:marcin-pwr,项目名称:hotel,代码行数:13,代码来源:AccomodationRepositoryImpl.java

示例11: appendFilterByQuickFilter

import com.querydsl.core.BooleanBuilder; //导入方法依赖的package包/类
private void appendFilterByQuickFilter() {
    if (ctx.getQuickFilter().hasFilter()) {
        BooleanBuilder filterBooleanBuilder = new BooleanBuilder();
        for (FilterToken token : quickFilter.listFilterTokens()) {
            BooleanBuilder tokenBooleanBuilder = new BooleanBuilder();
            for (String filter : token.getAllPossibleMatches()) {
                tokenBooleanBuilder.or(buildQuickFilterBooleanExpression($, filter));
            }
            filterBooleanBuilder.and(tokenBooleanBuilder);
        }
        query.getQuickFilterWhereClause().or(filterBooleanBuilder);
    }
}
 
开发者ID:opensingular,项目名称:singular-server,代码行数:14,代码来源:RequirementSearchQueryFactory.java

示例12: listOrderedByDateTypeStatus

import com.querydsl.core.BooleanBuilder; //导入方法依赖的package包/类
@Override
public List<E> listOrderedByDateTypeStatus(Date startDate, Date endDate, IExecutionType executionType, ExecutionStatus executionStatus,
		Integer limit, Integer offset) {
	Path<E> path = new EntityPathBase<E>(getObjectClass(), QAbstractExecution.abstractExecution.getMetadata());
	QAbstractExecution qAbstractExecution = new QAbstractExecution(path);
	
	BooleanBuilder builder = new BooleanBuilder();
	if (startDate != null) {
		builder.and(qAbstractExecution.startDate.gt(startDate));
	}
	if (endDate != null) {
		builder.and(qAbstractExecution.endDate.lt(endDate));
	}
	if (executionType != null) {
		builder.and(qAbstractExecution.executionType.eq(executionType));
	}
	if (executionStatus != null) {
		builder.and(qAbstractExecution.executionStatus.eq(executionStatus));
	}
	
	JPAQuery<E> jpaQuery = new JPAQuery<>(getEntityManager())
		.select(path)
		.from(qAbstractExecution)
		.orderBy(qAbstractExecution.startDate.desc());
	if (limit != null) {
		jpaQuery.limit(limit);
	}
	if (offset != null) {
		jpaQuery.offset(offset);
	}
	return jpaQuery.fetch();
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:33,代码来源:AbstractExecutionDaoImpl.java

示例13: isEmailUnique

import com.querydsl.core.BooleanBuilder; //导入方法依赖的package包/类
public static boolean isEmailUnique(JPAQueryFactory jpaQueryFactory, Long userId,
		String email) {
	if (StringUtils.hasText(email)) {
		BooleanBuilder bb = new BooleanBuilder(
				QUser.user.email.equalsIgnoreCase(email));
		if (userId != null) {
			bb.and(QUser.user.id.ne(userId));
		}
		return jpaQueryFactory.select(Expressions.ONE).from(QUser.user).where(bb)
				.fetchFirst() == null;
	}

	return true;
}
 
开发者ID:ralscha,项目名称:eds-starter6-jpa,代码行数:15,代码来源:UserService.java

示例14: isLoginNameUnique

import com.querydsl.core.BooleanBuilder; //导入方法依赖的package包/类
public static boolean isLoginNameUnique(JPAQueryFactory jpaQueryFactory, Long userId,
		String loginName) {
	if (StringUtils.hasText(loginName)) {
		BooleanBuilder bb = new BooleanBuilder(
				QUser.user.loginName.equalsIgnoreCase(loginName));
		if (userId != null) {
			bb.and(QUser.user.id.ne(userId));
		}
		return jpaQueryFactory.select(Expressions.ONE).from(QUser.user).where(bb)
				.fetchFirst() == null;
	}

	return true;
}
 
开发者ID:ralscha,项目名称:eds-starter6-jpa,代码行数:15,代码来源:UserService.java

示例15: createFinalPredicate

import com.querydsl.core.BooleanBuilder; //导入方法依赖的package包/类
private Predicate createFinalPredicate() {
    BooleanBuilder predicate = new BooleanBuilder();

    for (Predicate columnPredicate : columnPredicates) {
        predicate = predicate.and(columnPredicate);
    }

    if (!globalPredicates.isEmpty()) {
        predicate = predicate.andAnyOf(globalPredicates.toArray(new Predicate[0]));
    }

    return predicate;
}
 
开发者ID:darrachequesne,项目名称:spring-data-jpa-datatables,代码行数:14,代码来源:PredicateBuilder.java


注:本文中的com.querydsl.core.BooleanBuilder.and方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。