From d3d496b2dde8086cd8752fabbeee02c72f86a557 Mon Sep 17 00:00:00 2001 From: Denis Frolov Date: Mon, 14 Apr 2014 19:49:57 +0400 Subject: [PATCH] Fix MySQL support in ERXExistsQualifier The identifier quote character in MySLQ is the backtick (not double quote). Using double quote resulted in invalid expression. Also, by using expression.sqlStringForSchemaObjectName we respect com.webobjects.jdbcadaptor.MySQLExpression.enableIdentifierQuoting flag which is off by default in case of MySQL (resulting in no quoting at all). --- .../er/extensions/eof/qualifiers/ERXExistsQualifier.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Frameworks/Core/ERExtensions/Sources/er/extensions/eof/qualifiers/ERXExistsQualifier.java b/Frameworks/Core/ERExtensions/Sources/er/extensions/eof/qualifiers/ERXExistsQualifier.java index 0e402327737..49d1cff6e21 100644 --- a/Frameworks/Core/ERExtensions/Sources/er/extensions/eof/qualifiers/ERXExistsQualifier.java +++ b/Frameworks/Core/ERExtensions/Sources/er/extensions/eof/qualifiers/ERXExistsQualifier.java @@ -253,7 +253,7 @@ public String sqlStringForSQLExpression(EOQualifier qualifier, EOSQLExpression e } EOJoin parentChildJoin = ERXArrayUtilities.firstObject(relationship.joins()); - String destEntityForeignKey = ".\"" + parentChildJoin.destinationAttribute().columnName() + "\""; + String destEntityForeignKey = "." + expression.sqlStringForSchemaObjectName(parentChildJoin.destinationAttribute().columnName()); EOQualifier qual = EOQualifierSQLGeneration.Support._schemaBasedQualifierWithRootEntity(subqualifier, destEntity); EOFetchSpecification fetchSpecification = new EOFetchSpecification(destEntity.name(), qual, null, false, true, null);