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


Java SimpleExpression类代码示例

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


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

示例1: idEqIfGiven

import com.querydsl.core.types.dsl.SimpleExpression; //导入依赖的package包/类
public static <K extends Serializable & Comparable<K>, T extends GenericEntity<K, ?>> BooleanExpression idEqIfGiven(SimpleExpression<K> path, T value) {
	if (value != null) {
		return path.eq(value.getId());
	} else {
		return null;
	}
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:8,代码来源:Expressions2.java

示例2: inIfGiven

import com.querydsl.core.types.dsl.SimpleExpression; //导入依赖的package包/类
public static <T> BooleanExpression inIfGiven(SimpleExpression<T> path, Collection<? extends T> subset) {
	if (subset != null && !subset.isEmpty()) {
		return path.in(subset);
	} else {
		return null;
	}
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:8,代码来源:Expressions2.java

示例3: matchAllIfGiven

import com.querydsl.core.types.dsl.SimpleExpression; //导入依赖的package包/类
protected <P extends Comparable<?>> BooleanExpression matchAllIfGiven(SimpleExpression<P> simpleExpression, Collection<? extends P> possibleValues) {
	if (possibleValues != null && !possibleValues.isEmpty()) {
		BooleanExpression rootExpression = null;
		for (P possibleValue : possibleValues) {
			if (rootExpression == null) {
				rootExpression = simpleExpression.eq(possibleValue);
			} else {
				rootExpression = rootExpression.and(simpleExpression.eq(possibleValue));
			}
		}
		return rootExpression;
	}
	return null;
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:15,代码来源:AbstractJpaSearchQuery.java

示例4: append

import com.querydsl.core.types.dsl.SimpleExpression; //导入依赖的package包/类
@SafeVarargs
public static <T extends SimpleExpression<?>, V> void append(BooleanBuilder builder,
                                                             V value,
                                                             BiFunction<T, V, BooleanExpression> operation,
                                                             T path,
                                                             T... paths) {
    checkNotNull(builder);
    checkNotNull(operation);
    checkNotNull(path);
    builder.and(Stream.concat(Stream.of(path), Stream.of(paths))
            .filter(e -> value != null && e != null)
            .map(e -> operation.apply(e, value))
            .collect(toBooleanBuilder()));
}
 
开发者ID:yanaga,项目名称:querydsl-args,代码行数:15,代码来源:Arguments.java

示例5: testAppendNullWithOperationAndTwoArguments

import com.querydsl.core.types.dsl.SimpleExpression; //导入依赖的package包/类
@Test
public void testAppendNullWithOperationAndTwoArguments() throws Exception {
	BooleanBuilder builder = new BooleanBuilder();
	Arguments.<SimpleExpression, CustomNumberType>append(builder, null, SimpleExpression::eq, QPerson.person.oneCustomNumberType, QPerson.person.anotherCustomNumberType);
	List<Person> result = new JPAQuery<Void>(entityManager).select(QPerson.person).from(QPerson.person).where(builder).fetch();
	assertThat(result.size()).isEqualTo(1);
}
 
开发者ID:yanaga,项目名称:querydsl-args,代码行数:8,代码来源:ArgumentsTest.java

示例6: findForeignHolder

import com.querydsl.core.types.dsl.SimpleExpression; //导入依赖的package包/类
public <T extends CatalogItem, P extends CatalogItem> List<P> findForeignHolder(EntityPath<P> hp,
                                                                                ListPath<T, ? extends SimpleExpression<T>> h, T c) {

    return new JPAQueryFactory(entityManager)
            .selectFrom(hp)
            .where(h.contains(c))
            .fetch();
}
 
开发者ID:remibantos,项目名称:jeeshop,代码行数:9,代码来源:CatalogItemFinder.java

示例7: addParentPredicate

import com.querydsl.core.types.dsl.SimpleExpression; //导入依赖的package包/类
@Override
public void addParentPredicate(MetaAttribute primaryKeyAttr) {
	List<?> parentIds = queryImpl.getParentIds();
	SimpleExpression<?> parentIdPath = (SimpleExpression<?>) QuerydslUtils.get(parentFrom, primaryKeyAttr.getName());
	addPredicate(parentIdPath.in((List) parentIds));
}
 
开发者ID:katharsis-project,项目名称:katharsis-framework,代码行数:7,代码来源:QuerydslQueryBackend.java

示例8: eqIfGiven

import com.querydsl.core.types.dsl.SimpleExpression; //导入依赖的package包/类
public static <T> BooleanExpression eqIfGiven(SimpleExpression<T> path, T value) {
	return value == null ? null : path.eq(value);
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:4,代码来源:Expressions2.java

示例9: getByField

import com.querydsl.core.types.dsl.SimpleExpression; //导入依赖的package包/类
protected <T extends E, V extends Comparable<?>> T getByField(EntityPath<T> entityPath, SimpleExpression<V> field, V fieldValue) {
	return queryByPredicate(entityPath, eqOrIsNull(field, fieldValue)).fetchOne();
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:4,代码来源:AbstractEntityDaoImpl.java

示例10: listByField

import com.querydsl.core.types.dsl.SimpleExpression; //导入依赖的package包/类
protected <T extends E, V extends Comparable<?>> List<T> listByField(EntityPath<T> entityPath, SimpleExpression<V> field, V fieldValue, OrderSpecifier<?>... orderSpecifiers) {
	return queryByPredicateOrdered(entityPath, eqOrIsNull(field, fieldValue), orderSpecifiers).fetch();
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:4,代码来源:AbstractEntityDaoImpl.java

示例11: countByField

import com.querydsl.core.types.dsl.SimpleExpression; //导入依赖的package包/类
protected <V extends Comparable<?>> Long countByField(EntityPath<? extends E> entityPath, SimpleExpression<V> field, V fieldValue) {
	return queryByPredicate(entityPath, eqOrIsNull(field, fieldValue)).distinct().fetchCount();
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:4,代码来源:AbstractEntityDaoImpl.java

示例12: eqOrIsNull

import com.querydsl.core.types.dsl.SimpleExpression; //导入依赖的package包/类
private static <V extends Comparable<?>> Predicate eqOrIsNull(SimpleExpression<V> field, V fieldValue) {
	return fieldValue != null ? field.eq(fieldValue) : field.isNull() ;
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:4,代码来源:AbstractEntityDaoImpl.java

示例13: getByField

import com.querydsl.core.types.dsl.SimpleExpression; //导入依赖的package包/类
@Override
public <T extends Person, V extends Comparable<?>> T getByField(EntityPath<T> entityPath,
		SimpleExpression<V> field, V fieldValue) {
	return super.getByField(entityPath, field, fieldValue);
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:6,代码来源:PersonDaoImpl.java

示例14: listByField

import com.querydsl.core.types.dsl.SimpleExpression; //导入依赖的package包/类
@Override
public <T extends Person, V extends Comparable<?>> List<T> listByField(EntityPath<T> entityPath,
		SimpleExpression<V> field, V fieldValue, OrderSpecifier<?> orderSpecifier) {
	return super.listByField(entityPath, field, fieldValue, orderSpecifier);
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:6,代码来源:PersonDaoImpl.java

示例15: countByField

import com.querydsl.core.types.dsl.SimpleExpression; //导入依赖的package包/类
@Override
public <V extends Comparable<?>> Long countByField(EntityPath<? extends Person> entityPath,
		SimpleExpression<V> field, V fieldValue) {
	return super.countByField(entityPath, field, fieldValue);
}
 
开发者ID:openwide-java,项目名称:owsi-core-parent,代码行数:6,代码来源:PersonDaoImpl.java


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