本文整理汇总了Java中com.activeandroid.query.From.orderBy方法的典型用法代码示例。如果您正苦于以下问题:Java From.orderBy方法的具体用法?Java From.orderBy怎么用?Java From.orderBy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.activeandroid.query.From
的用法示例。
在下文中一共展示了From.orderBy方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getSentencesByCollection
import com.activeandroid.query.From; //导入方法依赖的package包/类
public From getSentencesByCollection(String collectionId, String filter) {
From res = new Select()
.from(Sentence.class)
.where("collection_id=?", collectionId);
if (!StringUtils.isEmpty(filter)) {
SqlFilterUtils.addFilter(res, new String[]{"known", "target"}, filter);
}
res.orderBy("complexity");
return res;
}
示例2: getSentencesByCollectionAndStatus
import com.activeandroid.query.From; //导入方法依赖的package包/类
public From getSentencesByCollectionAndStatus(String collectionId, int sentenceStatus, String filter) {
From res = new Select()
.from(Sentence.class)
.where("(collection_id=? and status=?)", collectionId, sentenceStatus);
if (!StringUtils.isEmpty(filter)) {
SqlFilterUtils.addFilter(res, new String[]{"known", "target"}, filter);
}
res.orderBy("complexity");
return res;
}
示例3: getAnnotationsSelectBydFilter
import com.activeandroid.query.From; //导入方法依赖的package包/类
public From getAnnotationsSelectBydFilter(String text, String collectionId) {
From res = new Select()
.from(Annotation.class);
SqlFilterUtils.addFilter(res, new String[] {"annotation"}, text);
if (!StringUtils.isEmpty(collectionId)) {
res.and("collection_id=?", collectionId);
}
res.orderBy("updated desc");
return res;
}
示例4: build
import com.activeandroid.query.From; //导入方法依赖的package包/类
@Override
public SortCriteria build() {
return new SortCriteria(STATUS, true) {
@Override
public From upgrade(From from) {
return from.orderBy(formatOrderBy(Audit.COLUMN_STATUS) + ", " + formatOrderBy(Audit.COLUMN_DATE, ORDER_DESC));
}
};
}