subclassing EOGenericRecord to add a histroy feature

Matt Kime <[email protected]>
Newsgroups gmane.comp.web.webobjects.devel
Message-ID <[email protected]>
hello,

I'm attempting to subclass EOGenericRecord as to create a generic
"save history" function.

My current problem is creating the object to which i will save the history.

The basic code extending EOGenericRecord...

private void createHistoryObjects(){
            EOEditingContext eo = this.editingContext();
            EOEnterpriseObject newSet =
EOUtilities.createAndInsertInstance(eo, "abHistorySet");
            ((abHistorySet)newSet).setDateCreated(new NSTimestamp());
            eo.saveChanges();
}

is resulting in the following error -

 java.lang.IllegalStateException: Unable to find entity for object
{values = {status = ; values = (); entityName = ; rowid = ;
dateCreated = 2006-01-26 03:28:17 Etc/GMT; entityID = ; }; this = ">";
}
             Reason:             Unable to find entity for object
{values = {status = <com.webobjects.foundation.NSKeyValueCoding$Null>;
values = (); entityName =
<com.webobjects.foundation.NSKeyValueCoding$Null>; rowid =
<com.webobjects.foundation.NSKeyValueCoding$Null>; dateCreated =
2006-01-26 03:28:17 Etc/GMT; entityID =
<com.webobjects.foundation.NSKeyValueCoding$Null>; }; this =
"<abHistorySet 4fe1f9 <EOTemporaryGlobalID: 0 0 -64 -88 0 40 0 0 -8 25
1 0 0 0 1 9 4 -63 24 -18 84 -109 127 34>>"; }

I'm really not sure what direction to go in. What rule am I breaking?

Many thanks,
Matt
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.