Hi Luiz,

This is in the JavaDoc for this method:
     * Updates rows described by the qualifier. Note that the values and the 
qualifier need to be on an attribute
     * and not on a relationship level. I.e. you need to give 
relationshipForeignKey = pk of object instead of
     * relatedObject = object. The newValues dictionaries also holds foreign 
keys, not objects.


Chuck

From: <webobjects-dev-bounces+chill=gevityinc....@lists.apple.com> on behalf of 
Luiz Alfredo Carrara Bertusso <luizalfred...@gmail.com>
Date: Thursday, May 12, 2016 at 1:52 PM
To: "webobjects-dev@lists.apple.com" <webobjects-dev@lists.apple.com>
Subject: Exception Updating Rows When Qualifier Has Relationship

Hello, I`ve been trying to use the method updateRowsDescribedByQualifier of 
ERXEOAccessUtilities class but I`m facing a problem.
The method updateRowsDescribedByQualifier requires the following parameters: an 
EOEditingContext, a String that represents an entity name, a qualifier and a 
NSDictionary of target fields to be updated.
The problem I`m facing is that in my qualifier I`m using a relationship, the 
qualifier is Activity.OWNER.is<http://Activity.OWNER.is>(user);, in this case 
OWNER is the relationship between Activity and User.
As exception I`m getting the following stack trace:

java.lang.IllegalStateException: sqlStringForKeyValueQualifier: attempt to 
generate SQL for er.extensions.qualifiers.ERXKeyValueQualifier (owner = 
(User)'<User pk:"5">') failed because attribute identified by key 'owner' was 
not reachable from from entity 'Activity'
at 
com.webobjects.eoaccess.EOSQLExpression.sqlStringForKeyValueQualifier(EOSQLExpression.java:1632)
at 
com.webobjects.eoaccess.EOQualifierSQLGeneration$_KeyValueQualifierSupport.sqlStringForSQLExpression(EOQualifierSQLGeneration.java:463)
at 
er.extensions.ERXExtensions$KeyValueQualifierSQLGenerationSupport.sqlStringForSQLExpression(ERXExtensions.java:346)
at 
com.webobjects.eoaccess.EOQualifierSQLGeneration$Support._sqlStringForSQLExpression(EOQualifierSQLGeneration.java:165)
at 
com.webobjects.eoaccess.EOSQLExpression.prepareUpdateExpressionWithRow(EOSQLExpression.java:885)
at 
com.webobjects.eoaccess.EOSQLExpressionFactory.updateStatementForRow(EOSQLExpressionFactory.java:155)
at 
com.webobjects.jdbcadaptor.JDBCChannel.updateValuesInRowsDescribedByQualifier(JDBCChannel.java:175)
at 
er.extensions.eof.ERXEOAccessUtilities$2.doPerform(ERXEOAccessUtilities.java:1640)
at 
er.extensions.eof.ERXEOAccessUtilities$ChannelAction.perform(ERXEOAccessUtilities.java:1586)
at 
er.extensions.eof.ERXEOAccessUtilities.updateRowsDescribedByQualifier(ERXEOAccessUtilities.java:1643)

Could someone help me to understand a way to solve this?

Thanks.
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (Webobjects-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to