com.mysema.query.types.OrderSpecifier Java Examples
The following examples show how to use
com.mysema.query.types.OrderSpecifier.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: QuerydslUtilsBeanImpl.java From gvnix with GNU General Public License v3.0 | 6 votes |
/** * {@inheritDoc} */ @Override public <T, E extends Comparable<?>> OrderSpecifier<?> createOrderSpecifier( PathBuilder<T> entityPath, String fieldName, Class<E> fieldType, Order order) { OrderSpecifier<?> orderBy = null; // Get the OrderSpecifier if (order == Order.ASC) { orderBy = entityPath.getComparable(fieldName, fieldType).asc(); } else if (order == Order.DESC) { orderBy = entityPath.getComparable(fieldName, fieldType).desc(); } return orderBy; }
Example #2
Source File: QuerydslSQL.java From spring-boot-practice with Apache License 2.0 | 5 votes |
private OrderSpecifier.NullHandling toQueryDslNullHandling(org.springframework.data.domain.Sort.NullHandling nullHandling) { Assert.notNull(nullHandling, "NullHandling must not be null!"); switch (nullHandling) { case NULLS_FIRST: return OrderSpecifier.NullHandling.NullsFirst; case NULLS_LAST: return OrderSpecifier.NullHandling.NullsLast; case NATIVE: default: return OrderSpecifier.NullHandling.Default; } }
Example #3
Source File: QuerydslSQL.java From spring-boot-practice with Apache License 2.0 | 5 votes |
private OrderSpecifier.NullHandling toQueryDslNullHandling(org.springframework.data.domain.Sort.NullHandling nullHandling) { Assert.notNull(nullHandling, "NullHandling must not be null!"); switch (nullHandling) { case NULLS_FIRST: return OrderSpecifier.NullHandling.NullsFirst; case NULLS_LAST: return OrderSpecifier.NullHandling.NullsLast; case NATIVE: default: return OrderSpecifier.NullHandling.Default; } }
Example #4
Source File: QuerydslUtils.java From gvnix with GNU General Public License v3.0 | 5 votes |
/** * Create an order-by-element in a Query instance * * @param entityPath Full path to entity and associations. For example: * {@code Pet} , {@code Pet.owner} * @param fieldName Property name in the given entity path. For example: * {@code weight} in {@code Pet} entity, {@code age} in * {@code Pet.owner} entity. * @param fieldType Property value {@code Class}. Must implements * {@link Comparable} * @param order ascending or descending order * @return */ public static <T, E extends Comparable<?>> OrderSpecifier<?> createOrderSpecifier( PathBuilder<T> entityPath, String fieldName, Class<E> fieldType, Order order) { OrderSpecifier<?> orderBy = null; // Get the OrderSpecifier if (order == Order.ASC) { orderBy = entityPath.getComparable(fieldName, fieldType).asc(); } else if (order == Order.DESC) { orderBy = entityPath.getComparable(fieldName, fieldType).desc(); } return orderBy; }
Example #5
Source File: EntityFunctionPackage.java From java-platform with Apache License 2.0 | 4 votes |
public Iterable<T> findAll(Predicate predicate, OrderSpecifier<?>... orders) { return baseService.findAll(predicate, orders); }
Example #6
Source File: EntityFunctionPackage.java From java-platform with Apache License 2.0 | 4 votes |
public Iterable<T> findAll(OrderSpecifier<?>... orders) { return baseService.findAll(orders); }
Example #7
Source File: BaseService.java From java-platform with Apache License 2.0 | 4 votes |
public Iterable<T> findAll(Predicate predicate, OrderSpecifier<?>... orders) { return baseRepository.findAll(predicate, orders); }
Example #8
Source File: BaseService.java From java-platform with Apache License 2.0 | 4 votes |
public Iterable<T> findAll(OrderSpecifier<?>... orders) { return baseRepository.findAll(orders); }
Example #9
Source File: QuerydslSQL.java From spring-boot-practice with Apache License 2.0 | 4 votes |
private JPASQLQuery addOrderByFrom(QSort qsort, JPASQLQuery query) { List<OrderSpecifier<?>> orderSpecifiers = qsort.getOrderSpecifiers(); return query.orderBy(orderSpecifiers.toArray(new OrderSpecifier[orderSpecifiers.size()])); }
Example #10
Source File: QuerydslSQL.java From spring-boot-practice with Apache License 2.0 | 4 votes |
@SuppressWarnings({"rawtypes", "unchecked"}) private OrderSpecifier<?> toOrderSpecifier(Sort.Order order) { return new OrderSpecifier(order.isAscending() ? com.mysema.query.types.Order.ASC : com.mysema.query.types.Order.DESC, buildOrderPropertyPathFrom(order), toQueryDslNullHandling(order.getNullHandling())); }
Example #11
Source File: QuerydslSQL.java From spring-boot-practice with Apache License 2.0 | 4 votes |
private JPASQLQuery addOrderByFrom(QSort qsort, JPASQLQuery query) { List<OrderSpecifier<?>> orderSpecifiers = qsort.getOrderSpecifiers(); return query.orderBy(orderSpecifiers.toArray(new OrderSpecifier[orderSpecifiers.size()])); }
Example #12
Source File: QuerydslSQL.java From spring-boot-practice with Apache License 2.0 | 4 votes |
@SuppressWarnings({"rawtypes", "unchecked"}) private OrderSpecifier<?> toOrderSpecifier(Sort.Order order) { return new OrderSpecifier(order.isAscending() ? com.mysema.query.types.Order.ASC : com.mysema.query.types.Order.DESC, buildOrderPropertyPathFrom(order), toQueryDslNullHandling(order.getNullHandling())); }
Example #13
Source File: SQLTemplatesService.java From spring-boot-practice with Apache License 2.0 | 4 votes |
default StringExpression groupConcat(StringPath path, OrderSpecifier orderSpecifier) { return StringTemplate.create("GROUP_CONCAT({0} order by {1})", path, orderSpecifier); }
Example #14
Source File: QuerydslUtilsBean.java From gvnix with GNU General Public License v3.0 | 2 votes |
/** * Create an order-by-element in a Query instance * * @param entityPath Full path to entity and associations. For example: * {@code Pet} , {@code Pet.owner} * @param fieldName Property name in the given entity path. For example: * {@code weight} in {@code Pet} entity, {@code age} in * {@code Pet.owner} entity. * @param fieldType Property value {@code Class}. Must implements * {@link Comparable} * @param order ascending or descending order * @return */ public <T, E extends Comparable<?>> OrderSpecifier<?> createOrderSpecifier( PathBuilder<T> entityPath, String fieldName, Class<E> fieldType, Order order);