当前位置: 首页>>代码示例>>Java>>正文


Java SelectConditionStep.and方法代码示例

本文整理汇总了Java中org.jooq.SelectConditionStep.and方法的典型用法代码示例。如果您正苦于以下问题:Java SelectConditionStep.and方法的具体用法?Java SelectConditionStep.and怎么用?Java SelectConditionStep.and使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.jooq.SelectConditionStep的用法示例。


在下文中一共展示了SelectConditionStep.and方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getCombItems

import org.jooq.SelectConditionStep; //导入方法依赖的package包/类
/**
 * Returns all {@link News} where a {@link CombItem} of the given {@link User} exists.
 * The News are sorted by the add_date descending.
 * @param userId the {@link User} to get the {@link CombItem}s.
 * @param onlyUnread if <code>true</code> only {@link CombItem} with no read_date
 * 			will be returned.
 * @return {@link List} containing {@link News}.
 */
public List<News> getCombItems(final long userId, final boolean onlyUnread) {
	final SelectConditionStep<Record> sql = DSL.using(jooqConfig).
			select().
			from(COMB_ITEM_TABLE.
				join(CONTENT_TABLE).
					on(COMB_ITEM_TABLE.CONTENT_ID.eq(CONTENT_TABLE.ID)).
				join(NEWS_TABLE).
					on(CONTENT_TABLE.ID.eq(NEWS_TABLE.CONTENT_ID))).
			where(COMB_ITEM_TABLE.USER_ID.eq(userId));

	if(onlyUnread) {
		sql.and(COMB_ITEM_TABLE.READ_DATE.isNull());
	}

	return sql.orderBy(COMB_ITEM_TABLE.ADD_DATE.desc()).
			fetchInto(News.class);
}
 
开发者ID:XMBomb,项目名称:InComb,代码行数:26,代码来源:CombItemDao.java

示例2: getTopBalance

import org.jooq.SelectConditionStep; //导入方法依赖的package包/类
public Collection<BalanceModel> getTopBalance(boolean user, boolean bank, int fromRank, int toRank, boolean showHidden)
{
    SelectJoinStep<Record4<String, String, String, Long>> from = db.getDSL()
            .select(TABLE_BALANCE.ACCOUNT_ID, TABLE_BALANCE.CURRENCY, TABLE_BALANCE.CONTEXT, TABLE_BALANCE.BALANCE)
            .from(TABLE_BALANCE.join(TABLE_ACCOUNT).on(TABLE_BALANCE.ACCOUNT_ID.eq(TABLE_ACCOUNT.ID)));
    Condition userCond = TABLE_ACCOUNT.IS_UUID.eq(true);
    Condition bankCond = TABLE_ACCOUNT.IS_UUID.eq(false);
    SelectConditionStep<Record4<String, String, String, Long>> where;
    if (!user && !bank)
    {
        throw new IllegalArgumentException();
    }
    if (user)
    {
        where = from.where(userCond);
    }
    else if (bank)
    {
        where = from.where(bankCond);
    }
    else
    {
        where = from.where(DSL.condition(true));
    }

    if (!showHidden)
    {
        where = where.and(TABLE_ACCOUNT.HIDDEN.eq(false));
    }
    return where.orderBy(TABLE_BALANCE.BALANCE.desc()).limit(fromRank - 1, toRank - fromRank + 1).fetchInto(BalanceModel.class);
}
 
开发者ID:CubeEngine,项目名称:modules-main,代码行数:32,代码来源:ConomyService.java

示例3: toString

import org.jooq.SelectConditionStep; //导入方法依赖的package包/类
@Override
public String toString() {
    // Generate "select *" if no dimension or metric is precised
    final SelectSelectStep<? extends Record> initialSelect = dimensions.size() == 1 && metrics.isEmpty() ? context.select()
                                                                                                         : context.select(dimensions)
                                                                                                                  .select(metrics);

    SelectConditionStep<? extends Record> statement = initialSelect.from(tableName)
                                                                   .where();


    if (filters != null) {
        statement = statement.and(Filters.of(filters));
    }
    if (condition != null) {
        statement = statement.and(condition);
    }

    statement.and(DSL.fieldByName("tenant_record_id").eq(tenantRecordId));

    if (shouldGroupBy) {
        return statement.groupBy(dimensions)
                        .getSQL();
    } else {
        return statement.getSQL();
    }
}
 
开发者ID:killbill,项目名称:killbill-analytics-plugin,代码行数:28,代码来源:SqlReportDataExtractor.java

示例4: getAttributeAuthorizations

import org.jooq.SelectConditionStep; //导入方法依赖的package包/类
@Override
public List<ExistentialAttributeAuthorizationRecord> getAttributeAuthorizations(FacetRecord aspect,
                                                                                boolean includeGrouping) {

    SelectConditionStep<Record> and = create.selectDistinct(EXISTENTIAL_ATTRIBUTE_AUTHORIZATION.fields())
                                            .from(EXISTENTIAL_ATTRIBUTE_AUTHORIZATION)
                                            .where(EXISTENTIAL_ATTRIBUTE_AUTHORIZATION.FACET.equal(aspect.getId()));
    if (!includeGrouping) {
        and = and.and(EXISTENTIAL_ATTRIBUTE_AUTHORIZATION.AUTHORITY.isNull());
    }
    return and.fetch()
              .into(ExistentialAttributeAuthorizationRecord.class)
              .stream()
              .collect(Collectors.toList());
}
 
开发者ID:ChiralBehaviors,项目名称:Ultrastructure,代码行数:16,代码来源:PhantasmModelImpl.java

示例5: getNetworkAuthorizations

import org.jooq.SelectConditionStep; //导入方法依赖的package包/类
@Override
public List<ExistentialNetworkAuthorizationRecord> getNetworkAuthorizations(FacetRecord aspect,
                                                                            boolean includeGrouping) {

    SelectConditionStep<ExistentialNetworkAuthorizationRecord> and = create.selectFrom(EXISTENTIAL_NETWORK_AUTHORIZATION)
                                                                           .where(EXISTENTIAL_NETWORK_AUTHORIZATION.PARENT.equal(aspect.getId()));

    if (!includeGrouping) {
        and = and.and(EXISTENTIAL_NETWORK_AUTHORIZATION.AUTHORITY.isNull());
    }
    return and.fetch()
              .into(ExistentialNetworkAuthorizationRecord.class);
}
 
开发者ID:ChiralBehaviors,项目名称:Ultrastructure,代码行数:14,代码来源:PhantasmModelImpl.java


注:本文中的org.jooq.SelectConditionStep.and方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。