本文整理汇总了Java中com.mysema.query.types.path.EntityPathBase类的典型用法代码示例。如果您正苦于以下问题:Java EntityPathBase类的具体用法?Java EntityPathBase怎么用?Java EntityPathBase使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EntityPathBase类属于com.mysema.query.types.path包,在下文中一共展示了EntityPathBase类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createListPredicate
import com.mysema.query.types.path.EntityPathBase; //导入依赖的package包/类
private static <T> Predicate createListPredicate(List<T> list, EntityPathBase<T> base) {
if (list == null || list.isEmpty()) {
return null;
}
if (list.size() == 1) {
return base.eq(list.get(0));
}
BooleanExpression expr = base.eq(list.get(0));
for (int i = 1; i < list.size(); i++) {
expr = expr.or(base.eq(list.get(i)));
}
return expr;
}
开发者ID:Evolveum,项目名称:gizmo-v3,代码行数:17,代码来源:AbstractTaskDataProvider.java
示例2: testAliasCandidate
import com.mysema.query.types.path.EntityPathBase; //导入依赖的package包/类
private void testAliasCandidate(Class<?> targetType, List<Path<?>> candidatePaths, Object candidate) {
if (candidate instanceof CollectionPathBase) {
Field elementTypeField = ReflectionUtils.findField(candidate.getClass(), "elementType");
Class<?> elementType = (Class<?>) getField(elementTypeField, candidate);
if (elementType.isAssignableFrom(targetType)) {
candidatePaths.add((Path<?>) candidate);
}
} else if (candidate instanceof EntityPathBase) {
Class<?> type = ((EntityPathBase) candidate).getType();
if (type.isAssignableFrom(targetType)) {
candidatePaths.add((Path<?>) candidate);
}
}
}
开发者ID:encircled,项目名称:Joiner,代码行数:16,代码来源:DefaultAliasResolver.java
示例3: addPagingAndSorting
import com.mysema.query.types.path.EntityPathBase; //导入依赖的package包/类
public static void addPagingAndSorting(JPQLQuery query,
ExtDirectStoreReadRequest request, Class<?> clazz,
EntityPathBase<?> entityPathBase, Map<String, String> mapGuiColumn2Dbfield,
Set<String> sortIgnoreProperties) {
if (request.getStart() != null && request.getLimit() != null
&& request.getLimit() > 0) {
query.offset(request.getStart()).limit(request.getLimit());
}
addSorting(query, request, clazz, entityPathBase, mapGuiColumn2Dbfield,
sortIgnoreProperties);
}
开发者ID:khun777,项目名称:edsutil,代码行数:14,代码来源:QueryUtil.java
示例4: addSorting
import com.mysema.query.types.path.EntityPathBase; //导入依赖的package包/类
public static void addSorting(JPQLQuery query, ExtDirectStoreReadRequest request,
Class<?> clazz, EntityPathBase<?> entityPathBase,
Map<String, String> mapGuiColumn2Dbfield, Set<String> sortIgnoreProperties) {
if (!request.getSorters().isEmpty()) {
query.orderBy(createOrderSpecifiers(request, clazz, entityPathBase,
mapGuiColumn2Dbfield, sortIgnoreProperties));
}
}
开发者ID:khun777,项目名称:edsutil,代码行数:11,代码来源:QueryUtil.java
示例5: createOrderSpecifiers
import com.mysema.query.types.path.EntityPathBase; //导入依赖的package包/类
@SuppressWarnings({ "rawtypes", "unchecked" })
public static OrderSpecifier[] createOrderSpecifiers(
ExtDirectStoreReadRequest request, Class<?> clazz,
EntityPathBase<?> entityPathBase, Map<String, String> mapGuiColumn2Dbfield,
Set<String> sortIgnoreProperties) {
List<OrderSpecifier> orders;
if (!request.getSorters().isEmpty()) {
orders = new ArrayList<>();
PathBuilder<?> entityPath = new PathBuilder<>(clazz,
entityPathBase.getMetadata());
for (SortInfo sortInfo : request.getSorters()) {
if (!sortIgnoreProperties.contains(sortInfo.getProperty())) {
Order order;
if (sortInfo.getDirection() == SortDirection.ASCENDING) {
order = Order.ASC;
}
else {
order = Order.DESC;
}
String property = mapGuiColumn2Dbfield.get(sortInfo.getProperty());
if (property == null) {
property = sortInfo.getProperty();
}
orders.add(new OrderSpecifier(order, entityPath.get(property)));
}
}
}
else {
orders = Collections.emptyList();
}
return orders.toArray(new OrderSpecifier[orders.size()]);
}
开发者ID:khun777,项目名称:edsutil,代码行数:40,代码来源:QueryUtil.java
示例6: toDSL
import com.mysema.query.types.path.EntityPathBase; //导入依赖的package包/类
protected <D extends BaseEntity, D2 extends EntityPathBase<D>> D2 toDSL(Path<?> path, Class<D2> dslEntityClass) {
try {
return dslEntityClass.getDeclaredConstructor(Path.class).newInstance(path);
} catch (InstantiationException | IllegalAccessException | IllegalArgumentException |
InvocationTargetException | NoSuchMethodException | SecurityException e) {
AbstractDAO.log.error(e.getMessage(), e);
}
return null;
}
开发者ID:premium-minds,项目名称:billy,代码行数:11,代码来源:AbstractDAO.java
示例7: getOrderSpecifier
import com.mysema.query.types.path.EntityPathBase; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private Optional<OrderSpecifier> getOrderSpecifier(QueryParameters parameters, Expression<?>... args) {
final String sortColumn = parameters.getSortColumn();
final String sortDirection = parameters.getSortDirection();
if (StringUtils.hasText(sortColumn) && StringUtils.hasText(sortDirection)) {
Order order = (Sort.Direction.ASC.compareTo(pageableFactory.getDirection(sortDirection)) == 0) ? Order.ASC : Order.DESC;
return Optional.of(new OrderSpecifier(order, new EntityPathBase(args[0].getType(), suppressUniquePrefixIfAny(sortColumn))));
}
return Optional.absent();
}
开发者ID:fernaspiazu,项目名称:recruiting-old-style,代码行数:11,代码来源:PaginationServiceImpl.java
注:本文中的com.mysema.query.types.path.EntityPathBase类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论