use of org.dbflute.cbean.sqlclause.join.LeftOuterJoinInfo in project dbflute-core by dbflute.
the class AbstractSqlClause method getLeftOuterJoinClause.
// ===================================================================================
// Join Clause
// ===========
// Clause Parts
protected String getLeftOuterJoinClause() {
final StringBuilder sb = new StringBuilder();
checkFixedConditionLazily();
reflectInnerJoinAutoDetectLazily();
final boolean countLeastJoinAllowed = checkCountLeastJoinAllowed();
final boolean structuralPossibleInnerJoinAllowed = checkStructuralPossibleInnerJoinAllowed();
for (Entry<String, LeftOuterJoinInfo> outerJoinEntry : getOuterJoinMap().entrySet()) {
final String foreignAliasName = outerJoinEntry.getKey();
final LeftOuterJoinInfo joinInfo = outerJoinEntry.getValue();
if (countLeastJoinAllowed && canBeCountLeastJoin(joinInfo)) {
// means only joined countable
continue;
}
buildLeftOuterJoinClause(sb, foreignAliasName, joinInfo, structuralPossibleInnerJoinAllowed);
}
return sb.toString();
}
use of org.dbflute.cbean.sqlclause.join.LeftOuterJoinInfo in project dbflute-core by dbflute.
the class AbstractSqlClause method isUnderOverRelation.
/**
* {@inheritDoc}
*/
public boolean isUnderOverRelation(String relationPath) {
final Map<String, String> relationPathForeignAliasMap = getRelationPathForeignAliasMap();
final String foreignAliasName = relationPathForeignAliasMap.get(relationPath);
if (foreignAliasName == null) {
// basically no way
String msg = "Not found the foreign alias name by the relation path:";
msg = msg + " " + relationPath + ", " + relationPathForeignAliasMap.keySet();
throw new IllegalStateException(msg);
}
final Map<String, LeftOuterJoinInfo> outerJoinMap = getOuterJoinMap();
final LeftOuterJoinInfo outerJoinInfo = outerJoinMap.get(foreignAliasName);
if (outerJoinInfo == null) {
// basically no way
String msg = "Not found the outer join info by the foreign alias name:";
msg = msg + " " + relationPath + ", " + foreignAliasName + ", " + outerJoinMap.keySet();
throw new IllegalStateException(msg);
}
return outerJoinInfo.isUnderOverRelation();
}
Aggregations