本文整理匯總了Java中org.jooq.TableField.eq方法的典型用法代碼示例。如果您正苦於以下問題:Java TableField.eq方法的具體用法?Java TableField.eq怎麽用?Java TableField.eq使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.jooq.TableField
的用法示例。
在下文中一共展示了TableField.eq方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: addMappingJoins
import org.jooq.TableField; //導入方法依賴的package包/類
protected void addMappingJoins(SelectQuery<?> query, Table<?> toTable, SchemaFactory schemaFactory, String fromType, Table<?> from, String asName, MapRelationship rel) {
Table<?> mappingTable = JooqUtils.getTableFromRecordClass(rel.getMappingType());
/* We don't required the mapping type to be visible external, that's why we use the schemaFactory
* from the objectManager, because it is the superset schemaFactory.
*/
String mappingType = getObjectManager().getSchemaFactory().getSchemaName(rel.getMappingType());
TableField<?, Object> fieldFrom = JooqUtils.getTableField(getMetaDataManager(), fromType, ObjectMetaDataManager.ID_FIELD);
TableField<?, Object> fieldTo = JooqUtils.getTableField(getMetaDataManager(), mappingType, rel.getPropertyName());
TableField<?, Object> fieldRemoved = JooqUtils.getTableField(getMetaDataManager(), mappingType, ObjectMetaDataManager.REMOVED_FIELD);
org.jooq.Condition cond = fieldFrom.eq(fieldTo.getTable().field(fieldTo.getName())).and(fieldRemoved == null ? DSL.trueCondition() : fieldRemoved.isNull());
query.addJoin(mappingTable, JoinType.LEFT_OUTER_JOIN, cond);
fieldFrom = JooqUtils.getTableField(getMetaDataManager(), mappingType, rel.getOtherRelationship().getPropertyName());
fieldTo = JooqUtils.getTableField(getMetaDataManager(), schemaFactory.getSchemaName(rel.getObjectType()), ObjectMetaDataManager.ID_FIELD);
cond = fieldFrom.eq(fieldTo.getTable().asTable(asName).field(fieldTo.getName()));
query.addJoin(toTable, JoinType.LEFT_OUTER_JOIN, cond);
}
示例2: getJoinCondition
import org.jooq.TableField; //導入方法依賴的package包/類
protected org.jooq.Condition getJoinCondition(SchemaFactory schemaFactory, String fromType, Table<?> from, String asName, Relationship rel) {
TableField<?, Object> fieldFrom = null;
TableField<?, Object> fieldTo = null;
switch(rel.getRelationshipType()) {
case REFERENCE:
fieldFrom = JooqUtils.getTableField(getMetaDataManager(), fromType, rel.getPropertyName());
fieldTo = JooqUtils.getTableField(getMetaDataManager(), schemaFactory.getSchemaName(rel.getObjectType()),
ObjectMetaDataManager.ID_FIELD);
break;
case CHILD:
fieldFrom = JooqUtils.getTableField(getMetaDataManager(), fromType, ObjectMetaDataManager.ID_FIELD);
fieldTo = JooqUtils.getTableField(getMetaDataManager(), schemaFactory.getSchemaName(rel.getObjectType()), rel.getPropertyName());
break;
default:
throw new IllegalArgumentException("Illegal Relationship type [" + rel.getRelationshipType() + "]");
}
if ( fieldFrom == null || fieldTo == null ) {
throw new IllegalStateException("Failed to construction join query for [" + fromType + "] [" + from + "] [" + rel + "]");
}
return fieldFrom.eq(fieldTo.getTable().as(asName).field(fieldTo.getName()));
}
示例3: addAccountAuthorization
import org.jooq.TableField; //導入方法依賴的package包/類
@Override
protected void addAccountAuthorization(String type, Map<Object, Object> criteria, Policy policy) {
super.addAccountAuthorization(type, criteria, policy);
if ( ! policy.isOption(Policy.AUTHORIZED_FOR_ALL_ACCOUNTS) ) {
TableField<?, Object> accountField = JooqUtils.getTableField(getMetaDataManager(), type, ObjectMetaDataManager.ACCOUNT_FIELD);
TableField<?, Object> publicField = JooqUtils.getTableField(getMetaDataManager(), type, ObjectMetaDataManager.PUBLIC_FIELD);
Object accountValue = criteria.get(ObjectMetaDataManager.ACCOUNT_FIELD);
if ( accountField == null || publicField == null || accountValue == null ) {
return;
}
criteria.remove(ObjectMetaDataManager.ACCOUNT_FIELD);
Condition accountCondition = null;
if ( accountValue instanceof io.github.ibuildthecloud.gdapi.condition.Condition ) {
accountCondition = accountField.in(((io.github.ibuildthecloud.gdapi.condition.Condition)accountValue).getValues());
} else {
accountCondition = accountField.eq(accountValue);
}
criteria.put(Condition.class, publicField.isTrue().or(accountCondition));
}
}
示例4: addMappingJoins
import org.jooq.TableField; //導入方法依賴的package包/類
protected void addMappingJoins(SelectQuery<?> query, Table<?> toTable, SchemaFactory schemaFactory, String fromType, Table<?> from, String asName, MapRelationship rel) {
Table<?> mappingTable = JooqUtils.getTableFromRecordClass(rel.getMappingType());
String mappingType = schemaFactory.getSchemaName(rel.getMappingType());
TableField<?, Object> fieldFrom = JooqUtils.getTableField(getMetaDataManager(), fromType, ObjectMetaDataManager.ID_FIELD);
TableField<?, Object> fieldTo = JooqUtils.getTableField(getMetaDataManager(), mappingType, rel.getPropertyName());
TableField<?, Object> fieldRemoved = JooqUtils.getTableField(getMetaDataManager(), mappingType, ObjectMetaDataManager.REMOVED_FIELD);
org.jooq.Condition cond = fieldFrom.eq(fieldTo.getTable().field(fieldTo.getName())).and(fieldRemoved == null ? DSL.trueCondition() : fieldRemoved.isNull());
query.addJoin(mappingTable, JoinType.LEFT_OUTER_JOIN, cond);
fieldFrom = JooqUtils.getTableField(getMetaDataManager(), mappingType, rel.getOtherRelationship().getPropertyName());
fieldTo = JooqUtils.getTableField(getMetaDataManager(), schemaFactory.getSchemaName(rel.getObjectType()), ObjectMetaDataManager.ID_FIELD);
cond = fieldFrom.eq(fieldTo.getTable().asTable(asName).field(fieldTo.getName()));
query.addJoin(toTable, JoinType.LEFT_OUTER_JOIN, cond);
}
示例5: addMask
import org.jooq.TableField; //導入方法依賴的package包/類
private void addMask(SelectQuery<Record> selectQuery, UUID classifier,
UUID classification, TableField<?, UUID> field,
ExistentialDomain domain) {
if (classifier.equals(WellKnownRelationship.ANY.id())) {
if (log.isTraceEnabled()) {
log.trace("Match ANY {}", field.getName());
}
return;
}
Condition condition;
if (classifier.equals(WellKnownRelationship.SAME.id())) {
condition = field.eq(classification);
if (log.isTraceEnabled()) {
log.trace("Match SAME {}", field.getName());
}
} else {
condition = field.in(inferenceSubQuery(classifier, classification));
if (log.isTraceEnabled()) {
log.trace("Match on inferrred {}", field.getName());
}
}
condition = condition.or(field.equal(getAnyId(domain)))
.or(field.equal(getSameId(domain)))
.or(field.equal(getNotApplicable(domain)));
selectQuery.addConditions(condition);
}
示例6: listToCondition
import org.jooq.TableField; //導入方法依賴的package包/類
protected static org.jooq.Condition listToCondition(TableField<?, Object> field, List<?> list) {
org.jooq.Condition condition = null;
for (Object value : list) {
if (value instanceof Condition) {
org.jooq.Condition newCondition = toCondition(field, (Condition) value);
condition = condition == null ? newCondition : condition.and(newCondition);
} else {
condition = condition == null ? field.eq(value) : condition.and(field.eq(value));
}
}
return condition;
}
示例7: listToCondition
import org.jooq.TableField; //導入方法依賴的package包/類
protected static org.jooq.Condition listToCondition(TableField<?, Object> field, List<?> list) {
org.jooq.Condition condition = null;
for ( Object value : list ) {
if ( value instanceof Condition ) {
org.jooq.Condition newCondition = toCondition(field, (Condition)value);
condition = condition == null ? newCondition : condition.and(newCondition);
} else {
condition = condition == null ? field.eq(value) : condition.and(field.eq(value));
}
}
return condition;
}
示例8: toCondition
import org.jooq.TableField; //導入方法依賴的package包/類
protected static org.jooq.Condition toCondition(TableField<?, Object> field, Condition value) {
Condition condition = value;
switch (condition.getConditionType()) {
case EQ:
return field.eq(condition.getValue());
case GT:
return field.gt(condition.getValue());
case GTE:
return field.ge(condition.getValue());
case IN:
List<Object> values = condition.getValues();
if ( values.size() == 1 ) {
return field.eq(values.get(0));
} else {
return field.in(condition.getValues());
}
case LIKE:
return field.like(condition.getValue().toString());
case LT:
return field.lt(condition.getValue());
case LTE:
return field.le(condition.getValue());
case NE:
return field.ne(condition.getValue());
case NOTLIKE:
return field.notLike(condition.getValue().toString());
case NOTNULL:
return field.isNotNull();
case NULL:
return field.isNull();
case PREFIX:
return field.like(condition.getValue() + "%");
case OR:
return toCondition(field, condition.getLeft()).or(toCondition(field, condition.getRight()));
default:
throw new IllegalArgumentException("Invalid condition type [" + condition.getConditionType() + "]");
}
}
示例9: toConditions
import org.jooq.TableField; //導入方法依賴的package包/類
public static org.jooq.Condition toConditions(ObjectMetaDataManager metaData, String type, Map<Object, Object> criteria) {
org.jooq.Condition existingCondition = null;
for ( Map.Entry<Object, Object> entry : criteria.entrySet() ) {
Object value = entry.getValue();
Object key = entry.getKey();
TableField<?, Object> field = null;
if ( key == org.jooq.Condition.class ) {
if ( ! ( value instanceof org.jooq.Condition ) ) {
throw new IllegalArgumentException("If key is Condition, value must be an instanceof Condition got key [" +
key + "] value [" + value + "]");
}
} else {
field = getTableField(metaData, type, key);
if ( field == null ) {
continue;
}
}
org.jooq.Condition newCondition = null;
if ( value instanceof org.jooq.Condition ) {
newCondition = (org.jooq.Condition)value;
} else if ( value instanceof Condition ) {
newCondition = toCondition(field, (Condition)value);
} else if ( value instanceof List ) {
newCondition = listToCondition(field, (List<?>)value);
} else {
newCondition = field.eq(value);
}
if ( existingCondition == null ) {
existingCondition = newCondition;
} else {
existingCondition = existingCondition.and(newCondition);
}
}
return existingCondition;
}
示例10: toConditions
import org.jooq.TableField; //導入方法依賴的package包/類
public static org.jooq.Condition toConditions(ObjectMetaDataManager metaData, String type, Map<Object, Object> criteria) {
org.jooq.Condition existingCondition = null;
for (Map.Entry<Object, Object> entry : criteria.entrySet()) {
Object value = entry.getValue();
Object key = entry.getKey();
TableField<?, Object> field = null;
if (key == org.jooq.Condition.class) {
if (!(value instanceof org.jooq.Condition)) {
throw new IllegalArgumentException("If key is Condition, value must be an instanceof Condition got key [" + key +
"] value [" + value + "]");
}
} else {
field = getTableField(metaData, type, key);
if (field == null) {
continue;
}
}
org.jooq.Condition newCondition = null;
if (value instanceof org.jooq.Condition) {
newCondition = (org.jooq.Condition) value;
} else if (value instanceof Condition) {
newCondition = toCondition(field, (Condition) value);
} else if (value instanceof List) {
newCondition = listToCondition(field, (List<?>) value);
} else if (value == null) {
newCondition = field.isNull();
} else {
newCondition = field.eq(value);
}
if (existingCondition == null) {
existingCondition = newCondition;
} else {
existingCondition = existingCondition.and(newCondition);
}
}
return existingCondition;
}
示例11: toCondition
import org.jooq.TableField; //導入方法依賴的package包/類
protected static org.jooq.Condition toCondition(TableField<?, Object> field, Condition value) {
Condition condition = value;
switch (condition.getConditionType()) {
case EQ:
return field.eq(condition.getValue());
case GT:
return field.gt(condition.getValue());
case GTE:
return field.ge(condition.getValue());
case IN:
List<Object> values = condition.getValues();
if (values.size() == 1) {
return field.eq(values.get(0));
} else {
return field.in(condition.getValues());
}
case NOTIN:
List<Object> vals = condition.getValues();
if (vals.size() == 1) {
return field.ne(vals.get(0));
} else {
return field.notIn(condition.getValues());
}
case LIKE:
return field.like(condition.getValue().toString());
case LT:
return field.lt(condition.getValue());
case LTE:
return field.le(condition.getValue());
case NE:
return field.ne(condition.getValue());
case NOTLIKE:
return field.notLike(condition.getValue().toString());
case NOTNULL:
return field.isNotNull();
case NULL:
return field.isNull();
case PREFIX:
return field.like(condition.getValue() + "%");
case OR:
return toCondition(field, condition.getLeft()).or(toCondition(field, condition.getRight()));
default:
throw new IllegalArgumentException("Invalid condition type [" + condition.getConditionType() + "]");
}
}
示例12: toConditions
import org.jooq.TableField; //導入方法依賴的package包/類
public static org.jooq.Condition toConditions(ObjectMetaDataManager metaData, String type, Map<Object, Object> criteria) {
org.jooq.Condition existingCondition = null;
for ( Map.Entry<Object, Object> entry : criteria.entrySet() ) {
Object value = entry.getValue();
Object key = entry.getKey();
TableField<?, Object> field = null;
if ( key == org.jooq.Condition.class ) {
if ( ! ( value instanceof org.jooq.Condition ) ) {
throw new IllegalArgumentException("If key is Condition, value must be an instanceof Condition got key [" +
key + "] value [" + value + "]");
}
} else {
field = getTableField(metaData, type, key);
if ( field == null ) {
continue;
}
}
org.jooq.Condition newCondition = null;
if ( value instanceof org.jooq.Condition ) {
newCondition = (org.jooq.Condition)value;
} else if ( value instanceof Condition ) {
newCondition = toCondition(field, (Condition)value);
} else if ( value instanceof List ) {
newCondition = listToCondition(field, (List<?>)value);
} else if ( value == null ) {
newCondition = field.isNull();
} else {
newCondition = field.eq(value);
}
if ( existingCondition == null ) {
existingCondition = newCondition;
} else {
existingCondition = existingCondition.and(newCondition);
}
}
return existingCondition;
}