--- Scott Eade <[EMAIL PROTECTED]> wrote:
> From: "Hristo Kosev" <[EMAIL PROTECTED]>
> > It sounds perfect. Really. But what's Andrea going
> to
> > see is that he has a new row inserted in DETAILS
> table
> > with REQUEST column set to NULL(that's in case he
> has
> > set the required to "false", in case he hasn't
> he'll
> > get a SQLException). I tried it with MySQL and
> that's
> > what happened. So... there's something wrong with
> > these Peer classes.
> >
> > Hristo Kosev
>
> Hristo,
>
> I disagree. The behaviour I described is exactly
> what occurs on
> my system using MySQL.
>
> Here is the behaviour I see:
>
> Log.debug("debug", "Before save()");
> Log.debug("debug", "request.getId(): " +
> request..getId()); // Outputs "null"
> Vector v = result.getDetailss(); // (note the
> double "s" die to the naming convention used)
> Iterator iter = v.iterator();
> while (iter.hasNext()) {
> Details item = (Details) iter.next();
> Log.debug("debug", "item.getId(): " +
> item.getId()); // Outputs "null"
> }
>
> ue.save(); // The magic line
>
> Log.debug("debug", "After save()");
> Log.debug("debug", "request.getId(): " +
> request..getId()); // Outputs some value - e.g. "12"
> v = result.getDetailss();
> iter = v.iterator();
> while (iter.hasNext()) {
> Details item = (Details) iter.next();
> Log.debug("debug", "item.getId(): " +
> item.getId()); // Outputs the same value as for
> request - e.g. "12"
> }
>
> I have altered the above to suit the example we are
> using here
> so it may include one or more typos, but this is the
> representative
> output from a similar parent child relationship in
> my application.
>
> Did you set up the foreign key correctly in your
> schema?
yes. my schema is set up correctly. the idMethod is
set to "autoIncrement"... btw do you use the IDBroker
instead of autoIncrement? because i really get NULL
values for these IDs. may be I'm using an old version
of turbine/torque but... It's 2.1 (the one that comes
with TDK 2.1)
> Did you regenerate your database and om layer before
> trying it?
>
> This definitely works. I have an application with
> around 30
> tables with many similar relationships and I have
> never had
> to worry about retrieving the parent id in this kind
> of situation.
>
> Does anyone else want to confirm this?
>
> Cheers,
>
> Scott
Hristo Kosev
__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]