Skip to content

Commit

Permalink
prevent wrong SQL generation in ERXExistsQualifier
Browse files Browse the repository at this point in the history
  • Loading branch information
nur-sgaertner committed Aug 30, 2016
1 parent 78da1b7 commit c9ac955
Showing 1 changed file with 0 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -316,16 +316,6 @@ public String sqlStringForSQLExpression(EOQualifier qualifier, EOSQLExpression e
// (AR) Write the IN clause
sb.append(srcEntityForeignKey);
sb.append(" IN ( ");

// (AR) Rewrite first SELECT part of subExprStr
EOAttribute destPK = destEntity.primaryKeyAttributes().lastObject();
String destEntityPrimaryKey = expression.sqlStringForAttribute(destPK);
int indexOfFirstPeriod = destEntityPrimaryKey.indexOf(".");
destEntityPrimaryKey = destEntityPrimaryKey.substring(indexOfFirstPeriod);
subExprStr = StringUtils.replaceOnce(
subExprStr,
"SELECT " + EXISTS_ALIAS + "0" + destEntityPrimaryKey + " FROM",
"SELECT " + EXISTS_ALIAS + "0" + destEntityForeignKey + " FROM");
} else {
sb.append(" EXISTS ( ");
}
Expand Down

0 comments on commit c9ac955

Please sign in to comment.