You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Prashant Bhat (JIRA)" <ji...@apache.org> on 2010/01/22 06:22:54 UTC

[jira] Updated: (OPENJPA-1367) H2 Database Engine does support cross join

     [ https://issues.apache.org/jira/browse/OPENJPA-1367?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Prashant Bhat updated OPENJPA-1367:
-----------------------------------

    Attachment: openjpa-h2-test-results.txt
                OPENJPA-1367.patch

I've run the test cases using H2 Database-1.2.127 with current trunk revision: r901901 Please refer to the attached test-results.txt file for more details. 

Descriptions for the changes in attached patch:
1. H2Dictionary changes:
    a)  as per this issue comment: crossJoinClause = "CROSS JOIN"; requiresConditionForCrossJoin = false;
    b) Return Types.BOOLEAN for Types.BIT in getPreferredType(type) because of warning message shown while running MappingTool. The message looked like this:
        4396  workflow-entities  WARN   [main] openjpa.jdbc.Schema - Existing column "ACTIVE" on table         "OPENJPA.WORKFLOW_TASK_GROUP" is incompatible with the same column in the given schema definition. Existing column:
         Full Name: WORKFLOW_TASK_GROUP.ACTIVE
        Type: unknown(16)
         Size: 1
         Default: null
         Not Null: false
         Given column:
         Full Name: workflow_task_group.active
         Type: bit
         Size: 0
         Default: null
         Not Null: false

   c) H2 requires limit to be present for using offset. http://www.h2database.com/html/grammar.html#select

2. Changes to sql-error-state-codes.xml :   added missing error-codes (caused some test failures!)
3. TestMultipleSchemaNames.java :   Similar to Postgres, H2 requires schema to be created as as it does not create them automatically.

4. And in the documentation: I've changed the comment 'H2 does not support cross joins' to 'None' 
    But as the following test cases fail,  may be it should be explained here. I'll leave it to someone with more knowledge about these failures.
   a) module openjpa-peristence-jdbc -> All the tests completed successfully, except for the error in following test:
          org.apache.openjpa.persistence.sequence.TestSequence   => error in: testMultiThreadedNativeSequences
   b) module openjpa-peristence-locking  Tests run: 185, Failures: 43, Errors: 0, Skipped: 0

Hope this patch can be integrated into OpenJpa-2.0!

Thanks,
Prashant

> H2 Database Engine does support cross join
> ------------------------------------------
>
>                 Key: OPENJPA-1367
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-1367
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: docs, jpa
>    Affects Versions: 1.2.1, 2.0.0-M1
>            Reporter: Thomas Mueller
>            Priority: Minor
>         Attachments: OPENJPA-1367.patch, openjpa-h2-test-results.txt
>
>
> The documentation says that the H2 database does not support cross joins:
> http://openjpa.apache.org/builds/1.2.1/apache-openjpa-1.2.1/docs/manual/dbsupport_h2.html
> http://openjpa.apache.org/builds/2.0.0-M3/apache-openjpa-2.0.0-M3/docs/manual/main.html
> H2 does support cross join since a long time (I don't remember what version). See: http://www.h2database.com/html/grammar.html#table_expression (CROSS). A condition is not required for cross join.
> I think the documentation should be changed, and probably the H2Dictionary should be changed as well (crossJoinClause = "CROSS JOIN"; requiresConditionForCrossJoin = false;).

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.