// ModelViewEntity.ModelMemberEntity linkMemberEntity = modelViewEntity.getMemberModelMemberEntity(viewLink.getEntityAlias());
// ModelViewEntity.ModelMemberEntity relLinkMemberEntity = modelViewEntity.getMemberModelMemberEntity(viewLink.getRelEntityAlias());
for (int j = 0; j < viewLink.getKeyMapsSize(); j++) {
ModelKeyMap keyMap = viewLink.getKeyMap(j);
ModelField linkField = linkEntity.getField(keyMap.getFieldName());
ModelField relLinkField = relLinkEntity.getField(keyMap.getRelFieldName());
if (whereString.length() > 0) {
whereString.append(" AND ");
}
whereString.append(viewLink.getEntityAlias());
whereString.append(".");
whereString.append(filterColName(linkField.getColName()));
// check to see whether the left or right members are optional, if so:
// oracle: use the (+) on the optional side
// mssql: use the * on the required side
// NOTE: not testing if original table is optional, ONLY if related table is optional; otherwise things get really ugly...
// if (isOracleStyle && linkMemberEntity.getOptional()) whereString.append(" (+) ");
if (isMssqlStyle && viewLink.isRelOptional()) whereString.append("*");
whereString.append("=");
// if (isMssqlStyle && linkMemberEntity.getOptional()) whereString.append("*");
if (isOracleStyle && viewLink.isRelOptional()) whereString.append(" (+) ");
whereString.append(viewLink.getRelEntityAlias());
whereString.append(".");
whereString.append(filterColName(relLinkField.getColName()));
}
}
} else {
throw new GenericModelException("The join-style " + joinStyle + " is not supported");
}