use of org.dbflute.dbmeta.info.RelationInfo in project dbflute-core by dbflute.
the class AbstractConditionQuery method xdoBuildReferrerCorrelatedFixedCondition.
protected String xdoBuildReferrerCorrelatedFixedCondition(ConditionQuery subQuery, ReferrerInfo referrerInfo) {
final RelationInfo reverseRelation = referrerInfo.getReverseRelation();
if (reverseRelation == null) {
return null;
}
if (!(reverseRelation instanceof ForeignInfo)) {
String msg = "The reverse relation (referrer's reverse) should be foreign info: " + referrerInfo;
throw new IllegalStateException(msg);
}
final ForeignInfo foreignInfo = (ForeignInfo) reverseRelation;
final String fixedCondition = foreignInfo.getFixedCondition();
if (fixedCondition == null || fixedCondition.trim().length() == 0) {
return null;
}
final FixedConditionResolver resolver = createReferrerFixedConditionResolver(subQuery);
return resolver.resolveVariable(fixedCondition, false);
}
Aggregations