methodExpr = methodExpr.or(pathExpr); else methodExpr = pathExpr;
@Override public final Condition or(String sql, Object... bindings) { return getWhere().or(sql, bindings); }
@Override public final Condition or(Condition other) { return getWhere().or(other); }
@Override public final Condition or(String sql, QueryPart... parts) { return getWhere().or(sql, parts); }
@Override public final Condition or(Field<Boolean> other) { return getWhere().or(other); }
protected Condition runAfterCondition(String resourceType) { if (resourceType == null) { return PROCESS_INSTANCE.RUN_AFTER.isNull() .or(PROCESS_INSTANCE.RUN_AFTER.le(new Date())); } return DSL.trueCondition(); }
@Override public Condition visit(OrQueryCriteria criteria, Boolean inArray) { Condition c1 = criteria.getSubQueryCriteria1().accept(this, inArray); Condition c2 = criteria.getSubQueryCriteria2().accept(this, inArray); return c1.or(c2); }
private final QueryPartInternal delegate(Configuration configuration) { if (symmetric && NO_SUPPORT_SYMMETRIC.contains(configuration.family())) return not ? (QueryPartInternal) field.notBetween(minValue, maxValue).and(field.notBetween(maxValue, minValue)) : (QueryPartInternal) field.between(minValue, maxValue).or(field.between(maxValue, minValue)); else return new Native(); }
private static final QueryPart parseOr(ParserContext ctx) { QueryPart condition = parseAnd(ctx); while (parseKeywordIf(ctx, "OR")) condition = toCondition(ctx, condition).or(toCondition(ctx, parseAnd(ctx))); return condition; }
private Condition getMultiAccountInstanceSearchCondition(final MetaHelperInfo helperInfo) { Condition condition = INSTANCE.ACCOUNT_ID.eq(helperInfo.getAccount().getId()); if (!helperInfo.getOtherAccountsServicesIds().isEmpty()) { condition = INSTANCE.ACCOUNT_ID.eq(helperInfo.getAccount().getId()).or( SERVICE_EXPOSE_MAP.SERVICE_ID.in(helperInfo.getOtherAccountsServicesIds())); } return condition; }
protected Condition elligibleHostCondition() { return AGENT.ID.isNull().or(AGENT.STATE.eq(CommonStatesConstants.ACTIVE)) .and(HOST.STATE.in(CommonStatesConstants.ACTIVE, CommonStatesConstants.UPDATING_ACTIVE)) .and(STORAGE_POOL.STATE.eq(CommonStatesConstants.ACTIVE)); }
@Override public List<? extends ServiceConsumeMap> findConsumedMapsToRemove(long serviceId) { return create() .selectFrom(SERVICE_CONSUME_MAP) .where( SERVICE_CONSUME_MAP.SERVICE_ID.eq(serviceId) .and((SERVICE_CONSUME_MAP.REMOVED.isNull(). or(SERVICE_CONSUME_MAP.STATE.eq(CommonStatesConstants.REMOVING))))). fetchInto(ServiceConsumeMapRecord.class); }
@Override public List<? extends ServiceConsumeMap> findConsumingMapsToRemove(long serviceId) { return create() .selectFrom(SERVICE_CONSUME_MAP) .where( SERVICE_CONSUME_MAP.CONSUMED_SERVICE_ID.eq(serviceId) .and((SERVICE_CONSUME_MAP.REMOVED.isNull(). or(SERVICE_CONSUME_MAP.STATE.eq(CommonStatesConstants.REMOVING))))). fetchInto(ServiceConsumeMapRecord.class); }
@Override public List<? extends StoragePoolHostMap> findMapsToRemove(Long storagePoolId) { return create() .selectFrom(STORAGE_POOL_HOST_MAP) .where(STORAGE_POOL_HOST_MAP.STORAGE_POOL_ID.eq(storagePoolId) .and((STORAGE_POOL_HOST_MAP.REMOVED.isNull() .or(STORAGE_POOL_HOST_MAP.STATE.eq(CommonStatesConstants.REMOVING))))) .fetchInto(StoragePoolHostMap.class); }
@Override public Volume findVolumeByExternalId(Long storagePoolId, String externalId) { Record record = create() .select(VOLUME.fields()) .from(VOLUME) .join(VOLUME_STORAGE_POOL_MAP) .on(VOLUME_STORAGE_POOL_MAP.STORAGE_POOL_ID.eq(storagePoolId)) .where(VOLUME.EXTERNAL_ID.eq(externalId) .or(VOLUME.EXTERNAL_ID.eq(VolumeUtils.externalId(externalId))) .and((VOLUME.REMOVED.isNull().or(VOLUME.STATE.eq(CommonStatesConstants.REMOVING))))) .fetchAny(); return record == null ? null : record.into(VolumeRecord.class); }
@Override public List<? extends StoragePool> findStoragePoolByDriverName(Long accountId, String driverName) { return create().selectFrom(STORAGE_POOL) .where(STORAGE_POOL.ACCOUNT_ID.eq(accountId)) .and((STORAGE_POOL.REMOVED.isNull().or(STORAGE_POOL.STATE.eq(CommonStatesConstants.REMOVING)))) .and(STORAGE_POOL.DRIVER_NAME.eq(driverName)) .fetchInto(StoragePoolRecord.class); }
private void deleteDirectory(DSLContext tx, UUID instanceId, Timestamp instanceCreatedAt, String path) { tx.deleteFrom(PROCESS_STATE) .where(PROCESS_STATE.INSTANCE_ID.eq(instanceId) .and(PROCESS_STATE.INSTANCE_CREATED_AT.eq(instanceCreatedAt))) .and(PROCESS_STATE.ITEM_PATH.eq(path) .or(PROCESS_STATE.ITEM_PATH.startsWith(fixPath(path)))) .execute(); }
public UUID findUserId(String key) { try (DSLContext tx = DSL.using(cfg)) { return tx.select(API_KEYS.USER_ID) .from(API_KEYS) .where(API_KEYS.API_KEY.eq(hash(key)) .and(API_KEYS.EXPIRED_AT.isNull() .or(API_KEYS.EXPIRED_AT.greaterThan(currentTimestamp())))) .fetchOne(API_KEYS.USER_ID); } }
@Override public List<? extends Image> findBadImages(int count) { return create().select(IMAGE.fields()) .from(IMAGE) .leftOuterJoin(INSTANCE) .on(IMAGE.ID.eq(INSTANCE.IMAGE_ID)) .where((INSTANCE.STATE.eq(CommonStatesConstants.PURGED).or(INSTANCE.ID.isNull())) .and(IMAGE.REMOVED.isNull()) .and(IMAGE.STATE.notIn(CommonStatesConstants.DEACTIVATING, CommonStatesConstants.REMOVING))) .limit(count) .fetchInto(ImageRecord.class); }
@Override public List<? extends StoragePoolHostMap> findBadPoolMapss(int limit) { return create().select(STORAGE_POOL_HOST_MAP.fields()) .from(STORAGE_POOL_HOST_MAP) .join(STORAGE_POOL) .on(STORAGE_POOL.ID.eq(STORAGE_POOL_HOST_MAP.STORAGE_POOL_ID)) .join(HOST) .on(HOST.ID.eq(STORAGE_POOL_HOST_MAP.HOST_ID)) .where(STORAGE_POOL_HOST_MAP.REMOVED.isNull() .and(HOST.STATE.eq(CommonStatesConstants.PURGED).or(STORAGE_POOL.STATE.eq(CommonStatesConstants.PURGED)))) .limit(limit) .fetchInto(StoragePoolHostMapRecord.class); }