public static class ERXExtensions.KeyValueQualifierSQLGenerationSupport
extends com.webobjects.eoaccess.EOQualifierSQLGeneration.Support
Modifier and Type | Field and Description |
---|---|
static String |
HANDLES_KEY_PATH_WITH_DERIVED_ATTRIBUTE_PROPERTY_NAME |
Constructor and Description |
---|
KeyValueQualifierSQLGenerationSupport(com.webobjects.eoaccess.EOQualifierSQLGeneration.Support old) |
Modifier and Type | Method and Description |
---|---|
static EOAttribute |
destinationAttribute(com.webobjects.eoaccess.EOEntity rootEntity,
String keyPath)
Returns the last attribute referenced by key path.
|
static String |
formatValueForAttribute(com.webobjects.eoaccess.EOSQLExpression e,
Object value,
EOAttribute attribute) |
static boolean |
isKeyPathWithDerivedAttributeCase(com.webobjects.eoaccess.EOEntity entity,
com.webobjects.eocontrol.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.
|
com.webobjects.eocontrol.EOQualifier |
qualifierMigratedFromEntityRelationshipPath(com.webobjects.eocontrol.EOQualifier eoqualifier,
com.webobjects.eoaccess.EOEntity eoentity,
String s) |
com.webobjects.eocontrol.EOQualifier |
schemaBasedQualifierWithRootEntity(com.webobjects.eocontrol.EOQualifier eoqualifier,
com.webobjects.eoaccess.EOEntity eoentity) |
String |
sqlStringForAttributeValue(com.webobjects.eoaccess.EOSQLExpression e,
EOAttribute att,
Object value)
Uses the EOSQLExpression provided to get the SQL string for value and
corresponding attribute.
|
String |
sqlStringForSQLExpression(com.webobjects.eocontrol.EOQualifier eoqualifier,
com.webobjects.eoaccess.EOSQLExpression e) |
String |
sqlStringForSQLExpressionWithKeyPathWithDerivedAttribute(com.webobjects.eocontrol.EOQualifier eoqualifier,
com.webobjects.eoaccess.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, supportForClass
public static final String HANDLES_KEY_PATH_WITH_DERIVED_ATTRIBUTE_PROPERTY_NAME
public KeyValueQualifierSQLGenerationSupport(com.webobjects.eoaccess.EOQualifierSQLGeneration.Support old)
public String sqlStringForSQLExpression(com.webobjects.eocontrol.EOQualifier eoqualifier, com.webobjects.eoaccess.EOSQLExpression e)
sqlStringForSQLExpression
in class com.webobjects.eoaccess.EOQualifierSQLGeneration.Support
public String sqlStringForSQLExpressionWithKeyPathWithDerivedAttribute(com.webobjects.eocontrol.EOQualifier eoqualifier, com.webobjects.eoaccess.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(com.webobjects.eoaccess.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(com.webobjects.eoaccess.EOSQLExpression e, Object value, EOAttribute attribute)
public static boolean isKeyPathWithDerivedAttributeCase(com.webobjects.eoaccess.EOEntity entity, com.webobjects.eocontrol.EOQualifier eoqualifier)
entity
- The entity where the eoqualifier is rootedeoqualifier
- A qualifier to testpublic static EOAttribute destinationAttribute(com.webobjects.eoaccess.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 com.webobjects.eocontrol.EOQualifier schemaBasedQualifierWithRootEntity(com.webobjects.eocontrol.EOQualifier eoqualifier, com.webobjects.eoaccess.EOEntity eoentity)
schemaBasedQualifierWithRootEntity
in class com.webobjects.eoaccess.EOQualifierSQLGeneration.Support
public com.webobjects.eocontrol.EOQualifier qualifierMigratedFromEntityRelationshipPath(com.webobjects.eocontrol.EOQualifier eoqualifier, com.webobjects.eoaccess.EOEntity eoentity, String s)
qualifierMigratedFromEntityRelationshipPath
in class com.webobjects.eoaccess.EOQualifierSQLGeneration.Support
Copyright © 2002 – 2020 Project Wonder.