Re: Still get primary key error on attachment
Re: Still get primary key error on attachment
- Subject: Re: Still get primary key error on attachment
- From: Pascal Robert <email@hidden>
- Date: Sat, 17 Sep 2011 07:52:18 -0400
Le 2011-09-17 à 07:22, James Cicenia a écrit :
> Here is my version0 of the migrations... there is no specific ERFileAttachment table. But there is of course an ERAttachment and ERAttachmentData
>
>
> ....
> Is there supposed to be an ERFileAttachment table?!
If you linked your entity to ERFileAttachment, yes. If you store the attachments in the DB, I think the table would be ERDBAttachment. Just do a BlessingsAndToasts1 migration that extends from ERAttachmentMigration (like the example I gave) and it should be fine.
> Regards
> James
>
>
> On Sep 17, 2011, at 3:37 AM, Pascal Robert wrote:
>
>> Do you have a ERFileAttachment table in your MySQL database? If not, did you create a migration for ERAttachment, eg:
>>
>> public class YourModelName1 extends ERAttachmentMigration {
>>
>> public YourModelName1() {
>> super("TableWithLinkToAttachment", "ColumnForRelationshipToErAttachment", true);
>> }
>>
>> public NSArray<ERXModelVersion> modelDependencies() {
>> return null;
>> }
>>
>> @Override
>> public void downgrade(EOEditingContext editingContext, ERXMigrationDatabase database) throws Throwable {
>> // DO NOTHING
>> }
>> }
>>
>>
>>> Ok -
>>>
>>> Using the WonderMYSQL plugin allowed a complete migration to work!
>>>
>>> However, upon testing uploading an attachment I still get this error:
>>>
>>> Sep 16 20:25:35 BlessingsApp[6789] DEBUG NSLog Page: er.modern.look.pages.ERMODInspectPage - Configuration: EditAuthor - Using JDBCPlugIn 'com.webobjects.jdbcadaptor.JDBCPlugIn' for JDBCAdaptor@646971142
>>> Sep 16 20:25:35 BlessingsApp[6789] ERROR er.extensions.eof.ERXEOControlUtilities Page: er.modern.look.pages.ERMODInspectPage - Configuration: EditAuthor - Caught exception when generating primary key for entity: ERFileAttachment
>>> IllegalArgumentException: Attempt to insert null object into an com.webobjects.foundation.NSMutableDictionary.
>>> at com.webobjects.foundation.NSMutableDictionary.setObjectForKey(NSMutableDictionary.java:68)
>>> ... skipped 6 stack elements
>>> at er.extensions.eof.ERXEOControlUtilities.newPrimaryKeyDictionaryForEntityNamed(ERXEOControlUtilities.java:1050)
>>> at er.extensions.eof.ERXEOControlUtilities.newPrimaryKeyDictionaryForObject(ERXEOControlUtilities.java:1018)
>>>
>>> Thoughts?
>>> Thanks
>>> James
>>> _______________________________________________
>>> 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
>>
>
> _______________________________________________
> 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
_______________________________________________
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