use of org.dbflute.cbean.sqlclause.subquery.InScopeRelation in project dbflute-core by dbflute.
the class AbstractConditionQuery method registerInScopeRelation.
// *unsupported ExistsReferrer as in-line because it's (or was) so dangerous
// ===================================================================================
// InScopeRelation
// ===============
// {Modified at DBFlute-0.7.5}
protected void registerInScopeRelation(final ConditionQuery subQuery, String columnDbName, String relatedColumnDbName, String propertyName, String relationPropertyName, boolean notInScope) {
assertSubQueryNotNull("InScopeRelation", columnDbName, 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 boolean suppressLocalAliasName = isInScopeRelationSuppressLocalAliasName();
final InScopeRelation inScopeRelation = new InScopeRelation(subQueryPath, localRealNameProvider, subQuerySqlNameProvider, subQueryLevel, subQueryClause, subQueryIdentity, subQueryDBMeta, cipherManager, suppressLocalAliasName);
final String correlatedFixedCondition = xbuildForeignCorrelatedFixedCondition(subQuery, relationPropertyName);
final String inScopeOption = notInScope ? "not" : null;
final String clause = inScopeRelation.buildInScopeRelation(columnDbName, relatedColumnDbName, correlatedFixedCondition, inScopeOption);
registerWhereClause(clause);
}
Aggregations