cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Willerding <awillerd...@itsurcom.com>
Subject No object is registered in context with Id
Date Thu, 03 Mar 2016 03:15:42 GMT
I am stuck on exactly what this message means and how to correct the 
situation.

Here are my table relationships.

Project               ProjectContact         Contact
---------               --------------------         ----------
ProjectID <--->     ProjectID
                               ContactID    <--->  ContactID

Here is my code.

                 ObjectContext oc = UI.getObjectContext();
                 for (Contact item : list) {
                     ProjectContact newItem = 
oc.newObject(ProjectContact.class);
                     project.setObjectContext(oc);
                     project.getCompany().setObjectContext(oc);
                     newItem.setCompany(project.getCompany());
                     item.setObjectContext(oc);
exception->newItem.setContact(item);
                     newItem.setProject(project);
newItem.setPrimeContact(ProjectContact.Type.NON_PRIME.getCode());
                     addItemCount++;

Here's the exception that is thrown when the newItem.setContact(item) is 
executed.

2016-03-02,22:00:25:587,ERROR,[Thread-83],,'com.callistacti.vaadinLib.IWindowEditBase' 
ERROR:ObservableComponent Error processing observer's update code. 
Observer==>class 
com.itsurcom.bluecranex.GUI.Panels.PanelProjectContacts::org.apache.cayenne.CayenneRuntimeException:

[v.4.0.M3 Feb 08 2016 17:09:41] No object is registered in context with 
Id <ObjectId:Contact, ContactID=1170>


Mime
View raw message