本文整理汇总了Java中com.j256.ormlite.stmt.QueryBuilder.join方法的典型用法代码示例。如果您正苦于以下问题:Java QueryBuilder.join方法的具体用法?Java QueryBuilder.join怎么用?Java QueryBuilder.join使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.j256.ormlite.stmt.QueryBuilder
的用法示例。
在下文中一共展示了QueryBuilder.join方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: iterator
import com.j256.ormlite.stmt.QueryBuilder; //导入方法依赖的package包/类
private CloseableIterator<Observation> iterator() throws SQLException {
Dao<Observation, Long> dao = DaoStore.getInstance(context).getObservationDao();
QueryBuilder<Observation, Long> query = dao.queryBuilder();
Where<Observation, Long> where = query
.orderBy("timestamp", false)
.where()
.ge("last_modified", observationCollection.getLatestDate())
.and()
.eq("event_id", currentEventId);
for (Filter filter : filters) {
QueryBuilder<?, ?> filterQuery = filter.query();
if (filterQuery != null) {
query.join(filterQuery);
}
filter.and(where);
}
return dao.iterator(query.prepare());
}
示例2: joinIfNotNull
import com.j256.ormlite.stmt.QueryBuilder; //导入方法依赖的package包/类
protected static <E extends Entity> QueryBuilder<E, Long> joinIfNotNull(final QueryBuilder<E, Long> queryBuilder, final QueryBuilder<? extends Entity, Long> joinedQueryBuilder) throws SQLException {
return (queryBuilder != null) && (joinedQueryBuilder != null) ? queryBuilder.join(joinedQueryBuilder) : queryBuilder;
}