You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by David Warnock <da...@sundayta.com> on 2003/02/06 00:43:04 UTC
odmg unit test error: OQLOrOnForeignKeyTest.testOrReferenceOnSameTable()
Hi,
I have just cvs updated and now the PersistanceBrokerTest.testEscaping
is working. But I get a failure in
org.apache.ojb.odmg.OQLOrOnForeignKeyTest.testOrReferenceOnSameTable()
Testcase: testOrReferenceOnSameTable took 0.04 sec
FAILED
expected:<2> but was:<0>
junit.framework.AssertionFailedError: expected:<2> but was:<0>
at
org.apache.ojb.odmg.OQLOrOnForeignKeyTest.testOrReferenceOnSameTable(OQLOrOnForeignKeyTest.java:191)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
Testcase: testOrReferenceOnSameTableTestcase:
testOrReferenceOnDifferentTables took 0.023 sec
Anyone looking at this already or am I doing something wrong?
Thanks
Dave
--
David Warnock, Sundayta Ltd. http://www.sundayta.com
iDocSys for Document Management. VisibleResults for Fundraising.
Development and Hosting of Web Applications and Sites.
Re: odmg unit test error: OQLOrOnForeignKeyTest.testOrReferenceOnSameTable()
Posted by Jakob Braeuchi <jb...@gmx.ch>.
hi david,
this is imho a problem with the joins:
we have 'jimmy' with mother_id = 12
and 'joe' with father_id = 13
and 'mom' and 'dad'.
the query executed is as follows:
SELECT A0.FATHER_ID,A0.MOTHER_ID,A0.LASTNAME,A0.FIRSTNAME,A0.ID
FROM FAMILY_MEMBER A0
INNER JOIN FAMILY_MEMBER A1 ON A0.MOTHER_ID=A1.ID
INNER JOIN FAMILY_MEMBER A2 ON A0.FATHER_ID=A2.ID
WHERE A1.ID = '12' OR A2.ID = '13'
because of the inner joins there's no record returned.
when changing the sql to outer joins 'jimmy' and 'joe' are returned as
expected.
SELECT A0.FATHER_ID,A0.MOTHER_ID,A0.LASTNAME,A0.FIRSTNAME,A0.ID
FROM FAMILY_MEMBER A0
LEFT OUTER JOIN FAMILY_MEMBER A1 ON A0.MOTHER_ID=A1.ID
LEFT OUTER JOIN FAMILY_MEMBER A2 ON A0.FATHER_ID=A2.ID
WHERE A1.ID = '12' OR A2.ID = '13'
i'll check this one with pb api.
thanks
jakob
David Warnock wrote:
> Hi,
>
> I have just cvs updated and now the PersistanceBrokerTest.testEscaping
> is working. But I get a failure in
>
> org.apache.ojb.odmg.OQLOrOnForeignKeyTest.testOrReferenceOnSameTable()
>
> Testcase: testOrReferenceOnSameTable took 0.04 sec
> FAILED
> expected:<2> but was:<0>
> junit.framework.AssertionFailedError: expected:<2> but was:<0>
> at
> org.apache.ojb.odmg.OQLOrOnForeignKeyTest.testOrReferenceOnSameTable(OQLOrOnForeignKeyTest.java:191)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>
>
> Testcase: testOrReferenceOnSameTableTestcase:
> testOrReferenceOnDifferentTables took 0.023 sec
>
> Anyone looking at this already or am I doing something wrong?
>
> Thanks
>
> Dave