Hi Robert,
that was my first bet too, but in the StatementManager it will
simply try to bind the TestRun-instance onto the parameter instead
of binding the anonymous key.
I rechecked my repository, but it seems to be ok.
Any ideas?
Thanks,
Andreas.
> Robert r. Sanders wrote:
>
> If your TestStep object has a field testRun then the query
> should only
> need to:
>
> TestRun myTestRun = ...;
> Criteria criteria = new Criteria();
> criteria.addEqualTo("testRun", myTestRun);
> ....
> OJB will take care of all the identity lookups for you (as
> long as the
> configuration xml is correct).
>
>
> Beeker, Andreas wrote:
>
> >Hi all,
> >
> >I retrieved an object (class TestRun) by an existing Iterator-Query.
> >Now I want to find all objects of class TestStep which reference
> >the former TestRun-object. My primary keys are all anonymous keys and
> >also the foreign key of class TestStep (attribute "testRun"/
> >anonymous key "testRunId").
> >
> >I've managed to find the right objects by this criteria:
> >TestRun run = ...;
> >Criteria crit = new Criteria();
> >crit.addEqualTo("testRun", new Identity(run,
> >broker).getPrimaryKeyValues()[0]);
> >
> >I've also tried to use a subquery, which lead to an
> ClassCastException
> >in SqlQueryStatement, because it assumes to get a QueryByCriteria:
> >crit.addIn("testRun", new QueryByIdentity(run));
> >
> >My OJB version is 1.0.1 and I only use the PB-API. I've seen
> that there
> >was a PB-extension for JDO (Criteria.addIdentityEqualTo) which could
> >solve
> >the problem.
> >Is this the right way or is there another more convienent
> way to define
> >the criteria (... without knowing how many keys must be specified)?
> >
> >Thanks,
> >Andreas.
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: [EMAIL PROTECTED]
> >For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
>
> --
> Robert r. Sanders
> Chief Technologist
> iPOV
> www.ipov.net
>
>
> ---------------------------------------------------------------------
> 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]