Re: Exception Updating Rows When Qualifier Has Relationship
Re: Exception Updating Rows When Qualifier Has Relationship
- Subject: Re: Exception Updating Rows When Qualifier Has Relationship
- From: Chuck Hill <email@hidden>
- Date: Thu, 12 May 2016 21:34:13 +0000
- Thread-topic: Exception Updating Rows When Qualifier Has Relationship
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=email@hidden> on behalf of Luiz Alfredo Carrara Bertusso <email@hidden>
Date: Thursday, May 12, 2016 at 1:52 PM
To: "email@hidden" <email@hidden>
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(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?
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden