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


Java SelectConditionStep类代码示例

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


SelectConditionStep类属于org.jooq包,在下文中一共展示了SelectConditionStep类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: insert

import org.jooq.SelectConditionStep; //导入依赖的package包/类
@Override
public int insert(InsertReservationParams params) {
    // Check overlapping
    //isOverlapping(startTimestamp, expiryTimestamp, chargeBoxId);

    SelectConditionStep<Record1<Integer>> connectorPkQuery =
            DSL.select(CONNECTOR.CONNECTOR_PK)
               .from(CONNECTOR)
               .where(CONNECTOR.CHARGE_BOX_ID.equal(params.getChargeBoxId()))
               .and(CONNECTOR.CONNECTOR_ID.equal(params.getConnectorId()));

    int reservationId = ctx.insertInto(RESERVATION)
                           .set(RESERVATION.CONNECTOR_PK, connectorPkQuery)
                           .set(RESERVATION.ID_TAG, params.getIdTag())
                           .set(RESERVATION.START_DATETIME, params.getStartTimestamp())
                           .set(RESERVATION.EXPIRY_DATETIME, params.getExpiryTimestamp())
                           .set(RESERVATION.STATUS, ReservationStatus.WAITING.name())
                           .returning(RESERVATION.RESERVATION_PK)
                           .fetchOne()
                           .getReservationPk();

    log.debug("A new reservation '{}' is inserted.", reservationId);
    return reservationId;
}
 
开发者ID:RWTH-i5-IDSG,项目名称:steve-plugsurfing,代码行数:25,代码来源:ReservationRepositoryImpl.java

示例3: main

import org.jooq.SelectConditionStep; //导入依赖的package包/类
public static void main(String[] args) {
    AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
    DSLContext dsl = ctx.getBean(DSLContext.class);


    long categoryId = 1L;

    SelectConditionStep<Record> qry = dsl
            .select(MEASURABLE.NAME, MEASURABLE.DESCRIPTION, MEASURABLE.ID, MEASURABLE.PARENT_ID, MEASURABLE.EXTERNAL_ID)
            .select(INVOLVEMENT_KIND.NAME)
            .select(PERSON.DISPLAY_NAME)
            .from(MEASURABLE)
            .leftJoin(INVOLVEMENT)
            .on(INVOLVEMENT.ENTITY_ID.eq(MEASURABLE.ID).and(INVOLVEMENT.ENTITY_KIND.eq(EntityKind.MEASURABLE.name())))
            .leftJoin(INVOLVEMENT_KIND)
            .on(INVOLVEMENT_KIND.ID.eq(INVOLVEMENT.KIND_ID))
            .leftJoin(PERSON)
            .on(PERSON.EMPLOYEE_ID.eq(INVOLVEMENT.EMPLOYEE_ID))
            .where(MEASURABLE.MEASURABLE_CATEGORY_ID.eq(categoryId));

    qry.fetch().forEach(System.out::println);

}
 
开发者ID:khartec,项目名称:waltz,代码行数:24,代码来源:MeasurableExporterHarness.java

示例4: updateTransaction

import org.jooq.SelectConditionStep; //导入依赖的package包/类
@Override
public void updateTransaction(UpdateTransactionParams p) {

    // -------------------------------------------------------------------------
    // Step 1: Update transaction table
    //
    // After update, a DB trigger sets the user.inTransaction field to 0
    // -------------------------------------------------------------------------

    ctx.update(TRANSACTION)
       .set(TRANSACTION.STOP_TIMESTAMP, p.getStopTimestamp())
       .set(TRANSACTION.STOP_VALUE, p.getStopMeterValue())
       .where(TRANSACTION.TRANSACTION_PK.equal(p.getTransactionId()))
       .and(TRANSACTION.STOP_TIMESTAMP.isNull())
       .and(TRANSACTION.STOP_VALUE.isNull())
       .execute();

    // -------------------------------------------------------------------------
    // Step 2: Set connector status back to "Available" again
    // -------------------------------------------------------------------------

    SelectConditionStep<Record1<Integer>> connectorPkQuery =
            DSL.select(TRANSACTION.CONNECTOR_PK)
               .from(TRANSACTION)
               .where(TRANSACTION.TRANSACTION_PK.equal(p.getTransactionId()));

    insertConnectorStatus(connectorPkQuery, p.getStopTimestamp(), p.getStatusUpdate());
}
 
开发者ID:RWTH-i5-IDSG,项目名称:steve-plugsurfing,代码行数:29,代码来源:OcppServerRepositoryImpl.java

示例5: insertConnectorStatus

import org.jooq.SelectConditionStep; //导入依赖的package包/类
/**
 * After a transaction start/stop event, a charging station _might_ send a connector status notification, but it is
 * not required. With this, we make sure that the status is updated accordingly. Since we use the timestamp of the
 * transaction data, we do not necessarily insert a "most recent" status.
 *
 * If the station sends a notification, we will have a more recent timestamp, and therefore the status of the
 * notification will be used as current. Or, if this transaction data was sent to us for a failed push from the past
 * and we have a "more recent" status, it will still be the current status.
 */
private void insertConnectorStatus(SelectConditionStep<Record1<Integer>> connectorPkQuery,
                                   DateTime timestamp,
                                   TransactionStatusUpdate statusUpdate) {
    ctx.insertInto(CONNECTOR_STATUS)
       .set(CONNECTOR_STATUS.CONNECTOR_PK, connectorPkQuery)
       .set(CONNECTOR_STATUS.STATUS_TIMESTAMP, timestamp)
       .set(CONNECTOR_STATUS.STATUS, statusUpdate.getStatus())
       .set(CONNECTOR_STATUS.ERROR_CODE, statusUpdate.getErrorCode())
       .execute();
}
 
开发者ID:RWTH-i5-IDSG,项目名称:steve-plugsurfing,代码行数:20,代码来源:OcppServerRepositoryImpl.java

示例6: findAuthSources

import org.jooq.SelectConditionStep; //导入依赖的package包/类
public List<AuthoritativeSource> findAuthSources(EntityReference parentRef) {
    Condition customSelectionCriteria;
    switch(parentRef.kind()) {
        case ORG_UNIT:
            Select<Record1<Long>> ouSelector = organisationalUnitIdSelectorFactory.apply(
                    mkOpts(parentRef, HierarchyQueryScope.PARENTS));
            customSelectionCriteria = AUTHORITATIVE_SOURCE.PARENT_ID.in(ouSelector);
            break;
        case DATA_TYPE:
            Select<Record1<Long>> dtSelector = dataTypeIdSelectorFactory.apply(
                    mkOpts(parentRef, HierarchyQueryScope.CHILDREN));
            SelectConditionStep<Record1<String>> codeSelector = DSL
                    .select(DATA_TYPE.CODE)
                    .from(DATA_TYPE)
                    .where(DATA_TYPE.ID.in(dtSelector));
            customSelectionCriteria = AUTHORITATIVE_SOURCE.DATA_TYPE.in(codeSelector);
            break;
        case MEASURABLE:
        case PERSON:
            customSelectionCriteria = mkConsumerSelectionCondition(parentRef, HierarchyQueryScope.CHILDREN);
            break;
        case APP_GROUP:
        case FLOW_DIAGRAM:
            customSelectionCriteria = mkConsumerSelectionCondition(parentRef, HierarchyQueryScope.EXACT);
            break;
        default:
            throw new UnsupportedOperationException("Cannot calculate auth sources for ref" + parentRef);
    }

    return authoritativeSourceDao.findAuthSources(customSelectionCriteria);

}
 
开发者ID:khartec,项目名称:waltz,代码行数:33,代码来源:AuthoritativeSourceService.java

示例7: countRoots

import org.jooq.SelectConditionStep; //导入依赖的package包/类
public double countRoots() {
    SelectConditionStep<Record1<String>> rootSelector = DSL
            .selectDistinct(PERSON_HIERARCHY.MANAGER_ID)
            .from(PERSON_HIERARCHY)
            .where(PERSON_HIERARCHY.LEVEL.eq(1));

    return dsl.fetchCount(rootSelector);
}
 
开发者ID:khartec,项目名称:waltz,代码行数:9,代码来源:PersonHierarchyService.java

示例8: mkForOrgUnit

import org.jooq.SelectConditionStep; //导入依赖的package包/类
private SelectConditionStep<Record1<Long>> mkForOrgUnit(EntityReference ref, HierarchyQueryScope scope) {

        ImmutableIdSelectionOptions ouSelectorOptions = ImmutableIdSelectionOptions.builder()
                .entityReference(ref)
                .scope(scope)
                .build();

        Select<Record1<Long>> ouSelector = orgUnitIdSelectorFactory.apply(ouSelectorOptions);

        return dsl
                .selectDistinct(SURVEY_INSTANCE.ID)
                .from(SURVEY_INSTANCE)
                .where(SURVEY_INSTANCE.ENTITY_KIND.eq(ref.kind().name())
                        .and(SURVEY_INSTANCE.ENTITY_ID.in(ouSelector)));
    }
 
开发者ID:khartec,项目名称:waltz,代码行数:16,代码来源:SurveyInstanceIdSelectorFactory.java

示例9: mkForPerson

import org.jooq.SelectConditionStep; //导入依赖的package包/类
private Select<Record1<Long>> mkForPerson(IdSelectionOptions options) {
    SelectConditionStep<Record1<String>> empIdSelector = DSL
            .selectDistinct(PERSON.EMPLOYEE_ID)
            .from(PERSON)
            .where(PERSON.ID.eq(options.entityReference().id()));

    return dsl.selectDistinct(CHANGE_INITIATIVE.ID)
            .from(CHANGE_INITIATIVE)
            .innerJoin(INVOLVEMENT)
            .on(INVOLVEMENT.ENTITY_ID.eq(CHANGE_INITIATIVE.ID))
            .where(INVOLVEMENT.ENTITY_KIND.eq(EntityKind.CHANGE_INITIATIVE.name()))
            .and(INVOLVEMENT.EMPLOYEE_ID.in(empIdSelector));
}
 
开发者ID:khartec,项目名称:waltz,代码行数:14,代码来源:ChangeInitiativeIdSelectorFactory.java

示例10: 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

示例11: createPictureQuery

import org.jooq.SelectConditionStep; //导入依赖的package包/类
private SelectConditionStep<Record8<String, String, String, String, String, Integer, Timestamp, Integer>> createPictureQuery() {
	SelectConditionStep<Record8<String, String, String, String, String, Integer, Timestamp, Integer>> pictureSelect = create
			.select(DSL.val("P").as("type"), LOCATION.OFFICIAL_NAME, LOCATION.CITY, USERS.DISPLAYNAME.as("user"),
					DSL.val("N").as("update_Type"), LOCATION.ID, PICTURES.CREATED_ON, PICTURES.ID.as("picture_Id"))
			.from(LOCATION).join(PICTURES, JoinType.JOIN).on(LOCATION.ID.equal(PICTURES.FK_LOCATION))
			.join(USERS, JoinType.JOIN).on(PICTURES.FK_USER.equal(USERS.ID))
			.where(LOCATION.FK_COMMUNITY.equal(fkCommunity).and(LOCATION.ARCHIVED.equal(0)));
	return pictureSelect;
}
 
开发者ID:oglimmer,项目名称:lunchy,代码行数:10,代码来源:UpdatesDao.java

示例12: createUserQuery

import org.jooq.SelectConditionStep; //导入依赖的package包/类
private SelectConditionStep<Record8<String, String, String, String, String, Integer, Timestamp, Integer>> createUserQuery() {
	SelectConditionStep<Record8<String, String, String, String, String, Integer, Timestamp, Integer>> usersSelect = create
			.select(DSL.val("U").as("type"), DSL.val("").as("official_Name"), DSL.val("").as("city"),
					USERS.DISPLAYNAME.as("user"), DSL.val("N").as("update_Type"), USERS.ID, USERS.CREATED_ON,
					DSL.val(0).as("picture_Id")).from(USERS).where(USERS.FK_COMMUNITY.equal(fkCommunity));
	return usersSelect;
}
 
开发者ID:oglimmer,项目名称:lunchy,代码行数:8,代码来源:UpdatesDao.java

示例13: createReviewQuery

import org.jooq.SelectConditionStep; //导入依赖的package包/类
private SelectConditionStep<Record8<String, String, String, String, String, Integer, Timestamp, Integer>> createReviewQuery() {
	SelectConditionStep<Record8<String, String, String, String, String, Integer, Timestamp, Integer>> reviewsSelect = create
			.select(DSL.val("R").as("type"),
					LOCATION.OFFICIAL_NAME,
					LOCATION.CITY,
					USERS.DISPLAYNAME.as("user"),
					DSL.decode().value(REVIEWS.CREATED_ON).when(REVIEWS.LAST_UPDATE, "N").otherwise("U")
							.as("update_Type"), LOCATION.ID, REVIEWS.LAST_UPDATE, DSL.val(0).as("picture_Id"))
			.from(LOCATION).join(REVIEWS, JoinType.JOIN).on(LOCATION.ID.equal(REVIEWS.FK_LOCATION))
			.join(USERS, JoinType.JOIN).on(REVIEWS.FK_USER.equal(USERS.ID))
			.where(LOCATION.FK_COMMUNITY.equal(fkCommunity).and(LOCATION.ARCHIVED.equal(0)));
	return reviewsSelect;
}
 
开发者ID:oglimmer,项目名称:lunchy,代码行数:14,代码来源:UpdatesDao.java

示例14: createLocationQuery

import org.jooq.SelectConditionStep; //导入依赖的package包/类
private SelectConditionStep<Record8<String, String, String, String, String, Integer, Timestamp, Integer>> createLocationQuery() {
	SelectConditionStep<Record8<String, String, String, String, String, Integer, Timestamp, Integer>> locationSelect = create
			.select(DSL.val("L").as("type"),
					LOCATION.OFFICIAL_NAME,
					LOCATION.CITY,
					DSL.val("").as("user"),
					DSL.decode().value(LOCATION.CREATED_ON).when(LOCATION.LAST_UPDATE, "N").otherwise("U")
							.as("update_Type"), LOCATION.ID, LOCATION.LAST_UPDATE, DSL.val(0).as("picture_Id"))
			.from(LOCATION).where(LOCATION.FK_COMMUNITY.equal(fkCommunity).and(LOCATION.ARCHIVED.equal(0)));
	return locationSelect;
}
 
开发者ID:oglimmer,项目名称:lunchy,代码行数:12,代码来源:UpdatesDao.java

示例15: canPrint

import org.jooq.SelectConditionStep; //导入依赖的package包/类
@Override
public boolean canPrint(final String teamCode, final Integer submissionId) {
    final SelectJoinStep<Record1<Boolean>> step =
            jooq.select(CONTESTS.CAN_USE_SERVER_PRINTER)
                .from(SUBMISSIONS)
                .join(CONTESTS_TASKS).using(CONTESTS_TASKS.TASK_ID)
                .join(CONTESTS).using(CONTESTS.CONTEST_ID);

    if (!SecurityUtils.isAdmin()) {
        step.join(TEAMS_CONTESTS).using(TEAMS_CONTESTS.CONTEST_ID);
    }

    final SelectConditionStep<Record1<Boolean>> where =
            step.where(SUBMISSIONS.SUBMISSION_ID.eq(submissionId));

    if (!SecurityUtils.isAdmin()) {
        where.and(CONTESTS.CONTEST_START.lt(DSL.currentTimestamp()))
             .and(CONTESTS.CONTEST_END.gt(DSL.currentTimestamp()))
             .and(TEAMS_CONTESTS.TEAM_ID.eq(getUserTeamId(teamCode)));
    }

    where.orderBy(CONTESTS.CAN_USE_SERVER_PRINTER.desc()).limit(1);

    final Record1<Boolean> result = where.fetchOne();

    if (result == null) {
        return false;
    }
    return result.getValue(CONTESTS.CAN_USE_SERVER_PRINTER);
}
 
开发者ID:kTT,项目名称:adjule,代码行数:31,代码来源:JooqPrinterDao.java


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