本文整理了Java中org.jooq.TableField.equal()
方法的一些代码示例,展示了TableField.equal()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。TableField.equal()
方法的具体详情如下:
包路径:org.jooq.TableField
类名称:TableField
方法名:equal
暂无
代码示例来源:origin: spring-projects/spring-data-examples
public List<Category> getCategoriesWithAgeGroup(AgeGroup ageGroup) {
return this.dslContext.select().from(CATEGORY).where(CATEGORY.AGE_GROUP.equal(ageGroup.name()))
.fetchInto(Category.class);
}
}
代码示例来源:origin: rancher/cattle
@Override
public boolean isScheulderIpsEnabled(long accountId) {
return create()
.select(HOST_LABEL_MAP.ID)
.from(HOST_LABEL_MAP)
.join(LABEL).on(HOST_LABEL_MAP.LABEL_ID.eq(LABEL.ID))
.join(HOST).on(HOST_LABEL_MAP.HOST_ID.eq(HOST.ID))
.leftOuterJoin(AGENT)
.on(AGENT.ID.eq(HOST.AGENT_ID))
.leftOuterJoin(STORAGE_POOL_HOST_MAP)
.on(STORAGE_POOL_HOST_MAP.HOST_ID.eq(HOST.ID)
.and(STORAGE_POOL_HOST_MAP.REMOVED.isNull()))
.join(STORAGE_POOL)
.on(STORAGE_POOL.ID.eq(STORAGE_POOL_HOST_MAP.STORAGE_POOL_ID))
.where(elligibleHostCondition()
.and(HOST_LABEL_MAP.ACCOUNT_ID.equal(accountId))
.and(HOST_LABEL_MAP.REMOVED.isNull())
.and(LABEL.KEY.equalIgnoreCase("io.rancher.scheduler.ips"))).fetch().size() > 0;
}
代码示例来源:origin: shilad/wikibrain
@Override
public boolean isRedirect(Language lang, int id) throws DaoException {
DSLContext context = getJooq();
try {
Record record = context.select().from(Tables.REDIRECT)
.where(Tables.REDIRECT.SRC_PAGE_ID.equal(id))
.and(Tables.REDIRECT.LANG_ID.equal(lang.getId()))
.fetchOne();
return (record != null);
} finally {
freeJooq(context);
}
}
代码示例来源:origin: shilad/wikibrain
@Override
public Iterable<LocalLink> getLinks(Language language, int localId, boolean outlinks, boolean isParseable, LocalLink.LocationType locationType) throws DaoException{
DSLContext context = getJooq();
try {
TableField idField;
if (outlinks){
idField = Tables.LOCAL_LINK.SOURCE_ID;
} else {
idField = Tables.LOCAL_LINK.DEST_ID;
}
Cursor<Record> result = context.select()
.from(Tables.LOCAL_LINK)
.where(Tables.LOCAL_LINK.LANG_ID.equal(language.getId()))
.and(idField.equal(localId))
.and(Tables.LOCAL_LINK.IS_PARSEABLE.equal(isParseable))
.and(Tables.LOCAL_LINK.LOCATION_TYPE.equal((short) locationType.ordinal()))
.fetchLazy(getFetchSize());
return buildLocalLinks(result, outlinks, context);
} catch (RuntimeException e) {
freeJooq(context);
throw e;
}
}
代码示例来源:origin: shilad/wikibrain
@Override
public Integer resolveRedirect(Language lang, int id) throws DaoException {
DSLContext context = getJooq();
try {
Record record = context.select().from(Tables.REDIRECT)
.where(Tables.REDIRECT.SRC_PAGE_ID.equal(id))
.and(Tables.REDIRECT.LANG_ID.equal(lang.getId()))
.fetchOne();
if (record == null){
return null;
}
return record.getValue(Tables.REDIRECT.DEST_PAGE_ID);
} finally {
freeJooq(context);
}
}
代码示例来源:origin: org.jooq/jooq-meta
private Result<Record3<String, String, String>> fetchKeys(Condition condition) {
return
create().select(
concat(DB_CLASS.CLASS_NAME, val("__"), DB_INDEX.INDEX_NAME).as("constraint_name"),
DB_INDEX_KEY.KEY_ATTR_NAME,
DB_CLASS.CLASS_NAME)
.from(DB_INDEX)
.join(DB_CLASS).on(DB_INDEX.CLASS_NAME.equal(DB_CLASS.CLASS_NAME))
.join(DB_INDEX_KEY).on(
DB_INDEX_KEY.INDEX_NAME.equal(DB_INDEX.INDEX_NAME).and(
DB_INDEX_KEY.CLASS_NAME.equal(DB_INDEX.CLASS_NAME)))
.where(condition)
.orderBy(
DB_INDEX.INDEX_NAME.asc())
.fetch();
}
代码示例来源:origin: shilad/wikibrain
@Override
public Set<LocalId> getFromSource(LocalId src) throws DaoException {
DSLContext context = getJooq();
try {
Result<Record> result = context.select().from(Tables.ILL)
.where(Tables.ILL.SOURCE_LANG_ID.equal(src.getLanguage().getId()))
.and(Tables.ILL.SOURCE_ID.equal(src.getId()))
.fetch();
if (result == null){
return null;
}
Set<LocalId> ills = new HashSet<LocalId>();
for (Record record : result) {
ills.add(new LocalId(
Language.getById(record.getValue(Tables.ILL.DEST_LANG_ID)),
record.getValue(Tables.ILL.DEST_ID)));
}
return ills;
} finally {
freeJooq(context);
}
}
代码示例来源:origin: shilad/wikibrain
@Override
public Set<LocalId> getToDest(LocalId dest) throws DaoException {
DSLContext context = getJooq();
try {
Result<Record> result = context.select().from(Tables.ILL)
.where(Tables.ILL.DEST_LANG_ID.equal(dest.getLanguage().getId()))
.and(Tables.ILL.DEST_ID.equal(dest.getId()))
.fetch();
if (result == null){
return null;
}
Set<LocalId> ills = new HashSet<LocalId>();
for (Record record : result) {
ills.add(new LocalId(
Language.getById(record.getValue(Tables.ILL.SOURCE_LANG_ID)),
record.getValue(Tables.ILL.SOURCE_ID)));
}
return ills;
} finally {
freeJooq(context);
}
}
代码示例来源:origin: org.jooq/jooq-meta
private Result<Record4<String, String, String, String>> fetchKeys(String constraintType) {
return create()
.select(
KEY_COLUMN_USAGE.TABLE_SCHEMA,
KEY_COLUMN_USAGE.CONSTRAINT_NAME,
KEY_COLUMN_USAGE.TABLE_NAME,
KEY_COLUMN_USAGE.COLUMN_NAME)
.from(TABLE_CONSTRAINTS
.join(KEY_COLUMN_USAGE)
.on(TABLE_CONSTRAINTS.CONSTRAINT_SCHEMA.equal(KEY_COLUMN_USAGE.CONSTRAINT_SCHEMA))
.and(TABLE_CONSTRAINTS.CONSTRAINT_NAME.equal(KEY_COLUMN_USAGE.CONSTRAINT_NAME)))
.where(TABLE_CONSTRAINTS.CONSTRAINT_TYPE.equal(constraintType))
.and(TABLE_CONSTRAINTS.TABLE_SCHEMA.in(getInputSchemata()))
.orderBy(
KEY_COLUMN_USAGE.TABLE_SCHEMA.asc(),
KEY_COLUMN_USAGE.TABLE_NAME.asc(),
KEY_COLUMN_USAGE.CONSTRAINT_NAME.asc(),
KEY_COLUMN_USAGE.ORDINAL_POSITION.asc())
.fetch();
}
代码示例来源:origin: org.jooq/jooq-meta
private Result<Record4<String, String, String, String>> fetchKeys(String constraintType) {
return create()
.select(
KEY_COLUMN_USAGE.CONSTRAINT_NAME,
KEY_COLUMN_USAGE.TABLE_SCHEMA,
KEY_COLUMN_USAGE.TABLE_NAME,
KEY_COLUMN_USAGE.COLUMN_NAME)
.from(TABLE_CONSTRAINTS)
.join(KEY_COLUMN_USAGE)
.on(TABLE_CONSTRAINTS.CONSTRAINT_SCHEMA.equal(KEY_COLUMN_USAGE.CONSTRAINT_SCHEMA))
.and(TABLE_CONSTRAINTS.CONSTRAINT_NAME.equal(KEY_COLUMN_USAGE.CONSTRAINT_NAME))
.where(TABLE_CONSTRAINTS.CONSTRAINT_TYPE.equal(constraintType))
.and(TABLE_CONSTRAINTS.TABLE_SCHEMA.in(getInputSchemata()))
.orderBy(
KEY_COLUMN_USAGE.TABLE_SCHEMA.asc(),
KEY_COLUMN_USAGE.TABLE_NAME.asc(),
KEY_COLUMN_USAGE.CONSTRAINT_NAME.asc(),
KEY_COLUMN_USAGE.ORDINAL_POSITION.asc())
.fetch();
}
代码示例来源:origin: shilad/wikibrain
@Override
public Iterable<LocalLink> getLinks(Language language, int localId, boolean outlinks) throws DaoException{
// if (counter.incrementAndGet() % 1000 == 0) {
// double mean = 1.0 * timer.get() / counter.get();
// System.out.println("counter is " + counter.get() + ", mean millis is " + mean);
// }
DSLContext context = getJooq();
// long start = System.currentTimeMillis();
try {
TableField idField;
if (outlinks){
idField = Tables.LOCAL_LINK.SOURCE_ID;
} else {
idField = Tables.LOCAL_LINK.DEST_ID;
}
Cursor<Record> result = context.select()
.from(Tables.LOCAL_LINK)
.where(Tables.LOCAL_LINK.LANG_ID.equal(language.getId()))
.and(idField.equal(localId))
.fetchLazy(getFetchSize());
// long end = System.currentTimeMillis();
// timer.addAndGet(end - start);
return buildLocalLinks(result, outlinks, context);
} catch (RuntimeException e) {
freeJooq(context);
throw e;
}
}
代码示例来源:origin: org.jooq/jooq-meta
private Result<Record5<String, String, String, String, String>> fetchKeys(String constraintType) {
return create().select(
Sysschemas.SCHEMANAME,
Systables.TABLENAME,
Systables.TABLEID,
Sysconstraints.CONSTRAINTNAME,
Sysconglomerates.DESCRIPTOR)
.from(SYSCONGLOMERATES)
.join(SYSKEYS)
.on(Syskeys.CONGLOMERATEID.equal(Sysconglomerates.CONGLOMERATEID))
.join(SYSCONSTRAINTS)
.on(Sysconstraints.CONSTRAINTID.equal(Syskeys.CONSTRAINTID))
.join(SYSTABLES)
.on(Systables.TABLEID.equal(Sysconglomerates.TABLEID))
.join(SYSSCHEMAS)
.on(Sysschemas.SCHEMAID.equal(Systables.SCHEMAID))
// [#6797] The casts are necessary if a non-standard collation is used
.and(Sysschemas.SCHEMANAME.cast(VARCHAR(32672)).in(getInputSchemata()))
.where(Sysconstraints.TYPE.cast(VARCHAR(32672)).equal(constraintType))
.orderBy(
Sysschemas.SCHEMANAME,
Systables.TABLENAME,
Sysconstraints.CONSTRAINTNAME)
.fetch();
}
代码示例来源:origin: rancher/cattle
query.addJoin(PROJECT_MEMBER, PROJECT_MEMBER.PROJECT_ID.equal(ACCOUNT.ID));
query.addConditions(allMembers);
query.setDistinct(true);
代码示例来源:origin: org.jooq/jooq-meta
.from(FUNCTION_ALIASES)
.leftOuterJoin(TYPE_INFO)
.on(FunctionAliases.DATA_TYPE.equal(TypeInfo.DATA_TYPE))
.and(TypeInfo.POS.equal(0))
.where(FunctionAliases.ALIAS_SCHEMA.in(getInputSchemata()))
.and(FunctionAliases.RETURNS_RESULT.in((short) 1, (short) 2))
代码示例来源:origin: org.jooq/jooq-meta
@Override
protected List<TableDefinition> getTables0() throws SQLException {
List<TableDefinition> result = new ArrayList<TableDefinition>();
for (Record record : create().select(
Sysschemas.SCHEMANAME,
Systables.TABLENAME,
Systables.TABLEID)
.from(SYSTABLES)
.join(SYSSCHEMAS)
.on(Systables.SCHEMAID.equal(Sysschemas.SCHEMAID))
// [#6797] The cast is necessary if a non-standard collation is used
.where(Sysschemas.SCHEMANAME.cast(VARCHAR(32672)).in(getInputSchemata()))
.orderBy(
Sysschemas.SCHEMANAME,
Systables.TABLENAME)
.fetch()) {
SchemaDefinition schema = getSchema(record.get(Sysschemas.SCHEMANAME));
String name = record.get(Systables.TABLENAME);
String id = record.get(Systables.TABLEID);
DerbyTableDefinition table = new DerbyTableDefinition(schema, name, id);
result.add(table);
}
return result;
}
代码示例来源:origin: rancher/cattle
@Override
public boolean isSchedulerServiceEnabled(Long accountId) {
return create()
.select(SERVICE.ID)
.from(SERVICE)
.where(SERVICE.ACCOUNT_ID.equal(accountId)
.and(SERVICE.SYSTEM.isTrue())
.and(SERVICE.REMOVED.isNull())
.and(SERVICE.STATE.notIn(INACTIVE_STATES))
.and(SERVICE.DATA.like("%io.rancher.container.agent_service.scheduling%"))).fetch().size() > 0;
}
}
代码示例来源:origin: org.jooq/jooq-meta
@Override
protected List<SequenceDefinition> getSequences0() throws SQLException {
List<SequenceDefinition> result = new ArrayList<SequenceDefinition>();
for (Record record : create().select(
Sysschemas.SCHEMANAME,
Syssequences.SEQUENCENAME,
Syssequences.SEQUENCEDATATYPE)
.from(SYSSEQUENCES)
.join(SYSSCHEMAS)
.on(Sysschemas.SCHEMAID.equal(Syssequences.SCHEMAID))
// [#6797] The cast is necessary if a non-standard collation is used
.where(Sysschemas.SCHEMANAME.cast(VARCHAR(32672)).in(getInputSchemata()))
.orderBy(
Sysschemas.SCHEMANAME,
Syssequences.SEQUENCENAME)
.fetch()) {
SchemaDefinition schema = getSchema(record.get(Sysschemas.SCHEMANAME));
DataTypeDefinition type = new DefaultDataTypeDefinition(
this,
schema,
record.get(Syssequences.SEQUENCEDATATYPE)
);
result.add(new DefaultSequenceDefinition(
schema,
record.get(Syssequences.SEQUENCENAME, String.class),
type));
}
return result;
}
代码示例来源:origin: org.jooq/jooq-meta
.from(CROSS_REFERENCES)
.join(CONSTRAINTS)
.on(CrossReferences.PK_NAME.equal(Constraints.UNIQUE_INDEX_NAME))
.and(CrossReferences.PKTABLE_NAME.equal(Constraints.TABLE_NAME))
.and(CrossReferences.PKTABLE_SCHEMA.equal(Constraints.TABLE_SCHEMA))
.where(CrossReferences.FKTABLE_SCHEMA.in(getInputSchemata()))
代码示例来源:origin: shilad/wikibrain
@Override
public TIntIntMap getAllRedirectIdsToDestIds(Language lang) throws DaoException {
DSLContext context = getJooq();
try {
Cursor<Record> cursor = context.select().
from(Tables.REDIRECT).
where(Tables.REDIRECT.LANG_ID.equal(lang.getId())).
fetchLazy(getFetchSize());
TIntIntMap ids = new TIntIntHashMap(
gnu.trove.impl.Constants.DEFAULT_CAPACITY,
gnu.trove.impl.Constants.DEFAULT_LOAD_FACTOR,
-1, -1);
for (Record record : cursor){
ids.put(record.getValue(Tables.REDIRECT.SRC_PAGE_ID),
record.getValue(Tables.REDIRECT.DEST_PAGE_ID));
}
return ids;
} finally {
freeJooq(context);
}
}
代码示例来源:origin: org.jooq/jooq-meta
.from(REFERENTIAL_CONSTRAINTS)
.join(KEY_COLUMN_USAGE)
.on(KEY_COLUMN_USAGE.CONSTRAINT_SCHEMA.equal(REFERENTIAL_CONSTRAINTS.CONSTRAINT_SCHEMA))
.and(KEY_COLUMN_USAGE.CONSTRAINT_NAME.equal(REFERENTIAL_CONSTRAINTS.CONSTRAINT_NAME))
.where(KEY_COLUMN_USAGE.TABLE_SCHEMA.in(getInputSchemata()))
.orderBy(
内容来源于网络,如有侵权,请联系作者删除!