本文整理了Java中javax.persistence.criteria.Order.isAscending()
方法的一些代码示例,展示了Order.isAscending()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Order.isAscending()
方法的具体详情如下:
包路径:javax.persistence.criteria.Order
类名称:Order
方法名:isAscending
[英]Whether ascending ordering is in effect.
[中]升序是否有效。
代码示例来源:origin: hibernate/hibernate-orm
protected void renderOrderByClause(RenderingContext renderingContext, StringBuilder jpaqlBuffer) {
if ( getOrderList().isEmpty() ) {
return;
}
renderingContext.getClauseStack().push( Clause.ORDER );
try {
jpaqlBuffer.append( " order by " );
String sep = "";
for ( Order orderSpec : getOrderList() ) {
jpaqlBuffer.append( sep )
.append( ( (Renderable) orderSpec.getExpression() ).render( renderingContext ) )
.append( orderSpec.isAscending() ? " asc" : " desc" );
sep = ", ";
}
}
finally {
renderingContext.getClauseStack().pop();
}
}
}
代码示例来源:origin: babyfish-ct/babyfish
@Override
public void visitOrder(Order order) {
this.visit(order.getExpression());
this.jpqlBuilder.append(order.isAscending() ? " asc" : " desc");
}
代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.ejb
jpaqlQuery.append( sep )
.append( ( ( Renderable ) orderSpec.getExpression() ).render( renderingContext ) )
.append( orderSpec.isAscending() ? " asc" : " desc" );
sep = ", ";
代码示例来源:origin: Blazebit/blaze-persistence
private void renderOrderBy(OrderByBuilder<?> ob, RenderContextImpl context) {
if (orderList == null) {
return;
}
context.setClauseType(ClauseType.ORDER_BY);
for (Order order : orderList) {
context.getBuffer().setLength(0);
((AbstractSelection<?>) order.getExpression()).render(context);
String expression = context.takeBuffer();
Map<String, InternalQuery<?>> aliasToSubqueries = context.takeAliasToSubqueryMap();
if (aliasToSubqueries.isEmpty()) {
boolean nullsFirst = false;
if (order instanceof BlazeOrder) {
nullsFirst = ((BlazeOrder) order).isNullsFirst();
}
ob.orderBy(expression, order.isAscending(), nullsFirst);
} else {
throw new IllegalArgumentException("Subqueries are not supported in the order by clause!");
// MultipleSubqueryInitiator<?> initiator = ob.groupBySubqueries(expression);
//
// for (Map.Entry<String, InternalQuery<?>> subqueryEntry : aliasToSubqueries.entrySet()) {
// context.pushSubqueryInitiator(initiator.with(subqueryEntry.getKey()));
// subqueryEntry.getValue().renderSubquery(context);
// context.popSubqueryInitiator();
// }
//
// initiator.end();
}
}
}
代码示例来源:origin: com.blazebit/blaze-persistence-jpa-criteria-impl
private void renderOrderBy(OrderByBuilder<?> ob, RenderContextImpl context) {
if (orderList == null) {
return;
}
context.setClauseType(ClauseType.ORDER_BY);
for (Order order : orderList) {
context.getBuffer().setLength(0);
((AbstractSelection<?>) order.getExpression()).render(context);
String expression = context.takeBuffer();
Map<String, InternalQuery<?>> aliasToSubqueries = context.takeAliasToSubqueryMap();
if (aliasToSubqueries.isEmpty()) {
boolean nullsFirst = false;
if (order instanceof BlazeOrder) {
nullsFirst = ((BlazeOrder) order).isNullsFirst();
}
ob.orderBy(expression, order.isAscending(), nullsFirst);
} else {
throw new IllegalArgumentException("Subqueries are not supported in the order by clause!");
// MultipleSubqueryInitiator<?> initiator = ob.groupBySubqueries(expression);
//
// for (Map.Entry<String, InternalQuery<?>> subqueryEntry : aliasToSubqueries.entrySet()) {
// context.pushSubqueryInitiator(initiator.with(subqueryEntry.getKey()));
// subqueryEntry.getValue().renderSubquery(context);
// context.popSubqueryInitiator();
// }
//
// initiator.end();
}
}
}
代码示例来源:origin: babyfish-ct/babyfish
@Override
public void visitOrder(Order order) {
this
.append("Order")
.beginMap();
this.append("expression: ").append(order.getExpression()).appendLine(",");
this.append("ascending: ").append(order.isAscending()).appendLine();
this.endMap();
}
代码示例来源:origin: org.aksw.jena-sparql-api/jena-sparql-api-mapper
Expr e = x.accept(orderCompiler);
int dir = order.isAscending() ? Query.ORDER_ASCENDING : Query.ORDER_DESCENDING;
sortConditions.add(new SortCondition(e, dir));
代码示例来源:origin: SmartDataAnalytics/jena-sparql-api
Expr e = x.accept(orderCompiler);
int dir = order.isAscending() ? Query.ORDER_ASCENDING : Query.ORDER_DESCENDING;
sortConditions.add(new SortCondition(e, dir));
内容来源于网络,如有侵权,请联系作者删除!