The mapping needed the obvious primary key....
On Thu, 2003-10-23 at 17:15, Andy Czerwonka wrote:
> In looking at the SQL, and update is done when I do the store.. hey I
> think the PK is NOT unique... yup - it's not unique... that's gotta be
> the problem...
>
> On Thu, 2003-10-23 at 16:07, Andy Czerwonka wrote:
> > I've got a simple 1..n association and I'm doing something like
> > this...(pardon the syntax... just trying to make a point)
> >
> > Parent parent = new Parent()
> > Child c1 = new Child(parent);
> > Child c2 = new Child(parent);
> > parent.getChildren.add(c1);
> > parent.getChildren.add(c2);
> > broker.store(parent);
> > broker.commit();
> >
> > database looks good... 1 record in the parent table and 2 in the child
> > table with fk point back to the parent record...looks like:
> >
> > parent
> > +--c1
> > +--c2
> >
> >
> > ****and then all hell breaks loose...****
> >
> > Parent found = broker.query(parent);
> >
> > so far, so good, looks like it came from the cache... all references
> > look good, still have:
> >
> > parent
> > +--c1
> > +--c2
> >
> > checked the database.. all good..
> >
> > parent.setAnotherAttribute("changed state of parent");
> > broker.store(parent);
> >
> > still all good.. checked the database...
> >
> > and NOW....
> >
> > broker.commit();
> >
> > look in the database, and I see:
> >
> > parent
> > +--c2
> > +--c2
> >
> > HHHEEELLLPPP!!!!!!!!
> > No Idea.
> >
> > -andy
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]