use of org.dbflute.cbean.sqlclause.subquery.ScalarCondition.PartitionByProvider in project dbflute-core by dbflute.
the class AbstractConditionQuery method doRegisterScalarCondition.
protected <CB extends ConditionBean> void doRegisterScalarCondition(final String function, final ConditionQuery subQuery, String propertyName, String operand, final HpSLCCustomized<CB> after, ScalarConditionOption option) {
assertSubQueryNotNull("ScalarCondition", propertyName, subQuery);
final SubQueryPath subQueryPath = new SubQueryPath(xgetLocation(propertyName));
final GeneralColumnRealNameProvider localRealNameProvider = new GeneralColumnRealNameProvider();
final int subQueryLevel = subQuery.xgetSqlClause().getSubQueryLevel();
final SqlClause subQueryClause = subQuery.xgetSqlClause();
final String subQueryIdentity = propertyName + "[" + subQueryLevel + "]";
final ColumnSqlNameProvider subQuerySqlNameProvider = dbName -> subQuery.toColumnSqlName(dbName);
final DBMeta subQueryDBMeta = findDBMeta(subQuery.asTableDbName());
final GearedCipherManager cipherManager = xgetSqlClause().getGearedCipherManager();
final String mainSubQueryIdentity = propertyName + "[" + subQueryLevel + ":subquerymain]";
final PartitionByProvider partitionByProvider = () -> after.preparePartitionBySqlClause();
final ScalarCondition scalarCondition = new ScalarCondition(subQueryPath, localRealNameProvider, subQuerySqlNameProvider, subQueryLevel, subQueryClause, subQueryIdentity, subQueryDBMeta, cipherManager, mainSubQueryIdentity, operand, partitionByProvider);
xregisterParameterOption(option);
final QueryClause clause = new QueryClause() {
/* lazy registration to use partition-by */
public String toString() {
return scalarCondition.buildScalarCondition(function, option);
}
};
// no speak about inner-join because of no possible of null revival
final QueryUsedAliasInfo usedAliasInfo = new QueryUsedAliasInfo(xgetAliasName(), null);
registerWhereClause(clause, usedAliasInfo);
}
Aggregations