use of org.dbflute.cbean.cipher.ColumnFunctionCipher in project dbflute-core by dbflute.
the class AbstractConditionQuery method doRegIQ.
protected void doRegIQ(ConditionKey key, Object value, ConditionValue cvalue, String columnDbName, ConditionOption option) {
if (!prepareQueryChecked(key, value, cvalue, columnDbName).newClause()) {
return;
}
final DBMeta dbmeta = xgetDBMetaProvider().provideDBMetaChecked(asTableDbName());
final ColumnInfo columnInfo = dbmeta.findColumnInfo(columnDbName);
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(xcreateQueryModeProvider(), cvalue, value, location, option);
final ColumnSqlName columnSqlName = columnInfo.getColumnSqlName();
final ColumnFunctionCipher cipher = xgetSqlClause().findColumnFunctionCipher(columnInfo);
if (isBaseQuery()) {
xgetSqlClause().registerBaseTableInlineWhereClause(columnSqlName, key, cvalue, cipher, option);
} else {
final String aliasName = xgetAliasName();
xgetSqlClause().registerOuterJoinInlineWhereClause(aliasName, columnSqlName, key, cvalue, cipher, option, _onClause);
}
}
use of org.dbflute.cbean.cipher.ColumnFunctionCipher in project dbflute-core by dbflute.
the class ConditionKey method doResolveCompoundColumnCipher.
protected ColumnRealName doResolveCompoundColumnCipher(ConditionOption option, SpecifiedColumn specifiedColumn) {
final GearedCipherManager cipherManager = option.getGearedCipherManager();
final ColumnRealName specifiedName = specifiedColumn.toColumnRealName();
if (cipherManager != null && !specifiedColumn.isDerived()) {
final ColumnInfo columnInfo = specifiedColumn.getColumnInfo();
final ColumnFunctionCipher cipher = cipherManager.findColumnFunctionCipher(columnInfo);
if (cipher != null) {
return toColumnRealName(cipher.decrypt(specifiedName.toString()));
} else {
return specifiedName;
}
} else {
return specifiedName;
}
}
use of org.dbflute.cbean.cipher.ColumnFunctionCipher 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);
}
Aggregations