public static class ERXExtensions.KeyValueQualifierSQLGenerationSupport extends EOQualifierSQLGeneration.Support
| Modifier and Type | Field and Description |
|---|---|
static String |
HANDLES_KEY_PATH_WITH_DERIVED_ATTRIBUTE_PROPERTY_NAME |
| Constructor and Description |
|---|
KeyValueQualifierSQLGenerationSupport(EOQualifierSQLGeneration.Support old) |
| Modifier and Type | Method and Description |
|---|---|
static EOAttribute |
destinationAttribute(EOEntity rootEntity,
String keyPath)
Returns the last attribute referenced by key path.
|
static String |
formatValueForAttribute(EOSQLExpression e,
Object value,
EOAttribute attribute) |
static boolean |
isKeyPathWithDerivedAttributeCase(EOEntity entity,
EOQualifier eoqualifier)
Normally EOF can handle key value qualifiers with a key corresponding to a
derived attribute, i.e.
|
static NSArray<String> |
parseDefinitionPropertyKeys(EOAttribute derivedAttribute)
Given the definition of a derived attribute belonging to the entity provided
this method parses the definition looking for key paths that represent properties.
|
EOQualifier |
qualifierMigratedFromEntityRelationshipPath(EOQualifier eoqualifier,
EOEntity eoentity,
String s) |
EOQualifier |
schemaBasedQualifierWithRootEntity(EOQualifier eoqualifier,
EOEntity eoentity) |
String |
sqlStringForAttributeValue(EOSQLExpression e,
EOAttribute att,
Object value)
Uses the EOSQLExpression provided to get the SQL string for value and
corresponding attribute.
|
String |
sqlStringForSQLExpression(EOQualifier eoqualifier,
EOSQLExpression e) |
String |
sqlStringForSQLExpressionWithKeyPathWithDerivedAttribute(EOQualifier eoqualifier,
EOSQLExpression e)
This method handles an edge case where the key of the qualifier is a key path and
the last key in the key path references a derived attribute.
|
_flattenRelationshipPath, _optimizeQualifierKeyPath, _qualifierMigratedFromEntityRelationshipPath, _qualifierMigratedToSubEntityFromParentEntity, _schemaBasedQualifierWithRootEntity, _sqlStringForSQLExpression, _translateKeyAcrossRelationshipPath, setSupportForClass, supportForClasspublic static final String HANDLES_KEY_PATH_WITH_DERIVED_ATTRIBUTE_PROPERTY_NAME
public KeyValueQualifierSQLGenerationSupport(EOQualifierSQLGeneration.Support old)
public String sqlStringForSQLExpression(EOQualifier eoqualifier, EOSQLExpression e)
sqlStringForSQLExpression in class EOQualifierSQLGeneration.Supportpublic String sqlStringForSQLExpressionWithKeyPathWithDerivedAttribute(EOQualifier eoqualifier, EOSQLExpression e)
(TRUNC(MONTHS_BETWEEN(orderDate,customer.birthDate)/12,0))
and the key value qualifier was something like "order.customerAge > 50" then this
method would generate SQL like this:
(TRUNC(MONTHS_BETWEEN(T1.ORDER_DATE,T2.BIRTH_DATE)/12,0)) > 50
Without this fix EOF ends up throwing an exception.eoqualifier - An EOKeyValueQualifier with a key that is a key path and the last
component in the key path is a derived attribute.e - The EOSQLExpression participating in the SQL generation.public String sqlStringForAttributeValue(EOSQLExpression e, EOAttribute att, Object value)
e - The EOSQLExpression to use to generate the SQLatt - The attribute corresponding to the value passed invalue - The value to convert to SQLpublic static String formatValueForAttribute(EOSQLExpression e, Object value, EOAttribute attribute)
public static boolean isKeyPathWithDerivedAttributeCase(EOEntity entity, EOQualifier eoqualifier)
entity - The entity where the eoqualifier is rootedeoqualifier - A qualifier to testpublic static EOAttribute destinationAttribute(EOEntity rootEntity, String keyPath)
rootEntity - The entity where the key path begins.keyPath - The key path leading to an attribute.public static NSArray<String> parseDefinitionPropertyKeys(EOAttribute derivedAttribute)
derivedAttribute - An EOAttribute with a definitionpublic EOQualifier schemaBasedQualifierWithRootEntity(EOQualifier eoqualifier, EOEntity eoentity)
schemaBasedQualifierWithRootEntity in class EOQualifierSQLGeneration.Supportpublic EOQualifier qualifierMigratedFromEntityRelationshipPath(EOQualifier eoqualifier, EOEntity eoentity, String s)
qualifierMigratedFromEntityRelationshipPath in class EOQualifierSQLGeneration.SupportCopyright © 2002 – 2025 Project Wonder.