本文整理了Java中io.ebean.Query.setOrder
方法的一些代码示例,展示了Query.setOrder
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Query.setOrder
方法的具体详情如下:
包路径:io.ebean.Query
类名称:Query
方法名:setOrder
[英]Set an OrderBy object to replace any existing OrderBy clause.
This is EXACTLY the same as #setOrderBy(OrderBy).
[中]设置OrderBy对象以替换任何现有的OrderBy子句。
这与#setOrderBy(OrderBy)完全相同。
代码示例来源:origin: org.actframework/act-ebean2
@Override
public EbeanQuery<MODEL_TYPE> setOrder(OrderBy<MODEL_TYPE> orderBy) {
q.setOrder(orderBy);
return this;
}
代码示例来源:origin: org.actframework/act-ebean
@Override
public EbeanQuery<MODEL_TYPE> setOrder(OrderBy<MODEL_TYPE> orderBy) {
q.setOrder(orderBy);
qReadOnly.setOrder(orderBy);
return this;
}
代码示例来源:origin: icode/ameba
/**
* {@inheritDoc}
* <p>
* Replaces any existing <code>order by</code> clause using an <code>OrderBy</code> object.
* </p>
* This is exactly the same as {@link #setOrderBy(io.ebean.OrderBy)}.
*/
public Query<T> setOrder(OrderBy<T> orderBy) {
return query().setOrder(orderBy);
}
代码示例来源:origin: hexagonframework/spring-data-ebean
private <S extends T> Query<S> queryByExample(String fetchPath, Example<S> example, Sort sort) {
Query<S> query = queryByExample(fetchPath, example);
if (sort != null) {
query.setOrder(Converters.convertToEbeanOrderBy(sort));
}
return query;
}
代码示例来源:origin: io.github.hexagonframework.data/spring-data-ebean
private <S extends T> Query<S> queryByExample(String fetchPath, Example<S> example, Sort sort) {
Query<S> query = queryByExample(fetchPath, example);
if (sort != null) {
query.setOrder(Converters.convertToEbeanOrderBy(sort));
}
return query;
}
代码示例来源:origin: io.github.hexagonframework.data/spring-data-ebean
@Override
public List<T> findAll(Sort sort) {
return query()
.setOrder(Converters.convertToEbeanOrderBy(sort))
.findList();
}
代码示例来源:origin: io.github.hexagonframework.data/spring-data-ebean
private Query<T> query(String fetchPath, Sort sort) {
if (sort == null) {
return query(fetchPath);
} else {
return query(fetchPath).setOrder(Converters.convertToEbeanOrderBy(sort));
}
}
代码示例来源:origin: hexagonframework/spring-data-ebean
private Query<T> query(String fetchPath, Sort sort) {
if (sort == null) {
return query(fetchPath);
} else {
return query(fetchPath).setOrder(Converters.convertToEbeanOrderBy(sort));
}
}
代码示例来源:origin: hexagonframework/spring-data-ebean
@Override
public List<T> findAll(Sort sort) {
return query()
.setOrder(Converters.convertToEbeanOrderBy(sort))
.findList();
}
代码示例来源:origin: hexagonframework/spring-data-ebean
/**
* Return query specifying page.
*
* @param expressionList the ExpressionList to add contains expression
* @param pageable 0-based index page.
* @param <T> the type of entity.
* @return the query specifying page.
*/
public static <T> Query<T> queryWithPage(ExpressionList<T> expressionList, Pageable pageable) {
Assert.notNull(expressionList, "expressionList must not null");
Assert.notNull(pageable, "pageable must not null");
return expressionList.setMaxRows(pageable.getPageSize())
.setFirstRow((int) pageable.getOffset())
.setOrder(Converters.convertToEbeanOrderBy(pageable.getSort()));
}
代码示例来源:origin: io.github.hexagonframework.data/spring-data-ebean
/**
* Return query specifying page.
*
* @param expressionList the ExpressionList to add contains expression
* @param pageable 0-based index page.
* @param <T> the type of entity.
* @return the query specifying page.
*/
public static <T> Query<T> queryWithPage(ExpressionList<T> expressionList, Pageable pageable) {
Assert.notNull(expressionList, "expressionList must not null");
Assert.notNull(pageable, "pageable must not null");
return expressionList.setMaxRows(pageable.getPageSize())
.setFirstRow((int) pageable.getOffset())
.setOrder(Converters.convertToEbeanOrderBy(pageable.getSort()));
}
代码示例来源:origin: io.github.hexagonframework.data/spring-data-ebean
private static <T> Query<T> query(EbeanServer ebeanServer, Class<T> entityType,
String fetchPath, Object queryObject, Pageable pageable) {
Assert.notNull(ebeanServer, "ebeanServer must not null");
Assert.notNull(entityType, "entityType must not null");
Query<T> query = ebeanServer.find(entityType);
if (StringUtils.hasText(fetchPath)) {
query.apply(PathProperties.parse(fetchPath));
} else {
// queryObject IncludePath
if (queryObject != null) {
if (queryObject.getClass().isAnnotationPresent(IncludeFields.class)) {
IncludeFields includeFields = queryObject.getClass().getAnnotation(IncludeFields.class);
String ifs = includeFields.value();
if (StringUtils.hasText(ifs)) {
query.apply(PathProperties.parse(ifs));
}
}
}
}
ExpressionList<T> expressionList = query.where();
applyWhere(expressionList, queryObject);
if (pageable != null) {
expressionList.setMaxRows(pageable.getPageSize())
.setFirstRow((int) pageable.getOffset())
.setOrder(Converters.convertToEbeanOrderBy(pageable.getSort()));
}
return expressionList.query();
}
代码示例来源:origin: io.github.hexagonframework.data/spring-data-ebean
@Override
public <S extends T> Page<S> findAll(String fetchPath, Example<S> example, Pageable pageable) {
PagedList<S> pagedList = queryByExample(fetchPath, example)
.setMaxRows(pageable.getPageSize())
.setFirstRow((int) pageable.getOffset())
.setOrder(Converters.convertToEbeanOrderBy(pageable.getSort()))
.findPagedList();
return Converters.convertToSpringDataPage(pagedList, pageable.getSort());
}
代码示例来源:origin: io.github.hexagonframework.data/spring-data-ebean
@Override
public <S extends T> Page<S> findAll(Example<S> example, Pageable pageable) {
PagedList<S> pagedList = queryByExample(example)
.setMaxRows(pageable.getPageSize())
.setFirstRow((int) pageable.getOffset())
.setOrder(Converters.convertToEbeanOrderBy(pageable.getSort()))
.findPagedList();
return Converters.convertToSpringDataPage(pagedList, pageable.getSort());
}
代码示例来源:origin: io.github.hexagonframework.data/spring-data-ebean
@Override
public Page<T> findAll(String fetchPath, Pageable pageable) {
PagedList<T> pagedList = query(fetchPath)
.setMaxRows(pageable.getPageSize())
.setFirstRow((int) pageable.getOffset())
.setOrder(Converters.convertToEbeanOrderBy(pageable.getSort()))
.findPagedList();
return Converters.convertToSpringDataPage(pagedList, pageable.getSort());
}
代码示例来源:origin: hexagonframework/spring-data-ebean
@Override
public <S extends T> Page<S> findAll(String fetchPath, Example<S> example, Pageable pageable) {
PagedList<S> pagedList = queryByExample(fetchPath, example)
.setMaxRows(pageable.getPageSize())
.setFirstRow((int) pageable.getOffset())
.setOrder(Converters.convertToEbeanOrderBy(pageable.getSort()))
.findPagedList();
return Converters.convertToSpringDataPage(pagedList, pageable.getSort());
}
代码示例来源:origin: hexagonframework/spring-data-ebean
@Override
public Page<T> findAll(String fetchPath, Pageable pageable) {
PagedList<T> pagedList = query(fetchPath)
.setMaxRows(pageable.getPageSize())
.setFirstRow((int) pageable.getOffset())
.setOrder(Converters.convertToEbeanOrderBy(pageable.getSort()))
.findPagedList();
return Converters.convertToSpringDataPage(pagedList, pageable.getSort());
}
代码示例来源:origin: hexagonframework/spring-data-ebean
@Override
public <S extends T> Page<S> findAll(Example<S> example, Pageable pageable) {
PagedList<S> pagedList = queryByExample(example)
.setMaxRows(pageable.getPageSize())
.setFirstRow((int) pageable.getOffset())
.setOrder(Converters.convertToEbeanOrderBy(pageable.getSort()))
.findPagedList();
return Converters.convertToSpringDataPage(pagedList, pageable.getSort());
}
代码示例来源:origin: io.github.hexagonframework.data/spring-data-ebean
@Override
public Page<T> findAll(Pageable pageable) {
PagedList<T> pagedList = db().find(getEntityType())
.setMaxRows(pageable.getPageSize())
.setFirstRow((int) pageable.getOffset())
.setOrder(Converters.convertToEbeanOrderBy(pageable.getSort()))
.findPagedList();
return Converters.convertToSpringDataPage(pagedList, pageable.getSort());
}
代码示例来源:origin: hexagonframework/spring-data-ebean
@Override
public Page<T> findAll(Pageable pageable) {
PagedList<T> pagedList = db().find(getEntityType())
.setMaxRows(pageable.getPageSize())
.setFirstRow((int) pageable.getOffset())
.setOrder(Converters.convertToEbeanOrderBy(pageable.getSort()))
.findPagedList();
return Converters.convertToSpringDataPage(pagedList, pageable.getSort());
}
内容来源于网络,如有侵权,请联系作者删除!