private static StructuredQuery.OrderBy createOrderBy(DatastorePersistentEntity<?> persistentEntity, Sort.Order order) { if (order.isIgnoreCase()) { throw new DatastoreDataException("Datastore doesn't support sorting ignoring case"); } if (!order.getNullHandling().equals(Sort.NullHandling.NATIVE)) { throw new DatastoreDataException("Datastore supports only NullHandling.NATIVE null handling"); } return new StructuredQuery.OrderBy( persistentEntity.getPersistentProperty(order.getProperty()).getFieldName(), (order.getDirection() == Sort.Direction.DESC) ? StructuredQuery.OrderBy.Direction.DESCENDING : StructuredQuery.OrderBy.Direction.ASCENDING); }
public static OrderBy desc(String property) { return new OrderBy(property, OrderBy.Direction.DESCENDING); }
private static StructuredQuery.OrderBy createOrderBy(DatastorePersistentEntity<?> persistentEntity, Sort.Order order) { if (order.isIgnoreCase()) { throw new DatastoreDataException("Datastore doesn't support sorting ignoring case"); } if (!order.getNullHandling().equals(Sort.NullHandling.NATIVE)) { throw new DatastoreDataException("Datastore supports only NullHandling.NATIVE null handling"); } return new StructuredQuery.OrderBy( persistentEntity.getPersistentProperty(order.getProperty()).getFieldName(), (order.getDirection() == Sort.Direction.DESC) ? StructuredQuery.OrderBy.Direction.DESCENDING : StructuredQuery.OrderBy.Direction.ASCENDING); }
public static OrderBy asc(String property) { return new OrderBy(property, OrderBy.Direction.ASCENDING); }
static OrderBy fromPb(com.google.datastore.v1.PropertyOrder propertyOrderPb) { String property = propertyOrderPb.getProperty().getName(); Direction direction = Direction.fromPb(propertyOrderPb.getDirection()); return new OrderBy(property, direction); }
public static OrderBy desc(String property) { return new OrderBy(property, OrderBy.Direction.DESCENDING); }
public static OrderBy asc(String property) { return new OrderBy(property, OrderBy.Direction.ASCENDING); }
static OrderBy fromPb(com.google.datastore.v1.PropertyOrder propertyOrderPb) { String property = propertyOrderPb.getProperty().getName(); Direction direction = Direction.fromPb(propertyOrderPb.getDirection()); return new OrderBy(property, direction); }