本文整理汇总了Java中com.mysema.query.types.Operation类的典型用法代码示例。如果您正苦于以下问题:Java Operation类的具体用法?Java Operation怎么用?Java Operation使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Operation类属于com.mysema.query.types包,在下文中一共展示了Operation类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: collectPredicatePathsInternal
import com.mysema.query.types.Operation; //导入依赖的package包/类
private static void collectPredicatePathsInternal(Expression<?> expression, List<Path<?>> paths) {
if (expression instanceof Path) {
paths.add((Path<?>) expression);
} else if (expression instanceof Operation) {
for (Expression exp : ((Operation<?>) expression).getArgs()) {
collectPredicatePathsInternal(exp, paths);
}
}
}
开发者ID:encircled,项目名称:Joiner,代码行数:10,代码来源:JoinerUtils.java
示例2: getExpressionLabel
import com.mysema.query.types.Operation; //导入依赖的package包/类
/**
* カラムメタデータに基づいて当該カラムの表記名を取得する。<br />
* 「AS」で別名が指定された場合は別名、そうでなければ、元のカラム名が得られる。カラム名を特定できない場合はnullが返却される。
*
* @param expression 対象の式。
* @return 表記名。
*/
public static String getExpressionLabel(Expression<?> expression) {
if (expression instanceof Operation) {
Operation<?> op = (Operation<?>) expression;
if (op.getOperator() == Ops.ALIAS) {
return ((Path<?>) op.getArg(1)).getMetadata().getName();
}
}
if (expression instanceof Path) {
return getColumnMetadata((Path<?>) expression).getName();
}
return null;
}
开发者ID:agwlvssainokuni,项目名称:sqlapp,代码行数:20,代码来源:QueryDslUtil.java
示例3: visit
import com.mysema.query.types.Operation; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@SuppressWarnings("unchecked")
@Override
public Map<String, ByteBuffer> visit(Operation<?> expr, Map<String, ByteBuffer> context) {
LOGGER.trace("msg=Visiting operation expression", expr);
for (Expression<?> arg : expr.getArgs()) {
arg.accept(this, context);
}
if (constantStack.size() >= 2) {
Operator<?> operator = expr.getOperator();
if (!SUPPORTED_OPS.contains(operator)) {
throw new IllegalArgumentException(
String.format("Operator '%s' isn't supported, supported are '%s'", operator, SUPPORTED_OPS));
}
Constant<?> rhs = constantStack.pop();
Constant<?> lhs = constantStack.pop();
context.put(
lhs.toString(),
SerializerFactory.inferSerializer(rhs.getType()).toByteBuffer(rhs.getConstant()));
LOGGER.trace("lhs={}, lhsType={}, rhs={}, rhsType={}, msg=Consumed two constants for operator {}",
lhs,
lhs.getType(),
rhs,
rhs.getType(),
operator);
}
return context;
}
开发者ID:ceineke,项目名称:astyanax-jpa,代码行数:31,代码来源:PredicateSerializerVisitor.java
示例4: handle
import com.mysema.query.types.Operation; //导入依赖的package包/类
private Object handle(Operation<?> expr, int i) {
return expr.getArg(i).accept(this, null);
}
开发者ID:mysema,项目名称:vaadin-querydsl-prototype,代码行数:4,代码来源:VaadinExpressionVisitor.java
示例5: visit
import com.mysema.query.types.Operation; //导入依赖的package包/类
public Object visit(Operation<?> expr, @Nullable Void context) {
Operator<?> op = expr.getOperator();
if (op == Ops.OR) {
return new Or((Filter)handle(expr, 0), (Filter)handle(expr, 1));
} else if (op == Ops.AND) {
return new And((Filter)handle(expr, 0), (Filter)handle(expr, 1));
} else if (op == Ops.NOT) {
return new Not((Filter)handle(expr, 0));
} else if (op == Ops.LIKE) {
return new Like((String)handle(expr, 0), (String)handle(expr, 1));
} else if (op == Ops.EQ) {
return new Equal(handle(expr, 0), handle(expr, 1));
} else if (op == Ops.EQ_IGNORE_CASE) {
// not supported
} else if (op == Ops.NE) {
return new Not(new Equal(handle(expr, 0), handle(expr, 1)));
} else if (op == Ops.IS_NULL) {
return new IsNull(handle(expr, 0));
} else if (op == Ops.STARTS_WITH) {
return new SimpleStringFilter(handle(expr, 0), (String)handle(expr, 1), false, true);
} else if (op == Ops.STARTS_WITH_IC) {
return new SimpleStringFilter(handle(expr, 0), (String)handle(expr, 1), true, true);
} else if (op == Ops.ENDS_WITH) {
// not supported
} else if (op == Ops.ENDS_WITH_IC) {
// not supported
} else if (op == Ops.STRING_CONTAINS) {
return new SimpleStringFilter(handle(expr, 0), (String)handle(expr, 1), false, false);
} else if (op == Ops.STRING_CONTAINS_IC) {
return new SimpleStringFilter(handle(expr, 0), (String)handle(expr, 1), true, false);
} else if (op == Ops.BETWEEN) {
return new Between((Object)handle(expr, 0), (Comparable)handle(expr, 1), (Comparable)handle(expr, 2));
} else if (op == Ops.IN) {
// not supported
} else if (op == Ops.NOT_IN) {
// not supported
} else if (op == Ops.LT) {
return new Less(handle(expr, 0), handle(expr, 1));
} else if (op == Ops.GT) {
return new Greater(handle(expr, 0), handle(expr, 1));
} else if (op == Ops.LOE) {
return new LessOrEqual(handle(expr, 0), handle(expr, 1));
} else if (op == Ops.GOE) {
return new GreaterOrEqual(handle(expr, 0), handle(expr, 1));
}
throw new UnsupportedOperationException("Illegal operation " + expr);
}
开发者ID:mysema,项目名称:vaadin-querydsl-prototype,代码行数:48,代码来源:VaadinExpressionVisitor.java
示例6: resolveOperation
import com.mysema.query.types.Operation; //导入依赖的package包/类
/**
* Resolves all correct paths used in specified <code>operation</code>
*
* @param operation original operation
* @param joins all query joins
* @param usedAliases paths that are present in joins
* @return rebuilt predicate
* @see PredicateAliasResolver#resolvePath(Path, Map, Set)
*/
Predicate resolveOperation(Operation<?> operation, List<JoinDescription> joins, Set<Path<?>> usedAliases);
开发者ID:encircled,项目名称:Joiner,代码行数:11,代码来源:PredicateAliasResolver.java
注:本文中的com.mysema.query.types.Operation类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论