當前位置: 首頁>>代碼示例>>Java>>正文


Java TableField.in方法代碼示例

本文整理匯總了Java中org.jooq.TableField.in方法的典型用法代碼示例。如果您正苦於以下問題:Java TableField.in方法的具體用法?Java TableField.in怎麽用?Java TableField.in使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.jooq.TableField的用法示例。


在下文中一共展示了TableField.in方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: 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));
    }
}
 
開發者ID:cloudnautique,項目名稱:cloud-cattle,代碼行數:25,代碼來源:AbstractJooqResourceManager.java

示例2: 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);
}
 
開發者ID:ChiralBehaviors,項目名稱:Ultrastructure,代碼行數:27,代碼來源:JobModelImpl.java

示例3: 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() + "]");
    }
}
 
開發者ID:cloudnautique,項目名稱:cloud-cattle,代碼行數:39,代碼來源:JooqUtils.java

示例4: 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() + "]");
    }
}
 
開發者ID:rancher,項目名稱:cattle,代碼行數:46,代碼來源:JooqUtils.java


注:本文中的org.jooq.TableField.in方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。