Search in sources :

Example 1 with QueryModeProvider

use of org.dbflute.cbean.cvalue.ConditionValue.QueryModeProvider in project dbflute-core by dbflute.

the class AbstractSqlClause method doRegisterWhereClause.

// -----------------------------------------------------
// Assist Helper
// -------------
protected // the list of query clause
void doRegisterWhereClause(// the list of query clause
List<QueryClause> clauseList, // basic resources
ColumnRealName columnRealName, // basic resources
ConditionKey key, // basic resources
ConditionValue value, // optional resources
ColumnFunctionCipher cipher, // optional resources
ConditionOption option, final boolean inline, final boolean onClause) {
    key.addWhereClause(new QueryModeProvider() {

        public boolean isOrScopeQuery() {
            return isOrScopeQueryEffective();
        }

        public boolean isInline() {
            return inline;
        }

        public boolean isOnClause() {
            return onClause;
        }
    }, clauseList, columnRealName, value, cipher, option);
    markOrScopeQueryAndPart(clauseList);
}
Also used : QueryModeProvider(org.dbflute.cbean.cvalue.ConditionValue.QueryModeProvider)

Example 2 with QueryModeProvider

use of org.dbflute.cbean.cvalue.ConditionValue.QueryModeProvider in project dbflute-core by dbflute.

the class AbstractConditionQuery method setupConditionValueAndRegisterWhereClause.

protected void setupConditionValueAndRegisterWhereClause(ConditionKey key, Object value, ConditionValue cvalue, String columnDbName, ConditionOption option) {
    final DBMeta dbmeta = xgetLocalDBMeta();
    final ColumnInfo columnInfo = dbmeta.findColumnInfo(columnDbName);
    final QueryModeProvider queryModeProvider = xcreateQueryModeProvider();
    final Object filtered = filterConditionValueIfNeeds(key, value, cvalue, columnDbName, option, columnInfo);
    final String propertyName = columnInfo.getPropertyName();
    final String uncapPropName = initUncap(propertyName);
    // if Java, it is necessary to use uncapPropName
    final String location = xgetLocation(uncapPropName);
    key.setupConditionValue(queryModeProvider, cvalue, filtered, location, option);
    final ColumnRealName columnRealName = toColumnRealName(columnDbName);
    final ColumnFunctionCipher cipher = xgetSqlClause().findColumnFunctionCipher(columnInfo);
    final String usedAliasName = xgetAliasName();
    xgetSqlClause().registerWhereClause(columnRealName, key, cvalue, cipher, option, usedAliasName);
}
Also used : DBMeta(org.dbflute.dbmeta.DBMeta) ColumnInfo(org.dbflute.dbmeta.info.ColumnInfo) ColumnFunctionCipher(org.dbflute.cbean.cipher.ColumnFunctionCipher) ColumnRealName(org.dbflute.dbmeta.name.ColumnRealName) QueryModeProvider(org.dbflute.cbean.cvalue.ConditionValue.QueryModeProvider)

Aggregations

QueryModeProvider (org.dbflute.cbean.cvalue.ConditionValue.QueryModeProvider)2 ColumnFunctionCipher (org.dbflute.cbean.cipher.ColumnFunctionCipher)1 DBMeta (org.dbflute.dbmeta.DBMeta)1 ColumnInfo (org.dbflute.dbmeta.info.ColumnInfo)1 ColumnRealName (org.dbflute.dbmeta.name.ColumnRealName)1