
EOQualifier q = EOQualifier.qualifierWithQualifierFormat("firstName = 'Max'", null);
ERXQualifierInSubquery qq = new ERXQualifierInSubquery(q, "User", "group");
EOFetchSpecification fs = new EOFetchSpecification("Group", qq, null);
Would generate: "SELECT t0.GROUP_ID, t0.NAME FROM USER t0 WHERE t0.GROUP_ID IN ( SELECT t0.GROUP_ID FROM GROUP t0 WHERE t0.NAME = ? ) "
This class can be used to work around the EOF bug where OR queries involving many-to-manies are incorrectly generated
It will also generate
... t0.FOREIGN_KEY_ID in (select t1.ID from X where [your qualifier here])
with the 3 arg constructor
| ERXQualifierInSubquery | ( | EOQualifier | qualifier | ) |
Public single argument constructor. Use this constructor for sub-qualification on the same table.
| qualifier | sub qualifier |
| ERXQualifierInSubquery | ( | EOQualifier | qualifier, | |
| String | entityName, | |||
| String | relationshipName | |||
| ) |
| qualifier | sub qualifier | |
| entityName | of the sub qualification | |
| relationshipName | relationship name |
| ERXQualifierInSubquery | ( | EOQualifier | qualifier, | |
| String | entityName, | |||
| String | attributeName, | |||
| String | destinationAttName | |||
| ) |
| qualifier | sub qualifier | |
| entityName | of the sub qualification | |
| attributeName | foreign key attribute name | |
| destinationAttName | destination key name |
| void addQualifierKeysToSet | ( | NSMutableSet | aSet | ) |
Only used with qualifier keys which are not supported in this qualifier at this time. Does nothing.
| aSet | of qualifier keys |
| Object clone | ( | ) |
Implementation of the Clonable interface. Clones the current qualifier.
| boolean evaluateWithObject | ( | Object | object | ) |
| EOQualifier qualifierMigratedFromEntityRelationshipPath | ( | EOEntity | anEntity, | |
| String | aPath | |||
| ) |
Implementation of the EOQualifierSQLGeneration interface. Just clones the qualifier.
| anEntity | an entity | |
| aPath | relationship path |
| EOQualifier qualifierWithBindings | ( | NSDictionary | someBindings, | |
| boolean | requiresAll | |||
| ) |
Creates another qualifier after replacing the values of the bindings. Since this qualifier does not support qualifier binding keys a clone of the qualifier is returned.
| someBindings | some bindings | |
| requiresAll | tells if the qualifier requires all bindings |
| EOQualifier schemaBasedQualifierWithRootEntity | ( | EOEntity | anEntity | ) |
Implementation of the EOQualifierSQLGeneration interface. Just clones the qualifier.
| anEntity | an entity. |
| String sqlStringForSQLExpression | ( | EOSQLExpression | e | ) |
Generates the sql string for the given sql expression. Bulk of the logic for generating the sub-query is in this method.
| e | a given sql expression |
| String toString | ( | ) |
Description of the qualifier
| void validateKeysWithRootClassDescription | ( | EOClassDescription | aClassDescription | ) |
This qualifier does not perform validation. This is a no-op method.
| aClassDescription | to validation the qualifier keys against. |
String attributeName [protected] |
holds the attribute name
String destinationAttName [protected] |
holds the attribute name
String entityName [protected] |
holds the entity name
EOQualifier qualifier [protected] |
holds the subqualifier
String relationshipName [protected] |
holds the relationship name
1.5.8