Hi,
I've got a table reportingdates with a 1:N relation to reportings, where
every reporting has a 1:1 relationsship to tasks,
now I have the following code:
I have to set the tasks in each reortings object, but I only have the ID
as String:
Tasks newtask = (Tasks)theDataContext.registeredObject(new
ObjectId("Tasks", "id" ,tasksID.intValue()));
//where taskID is a ID of an existing task in the database
origreporting.setToTasks(newtask);
theDataContext.commitChanges(Level.WARN);
which gives me the follwoing exceptions:
org.objectstyle.cayenne.CayenneRuntimeException: Some parts of PK are
missing in snapshot.
at
org.objectstyle.cayenne.map.DbRelationship.srcFkSnapshotWithTargetSnapshot(DbRelationship.java:251)
at
org.objectstyle.cayenne.access.SnapshotManager.takeObjectSnapshot(SnapshotManager.java:235)
at
org.objectstyle.cayenne.access.DataContext.takeObjectSnapshot(DataContext.java:256)
at
org.objectstyle.cayenne.CayenneDataObject.getCurrentSnapshot(CayenneDataObject.java:342)
at org.objectstyle.cayenne.QueryHelper.updateQuery(QueryHelper.java:105)
at
org.objectstyle.cayenne.access.DataContext.commitChanges(DataContext.java:517)
My question, how do I get a "valid" task object, that I can add, if I
only have it's ID (primary key) as Integer?
thanks martin
This archive was generated by hypermail 2.0.0 : Thu Dec 05 2002 - 16:26:56 EST