@Override public boolean fetchExists( Table<?> table) throws DataAccessException { return delegate.fetchExists(table); }
@Override public boolean fetchExists( Select<?> query) throws DataAccessException { return delegate.fetchExists(query); }
@Override public boolean fetchExists( Table<?> table, Condition condition) throws DataAccessException { return delegate.fetchExists(table, condition); }
private boolean is8() { if (is8 == null) { // [#6602] The mysql.proc table got removed in MySQL 8.0 try { create(true).fetchExists(PROC); is8 = false; } catch (DataAccessException ignore) { is8 = true; } } return is8; }
boolean canUseRoutines() { if (canUseRoutines == null) { // [#7892] The information_schema.routines table is not available in all PostgreSQL // style databases, e.g. CockroachDB try { create(true).fetchExists(ROUTINES); canUseRoutines = true; } catch (DataAccessException e) { canUseRoutines = false; } } return canUseRoutines; }
public boolean exists(String alias) { try (DSLContext tx = DSL.using(cfg)) { return tx.fetchExists(tx.selectFrom(TEMPLATE_ALIASES) .where(TEMPLATE_ALIASES.TEMPLATE_ALIAS.eq(alias))); } }
public boolean exists(PartialProcessKey processKey) { UUID instanceId = processKey.getInstanceId(); try (DSLContext tx = DSL.using(cfg)) { return tx.fetchExists(tx.selectFrom(PROCESS_QUEUE) .where(PROCESS_QUEUE.INSTANCE_ID.eq(instanceId))); } }
public boolean isArchived(UUID checkpointId) { try (DSLContext tx = DSL.using(cfg)) { return tx.fetchExists(selectFrom(PROCESS_CHECKPOINT_ARCHIVE) .where(PROCESS_CHECKPOINT_ARCHIVE.CHECKPOINT_ID.eq(checkpointId) .and(PROCESS_CHECKPOINT_ARCHIVE.STATUS.eq(ArchivalStatus.DONE.toString())))); } }
public boolean hasUser(DSLContext tx, UUID teamId, UUID userId, TeamRole... roles) { SelectConditionStep<UserTeamsRecord> q = tx.selectFrom(USER_TEAMS) .where(USER_TEAMS.TEAM_ID.eq(teamId) .and(USER_TEAMS.USER_ID.eq(userId))); if (roles != null && roles.length != 0) { q.and(USER_TEAMS.TEAM_ROLE.in(Utils.toString(roles))); } return tx.fetchExists(q); }
public boolean isArchived(PartialProcessKey processKey) { try (DSLContext tx = DSL.using(cfg)) { return tx.fetchExists(selectFrom(PROCESS_STATE_ARCHIVE) .where(PROCESS_STATE_ARCHIVE.INSTANCE_ID.eq(processKey.getInstanceId()) .and(PROCESS_STATE_ARCHIVE.STATUS.eq(ArchivalStatus.DONE.toString())))); } }
public boolean isInOrganization(UUID userId, UUID orgId) { try (DSLContext tx = DSL.using(cfg)) { SelectConditionStep<Record1<UUID>> teamIds = select(TEAMS.TEAM_ID) .from(TEAMS) .where(TEAMS.ORG_ID.eq(orgId)); return tx.fetchExists(selectFrom(USER_TEAMS) .where(USER_TEAMS.USER_ID.eq(userId) .and(USER_TEAMS.TEAM_ID.in(teamIds)))); } }
/** * Checks if a value exists. */ public boolean exists(ProcessKey processKey, String path) { try (DSLContext tx = DSL.using(cfg)) { return tx.fetchExists(tx.selectFrom(PROCESS_STATE) .where(PROCESS_STATE.INSTANCE_ID.eq(processKey.getInstanceId()) .and(PROCESS_STATE.INSTANCE_CREATED_AT.eq(processKey.getCreatedAt())) .and(PROCESS_STATE.ITEM_PATH.startsWith(path)))); } }
public boolean hasRole(DSLContext tx, UUID orgId, TeamRole role) { SelectConditionStep<Record1<UUID>> teamIds = select(TEAMS.TEAM_ID).from(TEAMS).where(TEAMS.ORG_ID.eq(orgId)); return tx.fetchExists(select(USER_TEAMS.USER_ID) .from(USER_TEAMS) .where(USER_TEAMS.TEAM_ROLE.eq(role.toString()) .and(USER_TEAMS.TEAM_ID.in(teamIds)))); }
private boolean hasAccessLevel(DSLContext tx, UUID secretId, UUID userId, ResourceAccessLevel... levels) { SelectConditionStep<Record1<UUID>> teamIds = select(USER_TEAMS.TEAM_ID) .from(USER_TEAMS) .where(USER_TEAMS.USER_ID.eq(userId)); return tx.fetchExists(selectFrom(SECRET_TEAM_ACCESS) .where(SECRET_TEAM_ACCESS.SECRET_ID.eq(secretId) .and(SECRET_TEAM_ACCESS.TEAM_ID.in(teamIds)) .and(SECRET_TEAM_ACCESS.ACCESS_LEVEL.in(Utils.toString(levels))))); }
public boolean hasAccessLevel(DSLContext tx, UUID projectId, UUID userId, ResourceAccessLevel... levels) { SelectConditionStep<Record1<UUID>> teamIds = select(USER_TEAMS.TEAM_ID) .from(USER_TEAMS) .where(USER_TEAMS.USER_ID.eq(userId)); return tx.fetchExists(selectFrom(PROJECT_TEAM_ACCESS) .where(PROJECT_TEAM_ACCESS.PROJECT_ID.eq(projectId) .and(PROJECT_TEAM_ACCESS.TEAM_ID.in(teamIds)) .and(PROJECT_TEAM_ACCESS.ACCESS_LEVEL.in(Utils.toString(levels))))); }
public boolean isInAnyTeam(DSLContext tx, UUID orgId, UUID userId, TeamRole... roles) { SelectConditionStep<Record1<UUID>> teamIds = select(TEAMS.TEAM_ID).from(TEAMS).where(TEAMS.ORG_ID.eq(orgId)); return tx.fetchExists(selectFrom(USER_TEAMS) .where(USER_TEAMS.USER_ID.eq(userId) .and(USER_TEAMS.TEAM_ID.in(teamIds)) .and(USER_TEAMS.TEAM_ROLE.in(Utils.toString(roles))))); }
private boolean hasAccessLevel(DSLContext tx, UUID inventoryId, UUID userId, ResourceAccessLevel... levels) { SelectConditionStep<Record1<UUID>> teamIds = select(USER_TEAMS.TEAM_ID) .from(USER_TEAMS) .where(USER_TEAMS.USER_ID.eq(userId)); return tx.fetchExists(selectFrom(INVENTORY_TEAM_ACCESS) .where(INVENTORY_TEAM_ACCESS.INVENTORY_ID.eq(inventoryId) .and(INVENTORY_TEAM_ACCESS.TEAM_ID.in(teamIds)) .and(INVENTORY_TEAM_ACCESS.ACCESS_LEVEL.in(Utils.toString(levels))))); }
if (create.fetchExists(select)) { ignored++; continue rows;
.get(0, Boolean.class); if (!identity && !create().fetchExists(selectOne().from("{0}", DSL.name(getName())))) identity = create() .select(SQLiteMaster.SQL)