本文整理匯總了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;
}