db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b..@apache.org
Subject cvs commit: db-ojb/src/test/org/apache/ojb/odmg OQLOrOnForeignKeyTest.java
Date Thu, 06 Feb 2003 18:15:24 GMT
brj         2003/02/06 10:15:23

  Modified:    src/test/org/apache/ojb/odmg OQLOrOnForeignKeyTest.java
  Log:
  updated javadoc
  
  Revision  Changes    Path
  1.5       +17 -4     db-ojb/src/test/org/apache/ojb/odmg/OQLOrOnForeignKeyTest.java
  
  Index: OQLOrOnForeignKeyTest.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/test/org/apache/ojb/odmg/OQLOrOnForeignKeyTest.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- OQLOrOnForeignKeyTest.java	14 Jan 2003 11:16:20 -0000	1.4
  +++ OQLOrOnForeignKeyTest.java	6 Feb 2003 18:15:23 -0000	1.5
  @@ -71,16 +71,24 @@
    *
    * 1. OJB will generate the following SQL when items are mapped to the same table:
    *
  - * SELECT A0.FATHER_ID,A0.MOTHER_ID,A0.LASTNAME,A0.FIRSTNAME,A0.ID FROM
  - * FAMILY_MEMBER A0 INNER JOIN FAMILY_MEMBER A2 ON A0.FATHER_ID=A2.ID
  + * SELECT A0.FATHER_ID,A0.MOTHER_ID,A0.LASTNAME,A0.FIRSTNAME,A0.ID 
  + * FROM FAMILY_MEMBER A0 
  + * INNER JOIN FAMILY_MEMBER A2 ON A0.FATHER_ID=A2.ID
    * INNER JOIN FAMILY_MEMBER A1 ON A0.MOTHER_ID=A1.ID
    * WHERE A1.ID =  ?  OR  (A2.ID =  ? )
    *
    * When it should generate:
  - * SELECT A0.FATHER_ID,A0.MOTHER_ID,A0.LASTNAME,A0.FIRSTNAME,A0.ID FROM
  - * FAMILY_MEMBER A0
  + * SELECT A0.FATHER_ID,A0.MOTHER_ID,A0.LASTNAME,A0.FIRSTNAME,A0.ID 
  + * FROM FAMILY_MEMBER A0
    * WHERE A0.FATHER_ID =  ?  OR  (A0.MOTHER_ID =  ? )
    *
  + * or:
  + * 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 = ?  OR  (A2.ID = ?)
  + *
    */
   public class OQLOrOnForeignKeyTest extends TestCase
   {
  @@ -143,6 +151,11 @@
   
   	}
   
  +    /**
  +     * fails because ojb generated INNER JOIN where LEFT OUTER JOINS is needed
  +     * 
  +     * @throws Exception
  +     */
   	public void testOrReferenceOnSameTable() throws Exception
   	{
   		int jimmyID = 5;
  
  
  

Mime
View raw message