From commits-return-3331-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Tue Sep 02 13:25:31 2008 Return-Path: Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 12084 invoked from network); 2 Sep 2008 13:25:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Sep 2008 13:25:31 -0000 Received: (qmail 17227 invoked by uid 500); 2 Sep 2008 13:25:29 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 17212 invoked by uid 500); 2 Sep 2008 13:25:29 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 17203 invoked by uid 99); 2 Sep 2008 13:25:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Sep 2008 06:25:29 -0700 X-ASF-Spam-Status: No, hits=-1996.3 required=10.0 tests=ALL_TRUSTED,HTML_MESSAGE,MIME_HTML_ONLY X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Sep 2008 13:24:29 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 0EB1D234C1C3 for ; Tue, 2 Sep 2008 06:25:00 -0700 (PDT) Message-ID: <721143515.1220361900040.JavaMail.www-data@brutus> Date: Tue, 2 Sep 2008 06:25:00 -0700 (PDT) From: confluence@apache.org To: commits@openjpa.apache.org Subject: [CONF] OpenJPA: Building OpenJPA (page edited) MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org

Building OpenJPA has been edited by Kevin Sutter (Sep 02, 2008).

Change summary:

Updated build instructions to be more current

(View changes)

Content:

Building OpenJPA

These instructions describe how to check out the current OpenJPA source code (from the Subversion source code management repository) and build it (using the Apache Maven 2 build tool). They are written for use from the console, and are known to work on Linux and Mac OSX. They are also reported to work from Windows.

  1. Ensure that you have Java 1.5 installed and in your path by running: java -version OpenJPA does not currently build with JDK 1.6.
  2. Install the build tool, Apache Maven 2.0.8, from http://maven.apache.org/. If it is installed correctly, typing mvn -v from the console will result in the text Maven version: 2.0.8
  3. Install the SCM tool, Subversion, from http://subversion.tigris.org/. If it installed correctly, typing the following command should output help information: svn help
  4. Create a new directory you want to do your work in, then change to that directory from the console.
  5. Check out the sources by running: svn co https://svn.apache.org/repos/asf/openjpa/trunk openjpa. It will check out the sources to openjpa directory. More information on checking out the OpenJPA sources can be found on the SourceAccess page.
  6. Change to the openjpa directory, which has already been created in the previous step.
  7. Build OpenJPA by running: mvn package or better mvn install. The first time you run the build, many dependencies are automatically resolved and downloaded. It is common for dependency downloading to fail the first time, which will fail the build. If any of these dependency downloads fail, just re-run the command. You may also add the following to your ~/.m2/setting.xml file (see http://maven.apache.org/guides/mini/guide-mirror-settings.html)
    #
<settings>
    <mirrors>
        <mirror>
            <id>repo.mergere.com</id>
            <url>http://repo.mergere.com/maven2</url>
            <mirrorOf>central</mirrorOf>
        </mirror>
    </mirrors>
</settings>

If any tests fail, and you want to ignore the failures, instead run:

mvn package -DskipTests

An example session as as follows:

$ cd /tmp/

$ java -version

java version "1.5.0_06"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_06-112)
Java HotSpot(TM) Client VM (build 1.5.0_06-64, mixed mode, sharing)

$ mvn -v

Maven version: 2.0.8

$ svn --version

svn, version 1.4.3 (r23084)
   compiled Jan 18 2007, 07:47:40

$ svn co https://svn.apache.org/repos/asf/openjpa/trunk/

A  trunk/openjpa-lib
A  trunk/openjpa-lib/src
A  trunk/openjpa-lib/src/test
A  trunk/openjpa-lib/src/test/java
A  trunk/openjpa-lib/src/test/java/org
A  trunk/openjpa-lib/src/test/java/org/apache
A  trunk/openjpa-lib/src/test/java/org/apache/openjpa
A  trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib
A  trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib/test
A  trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib/test/AbstractTestCase.java

 ...

A  trunk/openjpa-persistence/pom.xml
Checked out revision 421381.

$ cd trunk/

$ mvn compile

[INFO] Scanning for projects...
[INFO] Reactor build order: 
[INFO]   OpenJPA
[INFO]   OpenJPA Utilities
[INFO]   OpenJPA Kernel
[INFO]   OpenJPA JDBC
[INFO]   OpenJPA JPA
[INFO]   OpenJPA JPA JDBC
[INFO]   OpenJPA XML Store
[INFO]   OpenJPA Slice
[INFO]   OpenJPA Aggregate Jar
[INFO]   OpenJPA Distribution
[INFO]   OpenJPA Persistence Examples
[INFO]   OpenJPA Integration Tests
[INFO]   OpenJPA Examples Integration Tests
[INFO]   OpenJPA JPA TCK Integration Tests
[INFO] ----------------------------------------------------------------------------
[INFO] Building OpenJPA
[INFO]    task-segment: [compile]
[INFO] ----------------------------------------------------------------------------

 ...

[INFO] 
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] ------------------------------------------------------------------------
[INFO] OpenJPA ............................................... SUCCESS [0.000s]
[INFO] OpenJPA Utilities ..................................... SUCCESS [1:12.953s]
[INFO] OpenJPA Kernel ........................................ SUCCESS [13.219s]
[INFO] OpenJPA JDBC .......................................... SUCCESS [9.094s]
[INFO] OpenJPA JPA ........................................... SUCCESS [3.500s]
[INFO] OpenJPA JPA JDBC ...................................... SUCCESS [3.250s]
[INFO] OpenJPA XML Store ..................................... SUCCESS [0.140s]
[INFO] OpenJPA Slice ......................................... SUCCESS [0.719s]
[INFO] OpenJPA Aggregate Jar ................................. SUCCESS [0.250s]
[INFO] OpenJPA Distribution .................................. SUCCESS [0.344s]
[INFO] OpenJPA Persistence Examples .......................... SUCCESS [0.265s]
[INFO] OpenJPA Integration Tests ............................. SUCCESS [0.000s]
[INFO] OpenJPA Examples Integration Tests .................... SUCCESS [0.000s]
[INFO] OpenJPA JPA TCK Integration Tests ..................... SUCCESS [0.000s]
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 minute 44 seconds
[INFO] Finished at: Tue Sep 02 08:09:27 CDT 2008
[INFO] Final Memory: 11M/29M
[INFO] ------------------------------------------------------------------------


$ mvn package -DskipTests

[INFO] Scanning for projects...

...

[INFO] [assembly:attached {execution: bin}]
[INFO] Building zip: /tmp/openjpatestbuild/trunk/openjpa-project/target/site/
downloads/apache-openjpa-1.3.0-SNAPSHOT-binary.zip

... 


$ ls -lh openjpa-project/target/filtered-site/resources/downloads/

total 46985
-rw-r--r--    1 sutter pony3        9374808 Sep  2 08:14 apache-openjpa-1.3.0-SNAPSHOT-binary.zip
-rw-r--r--    1 sutter pony3       14680997 Sep  2 08:16 apache-openjpa-1.3.0-SNAPSHOT-source.zip

Executing various build tasks

Running just the "TestPersistence" test case
mvn test -Dtest=TestPersistence
Building and running only the examples included in the distribution
mvn -DskipTests -Pexamples-profile integration-test
Building just the javadoc

First install the jars:

mvn install -DskipTests

Then build the javadoc:

mvn package -DskipTests -Pjavadoc-profile

The javadoc will be output to target/site/apidocs/index.html.

Building just the docbook documentation
mvn -f openjpa-project/pom.xml process-resources -Pdocbook-profile

The manual HTML will be output to openjpa-project/target/manual/manual.html.

Building with JDK 1.4 module verification (only for versions of OpenJPA prior to 1.1.0)
mvn compile -Djava14.jar=C:\Program Files\Java\j2re1.4.2_07\lib\rt.jar compile

Specifying the "java14.jar" system property will cause the JDK-1.4-dependent modules to be compiled with the value as the bootclasspath to the compiler. This can be useful to ensure that modifications and additions do not violate the JDK version restriction of the module. Since the runtime jar location is platform, version, and installation dependent, the exact location of the runtime jar will vary, which is why it needs to be manually specified.

From commits-return-3332-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Tue Sep 02 17:48:00 2008 Return-Path: Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 13162 invoked from network); 2 Sep 2008 17:48:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Sep 2008 17:48:00 -0000 Received: (qmail 68786 invoked by uid 500); 2 Sep 2008 17:47:58 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 68769 invoked by uid 500); 2 Sep 2008 17:47:58 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 68760 invoked by uid 99); 2 Sep 2008 17:47:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Sep 2008 10:47:58 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Sep 2008 17:47:06 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 7BDEB238899E; Tue, 2 Sep 2008 10:47:07 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r691327 - /openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java Date: Tue, 02 Sep 2008 17:47:07 -0000 To: commits@openjpa.apache.org From: ppoddar@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080902174707.7BDEB238899E@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ppoddar Date: Tue Sep 2 10:47:06 2008 New Revision: 691327 URL: http://svn.apache.org/viewvc?rev=691327&view=rev Log: OPENJPA-365: This is a token commit. Original commit is 677147 but due to typo in commit message, the JIRA issue did not get assoicated correctly with the commit 677147 Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java?rev=691327&r1=691326&r2=691327&view=diff ============================================================================== --- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java (original) +++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java Tue Sep 2 10:47:06 2008 @@ -1143,6 +1143,7 @@ throw new UserException(_loc.get("meta-unknownid", cls)); } } catch (IllegalArgumentException iae) { + // OPENJPA-365 throw new UserException(_loc.get("bad-id-value", val, val.getClass().getName(), cls)).setCause(iae); } catch (OpenJPAException ke) { From commits-return-3333-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Tue Sep 02 23:08:13 2008 Return-Path: Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 26944 invoked from network); 2 Sep 2008 23:08:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Sep 2008 23:08:13 -0000 Received: (qmail 95951 invoked by uid 500); 2 Sep 2008 23:08:11 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 95894 invoked by uid 500); 2 Sep 2008 23:08:11 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 95885 invoked by uid 99); 2 Sep 2008 23:08:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Sep 2008 16:08:11 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 02 Sep 2008 23:07:21 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 8767F238899E; Tue, 2 Sep 2008 16:07:22 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r691421 - /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StoreCollectionFieldStrategy.java Date: Tue, 02 Sep 2008 23:07:22 -0000 To: commits@openjpa.apache.org From: ppoddar@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080902230722.8767F238899E@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ppoddar Date: Tue Sep 2 16:07:22 2008 New Revision: 691421 URL: http://svn.apache.org/viewvc?rev=691421&view=rev Log: OPENJPA-710: Do not add ORDER BY clause for unordered collection field. But select the field as it is expecetd subsequently for loading. Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StoreCollectionFieldStrategy.java Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StoreCollectionFieldStrategy.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StoreCollectionFieldStrategy.java?rev=691421&r1=691420&r2=691421&view=diff ============================================================================== --- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StoreCollectionFieldStrategy.java (original) +++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StoreCollectionFieldStrategy.java Tue Sep 2 16:07:22 2008 @@ -226,7 +226,11 @@ joins = sel.outer(joins); if (!selectOid) { Column[] refs = getJoinForeignKey(elem).getColumns(); - sel.orderBy(refs, true, joins, true); + if (requiresOrderBy()) { + sel.orderBy(refs, true, joins, true); + } else { + sel.select(refs, joins); + } } field.orderLocal(sel, elem, joins); } @@ -662,4 +666,8 @@ protected ForeignKey getJoinForeignKey() { return getJoinForeignKey(getDefaultElementMapping(false)); } + + boolean requiresOrderBy() { + return List.class.isAssignableFrom(field.getProxyType()); + } } From commits-return-3334-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Wed Sep 03 16:30:00 2008 Return-Path: Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 99619 invoked from network); 3 Sep 2008 16:30:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Sep 2008 16:30:00 -0000 Received: (qmail 17715 invoked by uid 500); 3 Sep 2008 16:29:58 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 17696 invoked by uid 500); 3 Sep 2008 16:29:58 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 17687 invoked by uid 99); 3 Sep 2008 16:29:58 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Sep 2008 09:29:58 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Sep 2008 16:29:08 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E5B7B23889F7; Wed, 3 Sep 2008 09:29:09 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r691666 - /openjpa/branches/sql-cache/ Date: Wed, 03 Sep 2008 16:29:09 -0000 To: commits@openjpa.apache.org From: ppoddar@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080903162909.E5B7B23889F7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ppoddar Date: Wed Sep 3 09:29:08 2008 New Revision: 691666 URL: http://svn.apache.org/viewvc?rev=691666&view=rev Log: Branch from trunk on Revision: 691335 for SQL Query Cacheing work Added: openjpa/branches/sql-cache/ - copied from r691665, openjpa/trunk/ From commits-return-3335-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Wed Sep 03 17:51:59 2008 Return-Path: Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 45466 invoked from network); 3 Sep 2008 17:51:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 3 Sep 2008 17:51:59 -0000 Received: (qmail 79734 invoked by uid 500); 3 Sep 2008 17:51:56 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 79721 invoked by uid 500); 3 Sep 2008 17:51:56 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 79636 invoked by uid 99); 3 Sep 2008 17:51:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Sep 2008 10:51:55 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Sep 2008 17:51:04 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id D312D238896F; Wed, 3 Sep 2008 10:51:34 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r691697 - in /openjpa/branches/sql-cache: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/ openjpa-jdbc/src/m... Date: Wed, 03 Sep 2008 17:51:33 -0000 To: commits@openjpa.apache.org From: ppoddar@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080903175134.D312D238896F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ppoddar Date: Wed Sep 3 10:51:33 2008 New Revision: 691697 URL: http://svn.apache.org/viewvc?rev=691697&view=rev Log: rollback 652913 and manual merging of selective changes Removed: openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/QuerySQLCacheValue.java openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/kernel/TestQuerySQLCache.java Modified: openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/JDBCConfiguration.java openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/JDBCConfigurationImpl.java openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationFieldStrategy.java openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StoreCollectionFieldStrategy.java openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/LogicalUnion.java openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLBuffer.java openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/Select.java openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectExecutor.java openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java openjpa/branches/sql-cache/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/kernel/localizer.properties openjpa/branches/sql-cache/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/meta/strats/localizer.properties openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java openjpa/branches/sql-cache/openjpa-project/src/doc/manual/ref_guide_caching.xml openjpa/branches/sql-cache/openjpa-project/src/doc/manual/ref_guide_conf.xml Modified: openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/JDBCConfiguration.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/JDBCConfiguration.java?rev=691697&r1=691696&r2=691697&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/JDBCConfiguration.java (original) +++ openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/JDBCConfiguration.java Wed Sep 3 10:51:33 2008 @@ -18,8 +18,6 @@ */ package org.apache.openjpa.jdbc.conf; -import java.util.Map; - import javax.sql.DataSource; import org.apache.openjpa.conf.OpenJPAConfiguration; @@ -604,23 +602,4 @@ * @see #getDataSource */ public DataSource getDataSource2(StoreContext ctx); - - /** - * Return QuerySQLCacheValue. - * @since 1.2.0 - */ - public QuerySQLCacheValue getQuerySQLCache(); - - /** - * Whether querySQLCache is enabled or not. - * @since 1.2.0 - */ - public boolean isQuerySQLCacheOn(); - - /** - * Return QuerySQLCacheInstance. - * @since 1.2.0 - */ - public Map getQuerySQLCacheInstance(); - } Modified: openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/JDBCConfigurationImpl.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/JDBCConfigurationImpl.java?rev=691697&r1=691696&r2=691697&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/JDBCConfigurationImpl.java (original) +++ openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/conf/JDBCConfigurationImpl.java Wed Sep 3 10:51:33 2008 @@ -20,9 +20,6 @@ import java.sql.Connection; import java.sql.ResultSet; -import java.util.HashMap; -import java.util.Map; - import javax.sql.DataSource; import org.apache.commons.lang.StringUtils; @@ -85,8 +82,6 @@ public ObjectValue mappingDefaultsPlugin; public PluginValue driverDataSourcePlugin; public MappingFactoryValue mappingFactoryPlugin; - public QuerySQLCacheValue querySQLCache; - private Map querySQLCacheInstance = new HashMap(); // used internally private String firstUser = null; @@ -307,9 +302,6 @@ seqPlugin.setDefault(JDBCSeqValue.ALIASES[0]); seqPlugin.setString(JDBCSeqValue.ALIASES[0]); - querySQLCache = new QuerySQLCacheValue("jdbc.QuerySQLCache"); - addValue(querySQLCache); - // this static initializer is to get past a weird // ClassCircularityError that happens only under IBM's // JDK 1.3.1 on Linux from within the JRun ClassLoader; @@ -864,21 +856,4 @@ return true; return false; } - - public void setQuerySQLCache(String querySQLCache) { - this.querySQLCache.setString(querySQLCache); - } - - public QuerySQLCacheValue getQuerySQLCache() { - return querySQLCache; - } - - public boolean isQuerySQLCacheOn() { - return querySQLCache.isSQLCacheOn(); - } - - public Map getQuerySQLCacheInstance() { - return querySQLCacheInstance; - } - } Modified: openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java?rev=691697&r1=691696&r2=691697&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java (original) +++ openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java Wed Sep 3 10:51:33 2008 @@ -29,20 +29,15 @@ import java.util.Collections; import java.util.HashSet; import java.util.Iterator; -import java.util.List; -import java.util.Map; import java.util.Set; - import javax.sql.DataSource; import org.apache.openjpa.event.OrphanedKeyAction; import org.apache.openjpa.jdbc.conf.JDBCConfiguration; -import org.apache.openjpa.jdbc.conf.QuerySQLCacheValue; import org.apache.openjpa.jdbc.meta.ClassMapping; import org.apache.openjpa.jdbc.meta.Discriminator; import org.apache.openjpa.jdbc.meta.FieldMapping; import org.apache.openjpa.jdbc.meta.ValueMapping; -import org.apache.openjpa.jdbc.schema.Column; import org.apache.openjpa.jdbc.sql.DBDictionary; import org.apache.openjpa.jdbc.sql.JoinSyntaxes; import org.apache.openjpa.jdbc.sql.Joins; @@ -65,12 +60,10 @@ import org.apache.openjpa.lib.jdbc.DelegatingConnection; import org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement; import org.apache.openjpa.lib.jdbc.DelegatingStatement; -import org.apache.openjpa.lib.log.Log; import org.apache.openjpa.lib.rop.MergedResultObjectProvider; import org.apache.openjpa.lib.rop.ResultObjectProvider; import org.apache.openjpa.lib.util.Localizer; import org.apache.openjpa.meta.ClassMetaData; -import org.apache.openjpa.meta.FetchGroup; import org.apache.openjpa.meta.FieldMetaData; import org.apache.openjpa.meta.JavaTypes; import org.apache.openjpa.meta.ValueStrategies; @@ -106,11 +99,7 @@ // track the pending statements so we can cancel them private Set _stmnts = Collections.synchronizedSet(new HashSet()); - - private Map _sqlCache = null; - private boolean _isQuerySQLCache = true; - private static final Object _nullCacheValue = new Object(); - + public StoreContext getContext() { return _ctx; } @@ -136,9 +125,6 @@ if (_conf.getUpdateManagerInstance().orderDirty()) ctx.setOrderDirtyObjects(true); - - _sqlCache = _conf.getQuerySQLCacheInstance(); - _isQuerySQLCache = _conf.isQuerySQLCacheOn(); } public JDBCConfiguration getConfiguration() { @@ -435,86 +421,13 @@ private Result getInitializeStateResult(OpenJPAStateManager sm, ClassMapping mapping, JDBCFetchConfiguration fetch, int subs) throws SQLException { - List params = new ArrayList(); - Select sel = newSelect(sm, mapping, fetch, subs, params); - if (sel == null) return null; - return sel.execute(this, fetch, params); - } - - private Select newSelect(OpenJPAStateManager sm, - ClassMapping mapping, JDBCFetchConfiguration fetch, int subs, - List params) { - if (!_isQuerySQLCache) - return newSelect(sm, mapping, fetch, subs); - - Map selectImplCacheMap = - getCacheMapFromQuerySQLCache(JDBCStoreManager.class); - JDBCFetchConfiguration fetchClone = new JDBCFetchConfigurationImpl(); - fetchClone.copy(fetch); - SelectKey selKey = new SelectKey(mapping, null, fetchClone); - Select sel = null; - boolean found = true; - Object obj = selectImplCacheMap.get(selKey); - if (obj == null) { - synchronized (selectImplCacheMap) { - obj = selectImplCacheMap.get(selKey); - if (obj == null) { - // Not found in cache, create a new select - obj = newSelect(sm, mapping, fetch, subs); - found = false; - } - - if (obj == null) { - // If the generated SelectImpl is null, store a generic - // known object in the cache as a placeholder. Some map - // implementations do not allow null values. - obj = _nullCacheValue; - found = false; - } - else if (obj != _nullCacheValue) - { - sel = (Select)obj; - if (sel.getSQL() == null) { - sel.setSQL(this, fetch); - found = false; - } - } - if (!found) { - addToSqlCache(selectImplCacheMap, selKey, obj); - } - } - } - - if (obj != null && obj != _nullCacheValue) - sel = (Select) obj; - - Log log = _conf.getLog(JDBCConfiguration.LOG_JDBC); - if (log.isTraceEnabled()) { - if (!found) - log.trace(_loc.get("cache-missed", mapping, this.getClass())); - else - log.trace(_loc.get("cache-hit", mapping, this.getClass())); - } - - if (sel == null) - return null; - - Object oid = sm.getObjectId(); - Column[] cols = mapping.getPrimaryKeyColumns(); - sel.wherePrimaryKey(mapping, cols, cols, oid, this, - null, null, params); - return sel; - } - - protected Select newSelect(OpenJPAStateManager sm, - ClassMapping mapping, JDBCFetchConfiguration fetch, int subs) { Select sel = _sql.newSelect(); if (!select(sel, mapping, subs, sm, null, fetch, JDBCFetchConfiguration.EAGER_JOIN, true, false)) return null; sel.wherePrimaryKey(sm.getObjectId(), mapping, this); sel.setExpectedResultCount(1, false); - return sel; + return sel.execute(this, fetch); } /** @@ -1525,163 +1438,4 @@ } } } - - public Map getCacheMapFromQuerySQLCache(Object key) { - synchronized(_sqlCache) { - //sqlCache is a map of map - Map cacheMap = (Map)_sqlCache.get(key); - if (cacheMap == null) { - cacheMap = createSQLCache(); - _sqlCache.put(key, cacheMap); - } - return cacheMap; - } - } - - public void addToSqlCache(Map cacheMap, Object key, Object value) { - cacheMap.put(key, value); - } - - public Map createSQLCache() { - QuerySQLCacheValue querySQLCache = _conf.getQuerySQLCache(); - return (Map)querySQLCache.newInstance(); - } - - public boolean isQuerySQLCacheOn() { - return _isQuerySQLCache; - } - - public Map getQuerySQLCache() { - return _sqlCache; - } - - public static class SelectKey { - public ClassMapping mapping; - public FieldMapping fm; - public JDBCFetchConfiguration fetch; - - public SelectKey (ClassMapping mapping, FieldMapping fm, - JDBCFetchConfiguration fetch) { - this.mapping = mapping; - this.fm = fm; - this.fetch = fetch; - } - - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - SelectKey selectKey = (SelectKey) o; - if (fetch != null ? !equals(fetch, selectKey.fetch) : - selectKey.fetch != null) return false; - if (mapping != null ? !mapping.equals(selectKey.mapping) : - selectKey.mapping != null) return false; - if (fm != null ? !fm.equals(selectKey.fm) : - selectKey.fm != null) return false; - return true; - } - - public boolean equals(JDBCFetchConfiguration fetch1, - JDBCFetchConfiguration fetch2) { - if (fetch1 == fetch2) - return true; - - if (fetch1.getIsolation() != fetch2.getIsolation()) - return false; - if (fetch1.getFetchDirection() != fetch2.getFetchDirection()) - return false; - if (fetch1.getEagerFetchMode() != fetch2.getEagerFetchMode()) - return false; - if (fetch1.getSubclassFetchMode() != fetch2.getSubclassFetchMode()) - return false; - if (fetch1.getJoinSyntax() != fetch2.getJoinSyntax()) - return false; - Set joins1 = fetch1.getJoins(); - Set joins2 = fetch2.getJoins(); - if (joins1 != null ? !joins1.equals(joins2) : joins2 != null) - return false; - - if (fetch1.getMaxFetchDepth() != fetch2.getMaxFetchDepth()) - return false; - if (fetch1.getReadLockLevel() != fetch2.getReadLockLevel()) - return false; - if (fetch1.getWriteLockLevel() != fetch2.getWriteLockLevel()) - return false; - - boolean sameFetchGroup = false; - boolean hasFetchGroupAll = ((JDBCFetchConfigurationImpl)fetch1). - hasFetchGroupAll(); - boolean hasFetchGroupAll1 = ((JDBCFetchConfigurationImpl)fetch2). - hasFetchGroupAll(); - if (hasFetchGroupAll && hasFetchGroupAll1) - sameFetchGroup = true; - else if (!hasFetchGroupAll && !hasFetchGroupAll1){ - boolean hasFetchGroupDefault = - ((JDBCFetchConfigurationImpl)fetch1).hasFetchGroupDefault(); - boolean hasFetchGroupDefault1 = - ((JDBCFetchConfigurationImpl)fetch2).hasFetchGroupDefault(); - if (hasFetchGroupDefault && hasFetchGroupDefault1) - sameFetchGroup = true; - } - - if (!sameFetchGroup) { - Set fetchGroups = fetch1.getFetchGroups(); - Set fetchGroups1 = fetch2.getFetchGroups(); - if (fetchGroups != null ? !fetchGroups.equals(fetchGroups1) : - fetchGroups1 != null) - return false; - } - - Set fields = fetch1.getFields(); - Set fields1 = fetch2.getFields(); - int size = fields.size(); - int size1 = fields1.size(); - if (size == 0 && size1 == 0) - return true; - else if (size != size1) - return false; - - if (fields != null ? !fields.equals(fields1) : fields1 != null) - return false; - - return true; - } - - - public int hashCode() { - int result = 0; - result = 31 * result + (mapping != null ? mapping.hashCode() : 0); - result = 31 * result + (fm != null ? fm.hashCode() : 0); - result = 31 * result + fetch.getIsolation(); - result = 31 * result + fetch.getFetchDirection(); - result = 31 * result + fetch.getEagerFetchMode(); - result = 31 * result + fetch.getSubclassFetchMode(); - result = 31 * result + fetch.getJoinSyntax(); - Set joins = fetch.getJoins(); - result = 31 * result + (joins != null ? joins.hashCode() : 0); - - result = 31 * result + fetch.getMaxFetchDepth(); - result = 31 * result + fetch.getReadLockLevel(); - result = 31 * result + fetch.getWriteLockLevel(); - - if (((JDBCFetchConfigurationImpl)fetch).hasFetchGroupAll()) - result = 31 * result + FetchGroup.NAME_ALL.hashCode(); - else { - Set fetchGroups = fetch.getFetchGroups(); - if (((JDBCFetchConfigurationImpl)fetch).hasFetchGroupDefault() - && fetchGroups != null && fetchGroups.size() == 1) - result = 31 * result + FetchGroup.NAME_DEFAULT.hashCode(); - else { - result = 31 * result + (fetchGroups != null && - fetchGroups.size() > 0 ? - fetchGroups.hashCode() : 0); - } - } - Set fields = fetch.getFields(); - result = 31 * result + (fields != null && fields.size() > 0 ? - fields.hashCode() : 0); - - return result; - } - } } Modified: openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationFieldStrategy.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationFieldStrategy.java?rev=691697&r1=691696&r2=691697&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationFieldStrategy.java (original) +++ openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/RelationFieldStrategy.java Wed Sep 3 10:51:33 2008 @@ -19,17 +19,12 @@ package org.apache.openjpa.jdbc.meta.strats; import java.sql.SQLException; -import java.util.ArrayList; import java.util.HashMap; -import java.util.List; import java.util.Map; import org.apache.openjpa.enhance.PersistenceCapable; -import org.apache.openjpa.jdbc.conf.JDBCConfiguration; import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration; -import org.apache.openjpa.jdbc.kernel.JDBCFetchConfigurationImpl; import org.apache.openjpa.jdbc.kernel.JDBCStore; -import org.apache.openjpa.jdbc.kernel.JDBCStoreManager; import org.apache.openjpa.jdbc.meta.ClassMapping; import org.apache.openjpa.jdbc.meta.Embeddable; import org.apache.openjpa.jdbc.meta.FieldMapping; @@ -44,14 +39,12 @@ import org.apache.openjpa.jdbc.schema.Table; import org.apache.openjpa.jdbc.sql.DBDictionary; import org.apache.openjpa.jdbc.sql.Joins; -import org.apache.openjpa.jdbc.sql.LogicalUnion; import org.apache.openjpa.jdbc.sql.Result; import org.apache.openjpa.jdbc.sql.Row; import org.apache.openjpa.jdbc.sql.RowManager; import org.apache.openjpa.jdbc.sql.SQLBuffer; import org.apache.openjpa.jdbc.sql.Select; import org.apache.openjpa.jdbc.sql.SelectExecutor; -import org.apache.openjpa.jdbc.sql.SelectImpl; import org.apache.openjpa.jdbc.sql.Union; import org.apache.openjpa.kernel.OpenJPAStateManager; import org.apache.openjpa.lib.log.Log; @@ -64,7 +57,6 @@ import org.apache.openjpa.util.MetaDataException; import org.apache.openjpa.util.OpenJPAId; import org.apache.openjpa.util.UnsupportedException; - import serp.util.Numbers; /** @@ -610,97 +602,9 @@ final int subs = field.getSelectSubclasses(); final Joins[] resJoins = new Joins[rels.length]; - //cache union for field here - //select data for this sm - Union union = null; - SelectImpl sel = null; - List parmList = null; - - if (!((JDBCStoreManager)store).isQuerySQLCacheOn()) - union = newUnion(sm, store, fetch, rels, subs, resJoins); - else { - Map relationFieldUnionCache = - ((JDBCStoreManager)store).getCacheMapFromQuerySQLCache( - RelationFieldStrategy.class); - boolean found = true; - JDBCFetchConfiguration fetchClone = new JDBCFetchConfigurationImpl(); - fetchClone.copy(fetch); - JDBCStoreManager.SelectKey selKey = - new JDBCStoreManager.SelectKey(null, field, fetch); - Object[] obj = relationFieldUnionCache.get(selKey); - if (obj != null) { - union = (Union) obj[0]; - resJoins[0] = (Joins)obj[1]; - } else { - synchronized(relationFieldUnionCache) { - obj = relationFieldUnionCache.get(selKey); - if (obj != null) { - union = (Union) obj[0]; - resJoins[0] = (Joins) obj[1]; - } else { - // select related mapping columns; joining from the - // related type back to our fk table if not an inverse - // mapping (in which case we can just make sure the - // inverse cols == our pk values) - union = newUnion(sm, store, fetch, rels, subs, - resJoins); - found = false; - } - sel = ((LogicalUnion.UnionSelect)union.getSelects()[0]). - getDelegate(); - SQLBuffer buf = sel.getSQL(); - if (buf == null) { - ((SelectImpl)sel).setSQL(store, fetch); - found = false; - } - - // only cache the union when elems length is 1 for now - if (!found && rels.length == 1) { - Object[] obj1 = new Object[2]; - obj1[0] = union; - obj1[1] = resJoins[0]; - ((JDBCStoreManager)store).addToSqlCache( - relationFieldUnionCache, selKey, obj1); - } - } - } - Log log = store.getConfiguration(). - getLog(JDBCConfiguration.LOG_JDBC); - if (log.isTraceEnabled()){ - if (found) - log.trace(_loc.get("cache-hit", field, this.getClass())); - else - log.trace(_loc.get("cache-missed", field, this.getClass())); - } - - parmList = new ArrayList(); - ClassMapping mapping = field.getDefiningMapping(); - Object oid = sm.getObjectId(); - Column[] cols = mapping.getPrimaryKeyColumns(); - if (sel == null) - sel = ((LogicalUnion.UnionSelect)union.getSelects()[0]). - getDelegate(); - - sel.wherePrimaryKey(mapping, cols, cols, oid, store, - null, null, parmList); - } - - Result res = union.execute(store, fetch, parmList); - try { - Object val = null; - if (res.next()) - val = res.load(rels[res.indexOf()], store, fetch, - resJoins[res.indexOf()]); - sm.storeObject(field.getIndex(), val); - } finally { - res.close(); - } - } - - protected Union newUnion(final OpenJPAStateManager sm, - final JDBCStore store, final JDBCFetchConfiguration fetch, - final ClassMapping[] rels, final int subs, - final Joins[] resJoins) { + // select related mapping columns; joining from the related type + // back to our fk table if not an inverse mapping (in which case we + // can just make sure the inverse cols == our pk values) Union union = store.getSQLFactory().newUnion(rels.length); union.setExpectedResultCount(1, false); if (fetch.getSubclassFetchMode(field.getTypeMapping()) @@ -721,7 +625,17 @@ resJoins[idx]); } }); - return union; + + Result res = union.execute(store, fetch); + try { + Object val = null; + if (res.next()) + val = res.load(rels[res.indexOf()], store, fetch, + resJoins[res.indexOf()]); + sm.storeObject(field.getIndex(), val); + } finally { + res.close(); + } } public Object toDataStoreValue(Object val, JDBCStore store) { Modified: openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StoreCollectionFieldStrategy.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StoreCollectionFieldStrategy.java?rev=691697&r1=691696&r2=691697&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StoreCollectionFieldStrategy.java (original) +++ openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StoreCollectionFieldStrategy.java Wed Sep 3 10:51:33 2008 @@ -26,11 +26,8 @@ import java.util.Map; import org.apache.openjpa.enhance.PersistenceCapable; -import org.apache.openjpa.jdbc.conf.JDBCConfiguration; import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration; -import org.apache.openjpa.jdbc.kernel.JDBCFetchConfigurationImpl; import org.apache.openjpa.jdbc.kernel.JDBCStore; -import org.apache.openjpa.jdbc.kernel.JDBCStoreManager; import org.apache.openjpa.jdbc.meta.ClassMapping; import org.apache.openjpa.jdbc.meta.FieldMapping; import org.apache.openjpa.jdbc.meta.FieldStrategy; @@ -38,15 +35,11 @@ import org.apache.openjpa.jdbc.schema.Column; import org.apache.openjpa.jdbc.schema.ForeignKey; import org.apache.openjpa.jdbc.sql.Joins; -import org.apache.openjpa.jdbc.sql.LogicalUnion; import org.apache.openjpa.jdbc.sql.Result; import org.apache.openjpa.jdbc.sql.Select; import org.apache.openjpa.jdbc.sql.SelectExecutor; -import org.apache.openjpa.jdbc.sql.SelectImpl; import org.apache.openjpa.jdbc.sql.Union; import org.apache.openjpa.kernel.OpenJPAStateManager; -import org.apache.openjpa.lib.log.Log; -import org.apache.openjpa.lib.util.Localizer; import org.apache.openjpa.meta.ClassMetaData; import org.apache.openjpa.meta.JavaTypes; import org.apache.openjpa.util.ChangeTracker; @@ -66,9 +59,6 @@ public abstract class StoreCollectionFieldStrategy extends ContainerFieldStrategy { - private static final Localizer _loc = Localizer.forPackage - (StoreCollectionFieldStrategy.class); - /** * Return the foreign key used to join to the owning field for the given * element mapping from {@link #getIndependentElementMappings} (or null). @@ -508,86 +498,19 @@ return; } - //cache union for field here // select data for this sm - boolean found = true; final ClassMapping[] elems = getIndependentElementMappings(true); final Joins[] resJoins = new Joins[Math.max(1, elems.length)]; - List parmList = null; - Union union = null; - SelectImpl sel = null; - Map storeCollectionUnionCache = null; - JDBCStoreManager.SelectKey selKey = null; - if (!((JDBCStoreManager)store).isQuerySQLCacheOn() || elems.length > 1) - union = newUnion(sm, store, fetch, elems, resJoins); - else { - parmList = new ArrayList(); - JDBCFetchConfiguration fetchClone = new JDBCFetchConfigurationImpl(); - fetchClone.copy(fetch); - - // to specify the type so that no cast is needed - storeCollectionUnionCache = ((JDBCStoreManager)store). - getCacheMapFromQuerySQLCache(StoreCollectionFieldStrategy.class); - selKey = - new JDBCStoreManager.SelectKey(null, field, fetchClone); - Object[] objs = storeCollectionUnionCache.get(selKey); - if (objs != null) { - union = (Union) objs[0]; - resJoins[0] = (Joins) objs[1]; - } - else { - synchronized(storeCollectionUnionCache) { - objs = storeCollectionUnionCache.get(selKey); - if (objs == null) { - // select data for this sm - union = newUnion(sm, store, fetch, elems, resJoins); - found = false; - } else { - union = (Union) objs[0]; - resJoins[0] = (Joins) objs[1]; - } - - sel = ((LogicalUnion.UnionSelect)union.getSelects()[0]). - getDelegate(); - if (sel.getSQL() == null) { - ((SelectImpl)sel).setSQL(store, fetch); - found = false; - } - - // only cache the union when elems length is 1 for now - if (!found) { - Object[] objs1 = new Object[2]; - objs1[0] = union; - objs1[1] = resJoins[0]; - ((JDBCStoreManager)store).addToSqlCache( - storeCollectionUnionCache, selKey, objs1); - } - } - } - - Log log = store.getConfiguration(). - getLog(JDBCConfiguration.LOG_JDBC); - if (log.isTraceEnabled()) { - if (found) - log.trace(_loc.get("cache-hit", field, this.getClass())); - else - log.trace(_loc.get("cache-missed", field, this.getClass())); + Union union = store.getSQLFactory().newUnion + (Math.max(1, elems.length)); + union.select(new Union.Selector() { + public void select(Select sel, int idx) { + ClassMapping elem = (elems.length == 0) ? null : elems[idx]; + resJoins[idx] = selectAll(sel, elem, sm, store, fetch, + JDBCFetchConfiguration.EAGER_PARALLEL); } - - ClassMapping mapping = field.getDefiningMapping(); - Object oid = sm.getObjectId(); - Column[] cols = mapping.getPrimaryKeyColumns(); - if (sel == null) - sel = ((LogicalUnion.UnionSelect)union.getSelects()[0]). - getDelegate(); - - sel.wherePrimaryKey(mapping, cols, cols, oid, store, - null, null, parmList); - List nonFKParams = sel.getSQL().getNonFKParameters(); - if (nonFKParams != null && nonFKParams.size() > 0) - parmList.addAll(nonFKParams); - } - + }); + // create proxy Object coll; ChangeTracker ct = null; @@ -600,7 +523,7 @@ } // load values - Result res = union.execute(store, fetch, parmList); + Result res = union.execute(store, fetch); try { int seq = -1; while (res.next()) { @@ -624,21 +547,6 @@ sm.storeObject(field.getIndex(), coll); } - protected Union newUnion(final OpenJPAStateManager sm, final JDBCStore store, - final JDBCFetchConfiguration fetch, final ClassMapping[] elems, - final Joins[] resJoins) { - Union union = store.getSQLFactory().newUnion - (Math.max(1, elems.length)); - union.select(new Union.Selector() { - public void select(Select sel, int idx) { - ClassMapping elem = (elems.length == 0) ? null : elems[idx]; - resJoins[idx] = selectAll(sel, elem, sm, store, fetch, - JDBCFetchConfiguration.EAGER_PARALLEL); - } - }); - return union; - } - /** * Select data for loading, starting in field table. */ Modified: openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/LogicalUnion.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/LogicalUnion.java?rev=691697&r1=691696&r2=691697&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/LogicalUnion.java (original) +++ openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/LogicalUnion.java Wed Sep 3 10:51:33 2008 @@ -202,32 +202,20 @@ } public Result execute(JDBCStore store, JDBCFetchConfiguration fetch) - throws SQLException { - return execute(store, fetch, null); - } - - public Result execute(JDBCStore store, JDBCFetchConfiguration fetch, - int lockLevel) - throws SQLException { - return execute(store, fetch, lockLevel, null); - } - - public Result execute(JDBCStore store, JDBCFetchConfiguration fetch, - List params) throws SQLException { if (fetch == null) fetch = store.getFetchConfiguration(); - return execute(store, fetch, fetch.getReadLockLevel(), params); + return execute(store, fetch, fetch.getReadLockLevel()); } public Result execute(JDBCStore store, JDBCFetchConfiguration fetch, - int lockLevel, List params) + int lockLevel) throws SQLException { if (fetch == null) fetch = store.getFetchConfiguration(); if (sels.length == 1) { - Result res = sels[0].execute(store, fetch, lockLevel, params); + Result res = sels[0].execute(store, fetch, lockLevel); ((AbstractResult) res).setBaseMapping(mappings[0]); return res; } @@ -236,7 +224,7 @@ AbstractResult res; for (int i = 0; i < sels.length; i++) { res = (AbstractResult) sels[i].execute(store, fetch, - lockLevel, params); + lockLevel); res.setBaseMapping(mappings[i]); res.setIndexOf(i); @@ -268,7 +256,7 @@ List l; for (int i = 0; i < res.length; i++) { res[i] = (AbstractResult) sels[i].execute(store, fetch, - lockLevel, params); + lockLevel); res[i].setBaseMapping(mappings[i]); res[i].setIndexOf(i); @@ -315,7 +303,7 @@ /** * A select that is part of a logical union. */ - public class UnionSelect + protected class UnionSelect implements Select { protected final SelectImpl sel; @@ -408,18 +396,6 @@ return sel.getCount(store); } - public Result execute(JDBCStore store, JDBCFetchConfiguration fetch, - List params) - throws SQLException { - return sel.execute(store, fetch, params); - } - - public Result execute(JDBCStore store, JDBCFetchConfiguration fetch, - int lockLevel, List params) - throws SQLException { - return sel.execute(store, fetch, lockLevel, params); - } - public Result execute(JDBCStore store, JDBCFetchConfiguration fetch) throws SQLException { return sel.execute(store, fetch); @@ -430,7 +406,7 @@ throws SQLException { return sel.execute(store, fetch, lockLevel); } - + public List getSubselects() { return Collections.EMPTY_LIST; } @@ -499,14 +475,6 @@ return sel.getHaving(); } - public SQLBuffer getSQL() { - return sel.getSQL(); - } - - public void setSQL(JDBCStore store, JDBCFetchConfiguration fetch) { - sel.setSQL(store, fetch); - } - public void addJoinClassConditions() { sel.addJoinClassConditions(); } @@ -749,15 +717,6 @@ JDBCStore store) { sel.wherePrimaryKey(oid, mapping, store); } - - public int wherePrimaryKey(ClassMapping mapping, Column[] toCols, - Column[] fromCols, Object oid, JDBCStore store, PathJoins pj, - SQLBuffer buf, List parmList) { - return sel.wherePrimaryKey(mapping, toCols, fromCols, oid, store, pj, - buf, parmList); - } - - public void whereForeignKey(ForeignKey fk, Object oid, ClassMapping mapping, JDBCStore store) { Modified: openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLBuffer.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLBuffer.java?rev=691697&r1=691696&r2=691697&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLBuffer.java (original) +++ openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLBuffer.java Wed Sep 3 10:51:33 2008 @@ -480,19 +480,9 @@ * the SQL in this buffer. */ public PreparedStatement prepareStatement(Connection conn, int rsType, - int rsConcur, List parms) - throws SQLException { - return prepareStatement(conn, null, rsType, rsConcur, parms); - } - - /** - * Create and populate the parameters of a prepared statement using - * the SQL in this buffer. - */ - public PreparedStatement prepareStatement(Connection conn, int rsType, int rsConcur) throws SQLException { - return prepareStatement(conn, rsType, rsConcur, null); + return prepareStatement(conn, null, rsType, rsConcur); } /** @@ -502,16 +492,6 @@ public PreparedStatement prepareStatement(Connection conn, JDBCFetchConfiguration fetch, int rsType, int rsConcur) throws SQLException { - return prepareStatement(conn, fetch, rsType, rsConcur, null); - } - - /** - * Create and populate the parameters of a prepred statement using the - * SQL in this buffer and the given fetch configuration. - */ - public PreparedStatement prepareStatement(Connection conn, - JDBCFetchConfiguration fetch, int rsType, int rsConcur, List parms) - throws SQLException { if (rsType == -1 && fetch == null) rsType = ResultSet.TYPE_FORWARD_ONLY; else if (rsType == -1) @@ -526,7 +506,7 @@ else stmnt = conn.prepareStatement(getSQL(), rsType, rsConcur); try { - setParameters(stmnt, parms); + setParameters(stmnt); if (fetch != null) { if (fetch.getFetchBatchSize() > 0) stmnt.setFetchSize(fetch.getFetchBatchSize()); @@ -609,25 +589,13 @@ */ public void setParameters(PreparedStatement ps) throws SQLException { - setParameters(ps, null); - } - - /** - * Populate the parameters of an existing PreparedStatement - * with values from this buffer. - */ - public void setParameters(PreparedStatement ps, List cacheParams) - throws SQLException { - List params = ((cacheParams != null && cacheParams.size() > 0) ? - cacheParams : _params); - - if (params == null) + if (_params == null) return; Column col; - for (int i = 0; i < params.size(); i++) { + for (int i = 0; i < _params.size(); i++) { col = (_cols == null) ? null : (Column) _cols.get(i); - _dict.setUnknown(ps, i + 1, params.get(i), col); + _dict.setUnknown(ps, i + 1, _params.get(i), col); } } Modified: openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/Select.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/Select.java?rev=691697&r1=691696&r2=691697&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/Select.java (original) +++ openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/Select.java Wed Sep 3 10:51:33 2008 @@ -193,19 +193,6 @@ public SQLBuffer getHaving(); /** - * Return the SQL for this select. This buffer contains - * the final SQL to be executed/cached. - */ - public SQLBuffer getSQL(); - - /** - * Create and set the SQLBuffer object to this select. This buffer contains - * the final SQL to be executed/cached. - */ - public void setSQL(JDBCStore store, JDBCFetchConfiguration fetch); - - - /** * Apply class conditions from relation joins. This may affect the return * values of {@link #getJoins}, {@link #getJoinIterator}, and * {@link #getWhere}. @@ -528,19 +515,6 @@ */ public void wherePrimaryKey(Object oid, ClassMapping mapping, JDBCStore store); - - - /** - * Add where conditions setting the mapping's primary key to the given - * oid values. If the parmList is not null, the value of the primary - * key will be collected and saved into the parmList. If the parmList is - * null, this method will build the where clause with the value - * incorporated in the where clause. - */ - public int wherePrimaryKey(ClassMapping mapping, Column[] toCols, - Column[] fromCols, Object oid, JDBCStore store, PathJoins pj, - SQLBuffer buf, List parmList); - /** * Add where conditions setting the given foreign key to the given Modified: openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectExecutor.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectExecutor.java?rev=691697&r1=691696&r2=691697&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectExecutor.java (original) +++ openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectExecutor.java Wed Sep 3 10:51:33 2008 @@ -19,7 +19,6 @@ package org.apache.openjpa.jdbc.sql; import java.sql.SQLException; -import java.util.List; import org.apache.openjpa.jdbc.conf.JDBCConfiguration; import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration; @@ -134,20 +133,6 @@ * Execute this select in the context of the given store manager. */ public Result execute(JDBCStore store, JDBCFetchConfiguration fetch, - List params) - throws SQLException; - - /** - * Execute this select in the context of the given store manager. - */ - public Result execute(JDBCStore store, JDBCFetchConfiguration fetch, - int lockLevel, List params) - throws SQLException; - - /** - * Execute this select in the context of the given store manager. - */ - public Result execute(JDBCStore store, JDBCFetchConfiguration fetch, int lockLevel) throws SQLException; } Modified: openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java?rev=691697&r1=691696&r2=691697&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java (original) +++ openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java Wed Sep 3 10:51:33 2008 @@ -170,10 +170,7 @@ // if the bit is set, the corresponding alias has been removed from parent // and recorded under subselect. private BitSet _removedAliasFromParent = new BitSet(16); - - //contains final sql statement to be executed/cached - private SQLBuffer _sql = null; - + /** * Helper method to return the proper table alias for the given alias index. */ @@ -306,7 +303,7 @@ stmnt = prepareStatement(conn, sql, null, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, false); - rs = executeQuery(conn, stmnt, sql, false, store, null); + rs = executeQuery(conn, stmnt, sql, false, store); return getCount(rs); } finally { if (rs != null) @@ -318,31 +315,20 @@ } } - public Result execute(JDBCStore store, JDBCFetchConfiguration fetch, - List parms) throws SQLException { + public Result execute(JDBCStore store, JDBCFetchConfiguration fetch) + throws SQLException { if (fetch == null) fetch = store.getFetchConfiguration(); return execute(store.getContext(), store, fetch, - fetch.getReadLockLevel(), parms); - } - - public Result execute(JDBCStore store, JDBCFetchConfiguration fetch) - throws SQLException { - return execute(store, fetch, null); - } - - public Result execute(JDBCStore store, JDBCFetchConfiguration fetch, - int lockLevel, List parms) - throws SQLException { - if (fetch == null) - fetch = store.getFetchConfiguration(); - return execute(store.getContext(), store, fetch, lockLevel, parms); + fetch.getReadLockLevel()); } public Result execute(JDBCStore store, JDBCFetchConfiguration fetch, int lockLevel) throws SQLException { - return execute(store, fetch, lockLevel, null); + if (fetch == null) + fetch = store.getFetchConfiguration(); + return execute(store.getContext(), store, fetch, lockLevel); } /** @@ -350,21 +336,16 @@ * context is passed in separately for profiling purposes. */ protected Result execute(StoreContext ctx, JDBCStore store, - JDBCFetchConfiguration fetch, int lockLevel, List params) + JDBCFetchConfiguration fetch, int lockLevel) throws SQLException { - boolean forUpdate = isForUpdate(store, lockLevel); - - // A non-null _sql indicates that this SelectImpl object - // is obtained from cache. The _sql is constructed - // under the assumption that isAggregate() is false - // and _grouping is null. If neither of these holds, - // we need to re-construct the _sql - if (_sql != null && (isAggregate() || _grouping != null)) - _sql = null; - - if (_sql == null) - _sql = toSelect(forUpdate, fetch); - + boolean forUpdate = false; + if (!isAggregate() && _grouping == null) { + JDBCLockManager lm = store.getLockManager(); + if (lm != null) + forUpdate = lm.selectForUpdate(this, lockLevel); + } + + SQLBuffer sql = toSelect(forUpdate, fetch); boolean isLRS = isLRS(); int rsType = (isLRS && supportsRandomAccess(forUpdate)) ? -1 : ResultSet.TYPE_FORWARD_ONLY; @@ -373,15 +354,13 @@ ResultSet rs = null; try { if (isLRS) - stmnt = prepareStatement(conn, _sql, fetch, rsType, -1, true, - params); + stmnt = prepareStatement(conn, sql, fetch, rsType, -1, true); else - stmnt = prepareStatement(conn, _sql, null, rsType, -1, false, - params); + stmnt = prepareStatement(conn, sql, null, rsType, -1, false); setTimeout(stmnt, forUpdate, fetch); - rs = executeQuery(conn, stmnt, _sql, isLRS, store, params); + rs = executeQuery(conn, stmnt, sql, isLRS, store); } catch (SQLException se) { // clean up statement if (stmnt != null) @@ -391,17 +370,7 @@ } return getEagerResult(conn, stmnt, rs, store, fetch, forUpdate, - _sql.getSQL()); - } - - private boolean isForUpdate(JDBCStore store, int lockLevel) { - boolean forUpdate = false; - if (!isAggregate() && _grouping == null) { - JDBCLockManager lm = store.getLockManager(); - if (lm != null) - forUpdate = lm.selectForUpdate(this, lockLevel); - } - return forUpdate; + sql.getSQL()); } /** @@ -447,22 +416,10 @@ protected PreparedStatement prepareStatement(Connection conn, SQLBuffer sql, JDBCFetchConfiguration fetch, int rsType, int rsConcur, boolean isLRS) throws SQLException { - // add comments why we pass in null as the last parameter - return prepareStatement(conn, sql, fetch, rsType, rsConcur, isLRS, - null); - } - - /** - * This method is to provide override for non-JDBC or JDBC-like - * implementation of preparing statement. - */ - protected PreparedStatement prepareStatement(Connection conn, - SQLBuffer sql, JDBCFetchConfiguration fetch, int rsType, - int rsConcur, boolean isLRS, List params) throws SQLException { if (fetch == null) - return sql.prepareStatement(conn, rsType, rsConcur, params); + return sql.prepareStatement(conn, rsType, rsConcur); else - return sql.prepareStatement(conn, fetch, rsType, -1, params); + return sql.prepareStatement(conn, fetch, rsType, -1); } /** @@ -491,8 +448,7 @@ * implementation of executing query. */ protected ResultSet executeQuery(Connection conn, PreparedStatement stmnt, - SQLBuffer sql, boolean isLRS, JDBCStore store, List params) - throws SQLException { + SQLBuffer sql, boolean isLRS, JDBCStore store) throws SQLException { return stmnt.executeQuery(); } @@ -706,19 +662,6 @@ return _having; } - public SQLBuffer getSQL() { - return _sql; - } - - public void setSQL(SQLBuffer sql) { - _sql = sql; - } - - public void setSQL(JDBCStore store, JDBCFetchConfiguration fetch) { - boolean forUpdate = isForUpdate(store, fetch.getReadLockLevel()); - _sql = toSelect(forUpdate, fetch); - } - public void addJoinClassConditions() { if (_joins == null || _joins.joins() == null) return; @@ -1410,38 +1353,12 @@ return; } - SQLBuffer buf = new SQLBuffer(_dict); - - // only bother to pack pk values into array if app id - int count = wherePrimaryKey(mapping, toCols, fromCols, oid, store, pj, - buf, null); - - if (constCols != null && constCols.length > 0) { - for (int i = 0; i < constCols.length; i++, count++) { - if (count > 0) - buf.append(" AND "); - buf.append(getColumnAlias(constCols[i], pj)); - - if (vals[i] == null) - buf.append(" IS "); - else - buf.append(" = "); - buf.appendValue(vals[i], constCols[i]); - } - } - - where(buf, pj); - } - - public int wherePrimaryKey(ClassMapping mapping, Column[] toCols, - Column[] fromCols, Object oid, JDBCStore store, PathJoins pj, - SQLBuffer buf, List parmList) { // only bother to pack pk values into array if app id - boolean collectParmValueOnly = (parmList != null ? true : false); Object[] pks = null; if (mapping.getIdentityType() == ClassMapping.ID_APPLICATION) pks = ApplicationIds.toPKValues(oid, mapping); + SQLBuffer buf = new SQLBuffer(_dict); Joinable join; Object val; int count = 0; @@ -1454,13 +1371,8 @@ val = pks[mapping.getField(join.getFieldIndex()). getPrimaryKeyIndex()]; val = join.getJoinValue(val, toCols[i], store); - if (parmList != null) - parmList.add(val); } - - if (collectParmValueOnly) - continue; - + if (count > 0) buf.append(" AND "); buf.append(getColumnAlias(fromCols[i], pj)); @@ -1470,9 +1382,24 @@ buf.append(" = "); buf.appendValue(val, fromCols[i]); } - return count; + + if (constCols != null && constCols.length > 0) { + for (int i = 0; i < constCols.length; i++, count++) { + if (count > 0) + buf.append(" AND "); + buf.append(getColumnAlias(constCols[i], pj)); + + if (vals[i] == null) + buf.append(" IS "); + else + buf.append(" = "); + buf.appendValue(vals[i], constCols[i]); + } + } + + where(buf, pj); } - + /** * Test to see if the given set of columns contains all the * columns in the given potential subset. Modified: openjpa/branches/sql-cache/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/kernel/localizer.properties URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/kernel/localizer.properties?rev=691697&r1=691696&r2=691697&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/kernel/localizer.properties (original) +++ openjpa/branches/sql-cache/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/kernel/localizer.properties Wed Sep 3 10:51:33 2008 @@ -115,5 +115,4 @@ batch_limit: The batch limit is set to {0}. batch_update_info: ExecuteBatch command returns update count {0} for \ statement {1}. -cache-hit: SQL Cache hit with key: {0} in {1} -cache-missed: SQL Cache missed with key: {0} in {1} + Modified: openjpa/branches/sql-cache/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/meta/strats/localizer.properties URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/meta/strats/localizer.properties?rev=691697&r1=691696&r2=691697&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/meta/strats/localizer.properties (original) +++ openjpa/branches/sql-cache/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/meta/strats/localizer.properties Wed Sep 3 10:51:33 2008 @@ -134,9 +134,6 @@ its "{1}" primary key field does not use a simple mapping. unmapped-datastore-value: Instances of type "{0}" are not valid query \ parameters because the type is not mapped. -cache-hit: SQL Cache hit with key: {0} in {1} -cache-missed: SQL Cache missed with key: {0} in {1} -cant-set-value: Field "{1}" of "{0}" can not be set to "{2}" value. multi-column-version-unsupported:You have specified more than one column for \ version data, but the "{1}" version strategy does not support multi-column \ versioning. \ No newline at end of file Modified: openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java?rev=691697&r1=691696&r2=691697&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java (original) +++ openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java Wed Sep 3 10:51:33 2008 @@ -82,9 +82,6 @@ public Set rootClasses; public Set rootInstances; public Map hints = null; - - public boolean fetchGroupContainsDefault = false; - public boolean fetchGroupContainsAll = false; } private final ConfigurationState _state; @@ -95,7 +92,7 @@ private boolean _load = true; private int _availableRecursion; private int _availableDepth; - + public FetchConfigurationImpl() { this(null); } @@ -224,22 +221,10 @@ public boolean hasFetchGroup(String group) { return _state.fetchGroups != null - && (hasFetchGroupAll() - || _state.fetchGroups.contains(group)); + && (_state.fetchGroups.contains(group) + || _state.fetchGroups.contains(FetchGroup.NAME_ALL)); } - public boolean hasFetchGroupDefault() - { - // Fetch group All includes fetch group Default by definition - return _state.fetchGroupContainsDefault || - _state.fetchGroupContainsAll; - } - - public boolean hasFetchGroupAll() - { - return _state.fetchGroupContainsAll; - } - public FetchConfiguration addFetchGroup(String name) { if (StringUtils.isEmpty(name)) throw new UserException(_loc.get("null-fg")); @@ -249,10 +234,6 @@ if (_state.fetchGroups == null) _state.fetchGroups = new HashSet(); _state.fetchGroups.add(name); - if (FetchGroup.NAME_ALL.equals(name)) - _state.fetchGroupContainsAll = true; - else if (FetchGroup.NAME_DEFAULT.equals(name)) - _state.fetchGroupContainsDefault = true; } finally { unlock(); } @@ -270,13 +251,8 @@ public FetchConfiguration removeFetchGroup(String group) { lock(); try { - if (_state.fetchGroups != null) { + if (_state.fetchGroups != null) _state.fetchGroups.remove(group); - if (FetchGroup.NAME_ALL.equals(group)) - _state.fetchGroupContainsAll = false; - else if (FetchGroup.NAME_DEFAULT.equals(group)) - _state.fetchGroupContainsDefault = false; - } } finally { unlock(); } @@ -286,9 +262,8 @@ public FetchConfiguration removeFetchGroups(Collection groups) { lock(); try { - if (_state.fetchGroups != null && groups != null) - for (Object group : groups) - removeFetchGroup(group.toString()); + if (_state.fetchGroups != null) + _state.fetchGroups.removeAll(groups); } finally { unlock(); } @@ -298,11 +273,8 @@ public FetchConfiguration clearFetchGroups() { lock(); try { - if (_state.fetchGroups != null) { + if (_state.fetchGroups != null) _state.fetchGroups.clear(); - _state.fetchGroupContainsAll = false; - _state.fetchGroupContainsDefault = true; - } } finally { unlock(); } @@ -590,9 +562,9 @@ * Whether our configuration state includes the given field. */ private boolean includes(FieldMetaData fmd) { - if (hasFetchGroupAll() - || (fmd.isInDefaultFetchGroup() - && hasFetchGroupDefault()) + if ((fmd.isInDefaultFetchGroup() + && hasFetchGroup(FetchGroup.NAME_DEFAULT)) + || hasFetchGroup(FetchGroup.NAME_ALL) || hasField(fmd.getFullName(false)) || hasField(fmd.getRealName())) return true; Modified: openjpa/branches/sql-cache/openjpa-project/src/doc/manual/ref_guide_caching.xml URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-project/src/doc/manual/ref_guide_caching.xml?rev=691697&r1=691696&r2=691697&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-project/src/doc/manual/ref_guide_caching.xml (original) +++ openjpa/branches/sql-cache/openjpa-project/src/doc/manual/ref_guide_caching.xml Wed Sep 3 10:51:33 2008 @@ -951,85 +951,4 @@ -
- - Query SQL Cache - - - - caching - - - query sql cache - - - -The query SQL cache is a Map used to cache -pushed-down SQL query strings for the find operation. As a result, -the SQL queries are only generated once in OpenJPA, and cached thereafter. -This query SQL cache is shared across entity managers and the fetch plan -is part of the cache key. You can control the SQL cache through -the -openjpa.jdbc.QuerySQLCache configuration property. This -property accepts a plugin string (see ) -describing the Map used to associate query strings and -their parsed form. This property accepts the following aliases: - - - - Pre-defined aliases - - - - - - - - Alias - Value - Notes - - - - - -true - - -org.apache.openjpa.util.CacheMap - - -The default option. Uses a - -CacheMap to store sql string. -CacheMap maintains a fixed number of cache entries, and an -optional soft reference map for entries that are moved out of the LRU space. -So, for applications that have a monotonically increasing number of distinct -queries, this option can be used to ensure that a fixed amount of memory is -used by the cache. - - - - all - -org.apache.openjpa.lib.util.ConcurrentHashMap - - -This is the fastest option, but sql string is never dropped from the -cache, so if you use a large number of dynamic queries, this option may result -in ever-increasing memory usage. Note that if your queries only differ in the -values of the parameters, this should not be an issue. - - - - false - none - -Disables the sql cache. - - - - -
-
Modified: openjpa/branches/sql-cache/openjpa-project/src/doc/manual/ref_guide_conf.xml URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-project/src/doc/manual/ref_guide_conf.xml?rev=691697&r1=691696&r2=691697&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-project/src/doc/manual/ref_guide_conf.xml (original) +++ openjpa/branches/sql-cache/openjpa-project/src/doc/manual/ref_guide_conf.xml Wed Sep 3 10:51:33 2008 @@ -3381,42 +3381,6 @@ classes. See for details. -
- - openjpa.jdbc.QuerySQLCache - - - - QuerySQLCache - - - - - caching - - - QuerySQLCache - - - -Property name: -openjpa.jdbc.QuerySQLCache - - -Resource adaptor config-property: -QuerySQLCache - - -Default: true. - - -Description: A plugin string (see -) describing the -java.util.Map to use for caching of the SQL string -used by the find operation. See for -details. - -
openjpa.jdbc.ResultSetType From commits-return-3336-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Thu Sep 04 23:12:49 2008 Return-Path: <commits-return-3336-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 40153 invoked from network); 4 Sep 2008 23:12:49 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Sep 2008 23:12:49 -0000 Received: (qmail 2307 invoked by uid 500); 4 Sep 2008 23:12:47 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 2288 invoked by uid 500); 4 Sep 2008 23:12:46 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 2279 invoked by uid 99); 4 Sep 2008 23:12:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Sep 2008 16:12:46 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Sep 2008 23:11:56 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id C071F238898F; Thu, 4 Sep 2008 16:12:27 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r692299 - in /openjpa/branches/0.9.7-r547073: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ClassMapping.java openjpa-kernel/src/main/java/org/apache/openjpa/util/OpenJPAId.java Date: Thu, 04 Sep 2008 23:12:27 -0000 To: commits@openjpa.apache.org From: ssegu@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080904231227.C071F238898F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ssegu Date: Thu Sep 4 16:12:27 2008 New Revision: 692299 URL: http://svn.apache.org/viewvc?rev=692299&view=rev Log: OPENJPA-313.2.patch Modified: openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ClassMapping.java openjpa/branches/0.9.7-r547073/openjpa-kernel/src/main/java/org/apache/openjpa/util/OpenJPAId.java Modified: openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ClassMapping.java URL: http://svn.apache.org/viewvc/openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ClassMapping.java?rev=692299&r1=692298&r2=692299&view=diff ============================================================================== --- openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ClassMapping.java (original) +++ openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ClassMapping.java Thu Sep 4 16:12:27 2008 @@ -30,6 +30,7 @@ import java.util.Map; import java.util.Set; +import org.apache.commons.lang.StringUtils; import org.apache.openjpa.enhance.PersistenceCapable; import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration; import org.apache.openjpa.jdbc.kernel.JDBCStore; @@ -189,8 +190,34 @@ } } Object oid = ApplicationIds.fromPKValues(vals, cls); - if (!subs && oid instanceof OpenJPAId) - ((OpenJPAId) oid).setManagedInstanceType(cls.getDescribedType()); + + /** + * For polymorphic relations, + * the type field in the oid is initially set to base type. + * If the discriminator value is preset in the current result, + * then the type field needs reset based on the discriminator value. + * If the discriminator value is not present or invalid, + * ignore any exceptions being thrown. + */ + if (oid instanceof OpenJPAId) { + Class type = cls.getDescribedType(); + if (!subs) + // non-polymorphic relations + ((OpenJPAId) oid).setManagedInstanceType(type); + else if (cls.getDiscriminator() != null + && !StringUtils.equals("none", + cls.getDiscriminator().getStrategy().getAlias())) { + // polymorphic relations + res.startDataRequest(cls.getDiscriminator()); + try { + type = cls.getDiscriminator().getClass(store, cls, res); + ((OpenJPAId) oid).setManagedInstanceType(type, true); + } catch (Exception e) { + // intentionally ignored + } + res.endDataRequest(); + } + } return oid; } Modified: openjpa/branches/0.9.7-r547073/openjpa-kernel/src/main/java/org/apache/openjpa/util/OpenJPAId.java URL: http://svn.apache.org/viewvc/openjpa/branches/0.9.7-r547073/openjpa-kernel/src/main/java/org/apache/openjpa/util/OpenJPAId.java?rev=692299&r1=692298&r2=692299&view=diff ============================================================================== --- openjpa/branches/0.9.7-r547073/openjpa-kernel/src/main/java/org/apache/openjpa/util/OpenJPAId.java (original) +++ openjpa/branches/0.9.7-r547073/openjpa-kernel/src/main/java/org/apache/openjpa/util/OpenJPAId.java Thu Sep 4 16:12:27 2008 @@ -78,6 +78,14 @@ } /** + * Set the exact type of the described instance once it is known. + */ + public void setManagedInstanceType(Class type, boolean subs) { + this.type = type; + this.subs = subs; + } + + /** * Return the identity value as an object. */ public abstract Object getIdObject(); From commits-return-3337-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Fri Sep 05 00:04:58 2008 Return-Path: <commits-return-3337-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 80601 invoked from network); 5 Sep 2008 00:04:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Sep 2008 00:04:58 -0000 Received: (qmail 39110 invoked by uid 500); 5 Sep 2008 00:04:56 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 39091 invoked by uid 500); 5 Sep 2008 00:04:56 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 39082 invoked by uid 99); 5 Sep 2008 00:04:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Sep 2008 17:04:56 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Sep 2008 00:04:06 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 0B042238899B; Thu, 4 Sep 2008 17:04:07 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r692307 - in /openjpa/branches/0.9.7-r547073: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ openjpa-kernel/src/main/java/org/apache/openjpa/util/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/a... Date: Fri, 05 Sep 2008 00:04:06 -0000 To: commits@openjpa.apache.org From: ssegu@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080905000407.0B042238899B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ssegu Date: Thu Sep 4 17:04:06 2008 New Revision: 692307 URL: http://svn.apache.org/viewvc?rev=692307&view=rev Log: Merge back 679152 - Fix a bug in which joined classes using an application identity hierarchy couldn't be loaded correctly as an inverse relation. Added: openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/abstractjoinedappid/ - copied from r679152, openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/abstractjoinedappid/ openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/abstractjoinedappid/RelationOwner.java - copied unchanged from r679152, openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/abstractjoinedappid/RelationOwner.java openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/abstractjoinedappid/SubID.java - copied unchanged from r679152, openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/abstractjoinedappid/SubID.java openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/abstractjoinedappid/Subclass.java - copied unchanged from r679152, openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/abstractjoinedappid/Subclass.java openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/abstractjoinedappid/SuperID.java - copied unchanged from r679152, openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/abstractjoinedappid/SuperID.java openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/abstractjoinedappid/Superclass.java - copied unchanged from r679152, openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/abstractjoinedappid/Superclass.java openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/abstractjoinedappid/TestAbstractJoinedAppId.java - copied, changed from r679152, openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/abstractjoinedappid/TestAbstractJoinedAppId.java Modified: openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ClassMapping.java openjpa/branches/0.9.7-r547073/openjpa-kernel/src/main/java/org/apache/openjpa/util/OpenJPAId.java Modified: openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ClassMapping.java URL: http://svn.apache.org/viewvc/openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ClassMapping.java?rev=692307&r1=692306&r2=692307&view=diff ============================================================================== --- openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ClassMapping.java (original) +++ openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ClassMapping.java Thu Sep 4 17:04:06 2008 @@ -189,34 +189,27 @@ return null; } } - Object oid = ApplicationIds.fromPKValues(vals, cls); - - /** - * For polymorphic relations, - * the type field in the oid is initially set to base type. - * If the discriminator value is preset in the current result, - * then the type field needs reset based on the discriminator value. - * If the discriminator value is not present or invalid, - * ignore any exceptions being thrown. - */ + + // the oid data is loaded by the base type, but if discriminator data + // is present, make sure to use it to construct the actual oid instance + // so that we get the correct app id class, etc + ClassMapping dcls = cls; + if (subs) { + res.startDataRequest(cls.getDiscriminator()); + try { + Class dtype = cls.getDiscriminator().getClass(store, cls, res); + if (dtype != cls.getDescribedType()) + dcls = cls.getMappingRepository().getMapping(dtype, + store.getContext().getClassLoader(), true); + } catch (Exception e) { + // intentionally ignored + } + res.endDataRequest(); + } + Object oid = ApplicationIds.fromPKValues(vals, dcls); if (oid instanceof OpenJPAId) { - Class type = cls.getDescribedType(); - if (!subs) - // non-polymorphic relations - ((OpenJPAId) oid).setManagedInstanceType(type); - else if (cls.getDiscriminator() != null - && !StringUtils.equals("none", - cls.getDiscriminator().getStrategy().getAlias())) { - // polymorphic relations - res.startDataRequest(cls.getDiscriminator()); - try { - type = cls.getDiscriminator().getClass(store, cls, res); - ((OpenJPAId) oid).setManagedInstanceType(type, true); - } catch (Exception e) { - // intentionally ignored - } - res.endDataRequest(); - } + ((OpenJPAId) oid).setManagedInstanceType(dcls.getDescribedType(), + subs); } return oid; } Modified: openjpa/branches/0.9.7-r547073/openjpa-kernel/src/main/java/org/apache/openjpa/util/OpenJPAId.java URL: http://svn.apache.org/viewvc/openjpa/branches/0.9.7-r547073/openjpa-kernel/src/main/java/org/apache/openjpa/util/OpenJPAId.java?rev=692307&r1=692306&r2=692307&view=diff ============================================================================== --- openjpa/branches/0.9.7-r547073/openjpa-kernel/src/main/java/org/apache/openjpa/util/OpenJPAId.java (original) +++ openjpa/branches/0.9.7-r547073/openjpa-kernel/src/main/java/org/apache/openjpa/util/OpenJPAId.java Thu Sep 4 17:04:06 2008 @@ -55,7 +55,7 @@ } /** - * Return the persitent class which this id instance represents. + * Return the persistent class which this id instance represents. */ public Class getType() { return type; @@ -73,8 +73,7 @@ * Set the exact type of the described instance once it is known. */ public void setManagedInstanceType(Class type) { - this.type = type; - this.subs = false; + setManagedInstanceType(type, false); } /** Copied: openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/abstractjoinedappid/TestAbstractJoinedAppId.java (from r679152, openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/abstractjoinedappid/TestAbstractJoinedAppId.java) URL: http://svn.apache.org/viewvc/openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/abstractjoinedappid/TestAbstractJoinedAppId.java?p2=openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/abstractjoinedappid/TestAbstractJoinedAppId.java&p1=openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/abstractjoinedappid/TestAbstractJoinedAppId.java&r1=679152&r2=692307&rev=692307&view=diff ============================================================================== --- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/abstractjoinedappid/TestAbstractJoinedAppId.java (original) +++ openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/inheritance/abstractjoinedappid/TestAbstractJoinedAppId.java Thu Sep 4 17:04:06 2008 @@ -33,8 +33,7 @@ extends SingleEMFTestCase { public void setUp() { - setUp(Superclass.class, Subclass.class, RelationOwner.class, - DROP_TABLES); + setUp(Superclass.class, Subclass.class, RelationOwner.class); Subclass s = new Subclass(); s.setId(99); From commits-return-3338-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Fri Sep 05 06:01:10 2008 Return-Path: <commits-return-3338-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 2577 invoked from network); 5 Sep 2008 06:01:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Sep 2008 06:01:10 -0000 Received: (qmail 40678 invoked by uid 500); 5 Sep 2008 06:01:08 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 40667 invoked by uid 500); 5 Sep 2008 06:01:08 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 40658 invoked by uid 99); 5 Sep 2008 06:01:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 04 Sep 2008 23:01:08 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Sep 2008 06:00:18 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 657A8238898F; Thu, 4 Sep 2008 23:00:19 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r692342 - in /openjpa/branches/0.9.7-r547073: openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/pe... Date: Fri, 05 Sep 2008 06:00:19 -0000 To: commits@openjpa.apache.org From: ssegu@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080905060019.657A8238898F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ssegu Date: Thu Sep 4 23:00:18 2008 New Revision: 692342 URL: http://svn.apache.org/viewvc?rev=692342&view=rev Log: Merge back 656796 - Bugfix for multiple insert,delete,query cycles of the same id in the same transaction. Added: openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/ openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/ openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/RuntimeTest1.java openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/ openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestMultipleInsertDeleteSameId.java Modified: openjpa/branches/0.9.7-r547073/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java Modified: openjpa/branches/0.9.7-r547073/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java URL: http://svn.apache.org/viewvc/openjpa/branches/0.9.7-r547073/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java?rev=692342&r1=692341&r2=692342&view=diff ============================================================================== --- openjpa/branches/0.9.7-r547073/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java (original) +++ openjpa/branches/0.9.7-r547073/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java Thu Sep 4 23:00:18 2008 @@ -4382,7 +4382,7 @@ if (sm != null) { // if it's a new instance, we know it's the only match, because // other pers instances override new instances in _cache - if (sm.isNew()) + if (sm.isNew() && !sm.isDeleted()) return (allowNew) ? sm : null; if (!allowNew || !sm.isDeleted()) return sm; Added: openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/RuntimeTest1.java URL: http://svn.apache.org/viewvc/openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/RuntimeTest1.java?rev=692342&view=auto ============================================================================== --- openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/RuntimeTest1.java (added) +++ openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/common/apps/RuntimeTest1.java Thu Sep 4 23:00:18 2008 @@ -0,0 +1,143 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.persistence.common.apps; + +import java.io.*; +import java.math.*; +import java.util.*; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.OneToMany; +import javax.persistence.OneToOne; +import javax.persistence.Table; +import javax.persistence.Transient; + + +/** + * <p>Persitent type used in testing.</p> + * + * @author Abe White + */ +@Entity +@Table(name="rtest1") +@Inheritance(strategy=InheritanceType.SINGLE_TABLE) +public class RuntimeTest1 implements Serializable +{ + + private static final long serialVersionUID = 1L; + + @Transient + public static final String someStaticField = "someField"; + + private Locale localeField; + + @Id + private int intField; + + @Column(length=35) + private String stringField; + + // transactional only + @Column(length=35) + public String transString; + + // relations + //@Transient + @OneToOne(fetch=FetchType.LAZY, cascade={CascadeType.PERSIST, CascadeType.REMOVE}) + private RuntimeTest1 selfOneOne; + + @Transient + private Set selfOneMany = new HashSet (); + + + public RuntimeTest1 () + {} + + public RuntimeTest1(int key) + { + this.intField = key; + } + + public RuntimeTest1 (String str, int i) + { + stringField = str; + intField = i; + } + + public int getIntField () + { + return this.intField; + } + + + public void setIntField (int intField) + { + this.intField = intField; + } + + public String getStringField () + { + return this.stringField; + } + + public void setStringField (String stringField) + { + this.stringField = stringField; + } + + public RuntimeTest1 getSelfOneOne () + { + return this.selfOneOne; + } + + public void setSelfOneOne (RuntimeTest1 selfOneOne) + { + this.selfOneOne = selfOneOne; + } + + public Set getSelfOneMany () + { + return this.selfOneMany; + } + + public void setSelfOneMany (Set selfOneMany) + { + this.selfOneMany = selfOneMany; + } + + public String toString() + { + return "IntField: "+intField+", StringField: "+stringField+" ."; + } + + public Locale getLocaleField() { + return localeField; + } + + public void setLocaleField(Locale localeField) { + this.localeField = localeField; + } +} Added: openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestMultipleInsertDeleteSameId.java URL: http://svn.apache.org/viewvc/openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestMultipleInsertDeleteSameId.java?rev=692342&view=auto ============================================================================== --- openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestMultipleInsertDeleteSameId.java (added) +++ openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/kernel/TestMultipleInsertDeleteSameId.java Thu Sep 4 23:00:18 2008 @@ -0,0 +1,58 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.persistence.kernel; + +import javax.persistence.Query; + +import org.apache.openjpa.persistence.common.apps.RuntimeTest1; +import org.apache.openjpa.persistence.test.SingleEMTestCase; + +public class TestMultipleInsertDeleteSameId + extends SingleEMTestCase { + + public void setUp() { + setUp(RuntimeTest1.class); + } + + public void testMultipleInsertDelete() { + em.getTransaction().begin(); + + RuntimeTest1 o = new RuntimeTest1("one", 99); + em.persist(o); + Query q = em.createQuery("select o from RuntimeTest1 o " + + " where o.stringField = 'one'"); + assertEquals(o, q.getSingleResult()); + + em.remove(o); + assertEquals(0, q.getResultList().size()); + + RuntimeTest1 o2 = new RuntimeTest1("two", 99); + em.persist(o2); + q = em.createQuery("select o from RuntimeTest1 o " + + " where o.stringField = 'two'"); + assertEquals(o2, q.getSingleResult()); + + em.remove(o2); + assertEquals(0, q.getResultList().size()); + + em.getTransaction().commit(); + assertNull(em.find(RuntimeTest1.class, 99)); + em.close(); + } +} From commits-return-3339-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Fri Sep 05 20:25:31 2008 Return-Path: <commits-return-3339-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 29638 invoked from network); 5 Sep 2008 20:25:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Sep 2008 20:25:31 -0000 Received: (qmail 91667 invoked by uid 500); 5 Sep 2008 20:25:29 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 91648 invoked by uid 500); 5 Sep 2008 20:25:29 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 91639 invoked by uid 99); 5 Sep 2008 20:25:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Sep 2008 13:25:29 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Sep 2008 20:24:39 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 99A5D2388852; Fri, 5 Sep 2008 13:24:40 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r692529 - in /openjpa/branches/0.9.7-r547073: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/ openjpa-kernel/src/main/java/org/apache/openjpa/util/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/exception/ ope... Date: Fri, 05 Sep 2008 20:24:40 -0000 To: commits@openjpa.apache.org From: ssegu@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080905202440.99A5D2388852@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ssegu Date: Fri Sep 5 13:24:39 2008 New Revision: 692529 URL: http://svn.apache.org/viewvc?rev=692529&view=rev Log: OPENJPA-462 - Narrow StoreException by SQLException.getSQLState() - Adding SQLState in DerbyDictionary to demonstrate specialization - Adding a Test case to verify correct exception type Added: openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/exception/ - copied from r603032, openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/exception/ openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/exception/PObject.java - copied unchanged from r603032, openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/exception/PObject.java openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/exception/TestException.java - copied unchanged from r603032, openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/exception/TestException.java Modified: openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DerbyDictionary.java openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLExceptions.java openjpa/branches/0.9.7-r547073/openjpa-kernel/src/main/java/org/apache/openjpa/util/ObjectExistsException.java openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/PersistenceTestCase.java openjpa/branches/0.9.7-r547073/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceExceptions.java Modified: openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java URL: http://svn.apache.org/viewvc/openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java?rev=692529&r1=692528&r2=692529&view=diff ============================================================================== --- openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java (original) +++ openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java Fri Sep 5 13:24:39 2008 @@ -94,7 +94,6 @@ import org.apache.openjpa.meta.JavaTypes; import org.apache.openjpa.util.GeneralException; import org.apache.openjpa.util.OpenJPAException; -import org.apache.openjpa.util.ReferentialIntegrityException; import org.apache.openjpa.util.Serialization; import org.apache.openjpa.util.StoreException; import org.apache.openjpa.util.UnsupportedException; @@ -144,6 +143,16 @@ private static final String ZERO_TIMESTAMP_STR = "'" + new Timestamp(0) + "'"; + public static final List EMPTY_STRING_LIST = Arrays.asList(new String[]{}); + public static final List[] SQL_STATE_CODES = + {EMPTY_STRING_LIST, // 0: Default + Arrays.asList(new String[]{"41000"}), // 1: LOCK + EMPTY_STRING_LIST, // 2: OBJECT_NOT_FOUND + EMPTY_STRING_LIST, // 3: OPTIMISTIC + Arrays.asList(new String[]{"23000"}), // 4: REFERENTIAL_INTEGRITY + EMPTY_STRING_LIST // 5: OBJECT_EXISTS + }; + private static final Localizer _loc = Localizer.forPackage (DBDictionary.class); @@ -3778,12 +3787,35 @@ */ public OpenJPAException newStoreException(String msg, SQLException[] causes, Object failed) { - if (causes.length > 0 && "23000".equals(causes[0].getSQLState())) - return new ReferentialIntegrityException(msg). - setFailedObject(failed).setNestedThrowables(causes); + if (causes != null && causes.length > 0) { + OpenJPAException ret = SQLExceptions.narrow(msg, causes[0], this); + ret.setFailedObject(failed).setNestedThrowables(causes); + return ret; + } return new StoreException(msg).setFailedObject(failed). setNestedThrowables(causes); } + + /** + * Gets the list of String, each represents an error that can help + * to narrow down a SQL exception to specific type of StoreException.<br> + * For example, error code <code>"23000"</code> represents referential + * integrity violation and hence can be narrowed down to + * {@link ReferentialIntegrityException} rather than more general + * {@link StoreException}.<br> + * JDBC Drivers are not uniform in return values of SQLState for the same + * error and hence each database specific Dictionary can specialize.<br> + * + * + * @return an <em>unmodifiable</em> list of Strings representing supposedly + * uniform SQL States for a given type of StoreException. + * Default behavior is to return an empty list. + */ + public List/*<String>*/ getSQLStates(int exceptionType) { + if (exceptionType>=0 && exceptionType<SQL_STATE_CODES.length) + return SQL_STATE_CODES[exceptionType]; + return EMPTY_STRING_LIST; + } /** * Closes the specified {@link DataSource} and releases any Modified: openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DerbyDictionary.java URL: http://svn.apache.org/viewvc/openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DerbyDictionary.java?rev=692529&r1=692528&r2=692529&view=diff ============================================================================== --- openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DerbyDictionary.java (original) +++ openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DerbyDictionary.java Fri Sep 5 13:24:39 2008 @@ -20,9 +20,14 @@ import java.sql.DriverManager; import java.sql.SQLException; +import java.util.ArrayList; import java.util.Arrays; +import java.util.List; + import javax.sql.DataSource; +import org.apache.openjpa.util.StoreException; + /** * Dictionary for Apache Derby (formerly Cloudscape). */ @@ -93,4 +98,26 @@ } } } + + /** + * Adds extra SQLState code that Derby JDBC Driver uses. In JDBC 4.0, + * SQLState will follow either XOPEN or SQL 2003 convention. A compliant + * driver can be queries via DatabaseMetaData.getSQLStateType() to detect + * the convention type.<br> + * This method is overwritten to highlight that a) the SQL State is ideally + * uniform across JDBC Drivers but not practically and b) the overwritten + * method must crate a new list to return as the super classes list is + * unmodifable. + */ + public List getSQLStates(int exceptionType) { + List original = super.getSQLStates(exceptionType); + if (exceptionType == StoreException.LOCK) { + // Can not add new codes to unmodifable list of the super class + List newStates = new ArrayList(original); + newStates.add("40XL1"); + return newStates; + } + return original; + } + } Modified: openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLExceptions.java URL: http://svn.apache.org/viewvc/openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLExceptions.java?rev=692529&r1=692528&r2=692529&view=diff ============================================================================== --- openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLExceptions.java (original) +++ openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLExceptions.java Fri Sep 5 13:24:39 2008 @@ -23,7 +23,12 @@ import java.util.List; import org.apache.openjpa.lib.util.Localizer.Message; +import org.apache.openjpa.util.LockException; +import org.apache.openjpa.util.ObjectExistsException; +import org.apache.openjpa.util.ObjectNotFoundException; import org.apache.openjpa.util.OpenJPAException; +import org.apache.openjpa.util.OptimisticException; +import org.apache.openjpa.util.ReferentialIntegrityException; import org.apache.openjpa.util.StoreException; /** @@ -96,7 +101,7 @@ setNestedThrowables(ses); return dict.newStoreException(msg, ses, failed); } - + /** * Returns an array of {@link SQLException} instances for the * specified exception. @@ -112,4 +117,32 @@ } return (SQLException[]) errs.toArray(new SQLException[errs.size()]); } + + /** + * Narrows the given SQLException to a specific type of + * {@link StoreException#getSubtype() StoreException} by analyzing the + * SQLState code supplied by SQLException. Each database-specific + * {@link DBDictionary dictionary} can supply a set of error codes that will + * map to a specific specific type of StoreException via + * {@link DBDictionary#getSQLStates(int) getSQLStates()} method. + * The default behavior is to return generic {@link StoreException + * StoreException}. + */ + public static OpenJPAException narrow(String msg, SQLException se, + DBDictionary dict) { + String e = se.getSQLState(); + if (dict.getSQLStates(StoreException.LOCK).contains(e)) + return new LockException(msg); + else if (dict.getSQLStates(StoreException.OBJECT_EXISTS).contains(e)) + return new ObjectExistsException(msg); + else if (dict.getSQLStates(StoreException.OBJECT_NOT_FOUND).contains(e)) + return new ObjectNotFoundException(msg); + else if (dict.getSQLStates(StoreException.OPTIMISTIC).contains(e)) + return new OptimisticException(msg); + else if (dict.getSQLStates(StoreException.REFERENTIAL_INTEGRITY) + .contains(e)) + return new ReferentialIntegrityException(msg); + else + return new StoreException(msg); + } } Modified: openjpa/branches/0.9.7-r547073/openjpa-kernel/src/main/java/org/apache/openjpa/util/ObjectExistsException.java URL: http://svn.apache.org/viewvc/openjpa/branches/0.9.7-r547073/openjpa-kernel/src/main/java/org/apache/openjpa/util/ObjectExistsException.java?rev=692529&r1=692528&r2=692529&view=diff ============================================================================== --- openjpa/branches/0.9.7-r547073/openjpa-kernel/src/main/java/org/apache/openjpa/util/ObjectExistsException.java (original) +++ openjpa/branches/0.9.7-r547073/openjpa-kernel/src/main/java/org/apache/openjpa/util/ObjectExistsException.java Fri Sep 5 13:24:39 2008 @@ -28,6 +28,10 @@ public class ObjectExistsException extends StoreException { + public ObjectExistsException(String msg) { + super(msg); + } + public ObjectExistsException(Message msg) { super(msg); } Modified: openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/PersistenceTestCase.java URL: http://svn.apache.org/viewvc/openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/PersistenceTestCase.java?rev=692529&r1=692528&r2=692529&view=diff ============================================================================== --- openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/PersistenceTestCase.java (original) +++ openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/test/PersistenceTestCase.java Fri Sep 5 13:24:39 2008 @@ -167,4 +167,13 @@ ClassMetaData meta = OpenJPAPersistence.getMetaData(emf, c); return (meta == null) ? null : meta.getTypeAlias(); } + + public static void assertNotEquals(Object o1, Object o2) { + if (o1 == o2) + fail("expected args to be different; were the same instance."); + else if (o1 == null || o2 == null) + return; + else if (o1.equals(o2)) + fail("expected args to be different; compared equal."); + } } Modified: openjpa/branches/0.9.7-r547073/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceExceptions.java URL: http://svn.apache.org/viewvc/openjpa/branches/0.9.7-r547073/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceExceptions.java?rev=692529&r1=692528&r2=692529&view=diff ============================================================================== --- openjpa/branches/0.9.7-r547073/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceExceptions.java (original) +++ openjpa/branches/0.9.7-r547073/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceExceptions.java Fri Sep 5 13:24:39 2008 @@ -146,6 +146,7 @@ getFailedObject(ke), ke.isFatal()); break; case StoreException.OPTIMISTIC: + case StoreException.LOCK: e = new org.apache.openjpa.persistence.OptimisticLockException (ke.getMessage(), getNestedThrowables(ke), getFailedObject(ke), ke.isFatal()); From commits-return-3340-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Sat Sep 06 01:28:23 2008 Return-Path: <commits-return-3340-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 10321 invoked from network); 6 Sep 2008 01:28:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Sep 2008 01:28:23 -0000 Received: (qmail 53143 invoked by uid 500); 6 Sep 2008 01:28:21 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 53135 invoked by uid 500); 6 Sep 2008 01:28:21 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 53125 invoked by uid 99); 6 Sep 2008 01:28:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Sep 2008 18:28:21 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 Sep 2008 01:27:30 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 03E10238896B; Fri, 5 Sep 2008 18:27:32 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r692601 - in /openjpa/branches/0.9.7-r547073: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/ openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/excepti... Date: Sat, 06 Sep 2008 01:27:31 -0000 To: commits@openjpa.apache.org From: ssegu@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080906012732.03E10238896B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ssegu Date: Fri Sep 5 18:27:31 2008 New Revision: 692601 URL: http://svn.apache.org/viewvc?rev=692601&view=rev Log: OPENJPA-458: Amplified SQL Exception processing. Introduced a new sql-error-state-codes.xml to specify database specific error code for different types of Store exceptions. This helps to narrow SQL exception to a specific errors which bubble up to user application. Added: openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java - copied, changed from r668814, openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/sql-error-state-codes.xml - copied unchanged from r668814, openjpa/trunk/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/sql-error-state-codes.xml Modified: openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DerbyDictionary.java openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLExceptions.java openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/exception/PObject.java openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/exception/TestException.java openjpa/branches/0.9.7-r547073/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceExceptions.java Modified: openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java URL: http://svn.apache.org/viewvc/openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java?rev=692601&r1=692600&r2=692601&view=diff ============================================================================== --- openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java (original) +++ openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DBDictionary.java Fri Sep 5 18:27:31 2008 @@ -51,6 +51,7 @@ import java.util.Collection; import java.util.Collections; import java.util.Date; +import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.LinkedHashSet; @@ -93,7 +94,12 @@ import org.apache.openjpa.meta.FieldMetaData; import org.apache.openjpa.meta.JavaTypes; import org.apache.openjpa.util.GeneralException; +import org.apache.openjpa.util.LockException; +import org.apache.openjpa.util.ObjectExistsException; +import org.apache.openjpa.util.ObjectNotFoundException; import org.apache.openjpa.util.OpenJPAException; +import org.apache.openjpa.util.OptimisticException; +import org.apache.openjpa.util.ReferentialIntegrityException; import org.apache.openjpa.util.Serialization; import org.apache.openjpa.util.StoreException; import org.apache.openjpa.util.UnsupportedException; @@ -143,16 +149,6 @@ private static final String ZERO_TIMESTAMP_STR = "'" + new Timestamp(0) + "'"; - public static final List EMPTY_STRING_LIST = Arrays.asList(new String[]{}); - public static final List[] SQL_STATE_CODES = - {EMPTY_STRING_LIST, // 0: Default - Arrays.asList(new String[]{"41000"}), // 1: LOCK - EMPTY_STRING_LIST, // 2: OBJECT_NOT_FOUND - EMPTY_STRING_LIST, // 3: OPTIMISTIC - Arrays.asList(new String[]{"23000"}), // 4: REFERENTIAL_INTEGRITY - EMPTY_STRING_LIST // 5: OBJECT_EXISTS - }; - private static final Localizer _loc = Localizer.forPackage (DBDictionary.class); @@ -323,6 +319,8 @@ private Method _setString = null; private Method _setCharStream = null; + public final Map sqlStateCodes = new HashMap(); + public DBDictionary() { fixedSizeTypeNameSet.addAll(Arrays.asList(new String[]{ "BIGINT", "BIT", "BLOB", "CLOB", "DATE", "DECIMAL", "DISTINCT", @@ -3727,8 +3725,32 @@ // if user has unset sequence sql, null it out so we know sequences // aren't supported nextSequenceQuery = StringUtils.trimToNull(nextSequenceQuery); - } + // initialize the error codes + SQLErrorCodeReader codeReader = new SQLErrorCodeReader(); + String rsrc = "sql-error-state-codes.xml"; + InputStream stream = getClass().getResourceAsStream(rsrc); + String dictionaryClassName = getClass().getName(); + if (stream == null) { // User supplied dictionary but no error codes xml + stream = DBDictionary.class.getResourceAsStream(rsrc); // use default + dictionaryClassName = getClass().getSuperclass().getName(); + } + codeReader.parse(stream, dictionaryClassName, this); + } + + public void addErrorCode(Integer errorType, String errorCode) { + if (errorCode == null || errorCode.trim().length() == 0) + return; + Set codes = (Set) sqlStateCodes.get(errorType); + if (codes == null) { + codes = new HashSet(); + codes.add(errorCode.trim()); + sqlStateCodes.put(errorType, codes); + } else { + codes.add(errorCode.trim()); + } + } + ////////////////////////////////////// // ConnectionDecorator implementation ////////////////////////////////////// @@ -3737,7 +3759,7 @@ * Decorate the given connection if needed. Some databases require special * handling for JDBC bugs. This implementation issues any * {@link #initializationSQL} that has been set for the dictionary but - * does not decoreate the connection. + * does not decorate the connection. */ public Connection decorate(Connection conn) throws SQLException { @@ -3788,7 +3810,7 @@ public OpenJPAException newStoreException(String msg, SQLException[] causes, Object failed) { if (causes != null && causes.length > 0) { - OpenJPAException ret = SQLExceptions.narrow(msg, causes[0], this); + OpenJPAException ret = narrow(msg, causes[0]); ret.setFailedObject(failed).setNestedThrowables(causes); return ret; } @@ -3797,24 +3819,35 @@ } /** - * Gets the list of String, each represents an error that can help - * to narrow down a SQL exception to specific type of StoreException.<br> - * For example, error code <code>"23000"</code> represents referential - * integrity violation and hence can be narrowed down to - * {@link ReferentialIntegrityException} rather than more general - * {@link StoreException}.<br> - * JDBC Drivers are not uniform in return values of SQLState for the same - * error and hence each database specific Dictionary can specialize.<br> - * - * - * @return an <em>unmodifiable</em> list of Strings representing supposedly - * uniform SQL States for a given type of StoreException. - * Default behavior is to return an empty list. - */ - public List/*<String>*/ getSQLStates(int exceptionType) { - if (exceptionType>=0 && exceptionType<SQL_STATE_CODES.length) - return SQL_STATE_CODES[exceptionType]; - return EMPTY_STRING_LIST; + * Gets the subtype of StoreException by matching the given SQLException's + * error state code to the list of error codes supplied by the dictionary. + * Returns -1 if no matching code can be found. + */ + OpenJPAException narrow(String msg, SQLException ex) { + String errorState = ex.getSQLState(); + int errorType = StoreException.GENERAL; + for (Iterator iter = sqlStateCodes.keySet().iterator(); iter.hasNext(); ) { + Integer type = (Integer) iter.next(); + Set erroStates = (Set) sqlStateCodes.get(type); + if (erroStates != null && erroStates.contains(errorState)) { + errorType = type.intValue(); + break; + } + } + switch (errorType) { + case StoreException.LOCK: + return new LockException(msg); + case StoreException.OBJECT_EXISTS: + return new ObjectExistsException(msg); + case StoreException.OBJECT_NOT_FOUND: + return new ObjectNotFoundException(msg); + case StoreException.OPTIMISTIC: + return new OptimisticException(msg); + case StoreException.REFERENTIAL_INTEGRITY: + return new ReferentialIntegrityException(msg); + default: + return new StoreException(msg); + } } /** Modified: openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DerbyDictionary.java URL: http://svn.apache.org/viewvc/openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DerbyDictionary.java?rev=692601&r1=692600&r2=692601&view=diff ============================================================================== --- openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DerbyDictionary.java (original) +++ openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/DerbyDictionary.java Fri Sep 5 18:27:31 2008 @@ -98,26 +98,4 @@ } } } - - /** - * Adds extra SQLState code that Derby JDBC Driver uses. In JDBC 4.0, - * SQLState will follow either XOPEN or SQL 2003 convention. A compliant - * driver can be queries via DatabaseMetaData.getSQLStateType() to detect - * the convention type.<br> - * This method is overwritten to highlight that a) the SQL State is ideally - * uniform across JDBC Drivers but not practically and b) the overwritten - * method must crate a new list to return as the super classes list is - * unmodifable. - */ - public List getSQLStates(int exceptionType) { - List original = super.getSQLStates(exceptionType); - if (exceptionType == StoreException.LOCK) { - // Can not add new codes to unmodifable list of the super class - List newStates = new ArrayList(original); - newStates.add("40XL1"); - return newStates; - } - return original; - } - } Copied: openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java (from r668814, openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java) URL: http://svn.apache.org/viewvc/openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java?p2=openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java&p1=openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java&r1=668814&r2=692601&rev=692601&view=diff ============================================================================== --- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java (original) +++ openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java Fri Sep 5 18:27:31 2008 @@ -1,3 +1,21 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ package org.apache.openjpa.jdbc.sql; import java.io.IOException; @@ -32,24 +50,25 @@ public class SQLErrorCodeReader { private Log log = null; public static final String ERROR_CODE_DELIMITER = ","; - public static final Map<String, Integer> storeErrorTypes = - new HashMap<String, Integer>(); + public static final Map storeErrorTypes = new HashMap(); static { - storeErrorTypes.put("lock", StoreException.LOCK); - storeErrorTypes.put("object-exists", StoreException.OBJECT_EXISTS); - storeErrorTypes - .put("object-not-found", StoreException.OBJECT_NOT_FOUND); - storeErrorTypes.put("optimistic", StoreException.OPTIMISTIC); + storeErrorTypes.put("lock", new Integer(StoreException.LOCK)); + storeErrorTypes.put("object-exists", + new Integer(StoreException.OBJECT_EXISTS)); + storeErrorTypes.put("object-not-found", + new Integer(StoreException.OBJECT_NOT_FOUND)); + storeErrorTypes.put("optimistic", + new Integer(StoreException.OPTIMISTIC)); storeErrorTypes.put("referential-integrity", - StoreException.REFERENTIAL_INTEGRITY); + new Integer(StoreException.REFERENTIAL_INTEGRITY)); } private static final Localizer _loc = Localizer.forPackage(SQLErrorCodeReader.class); - public List<String> getDictionaries(InputStream in) { - List<String> result = new ArrayList<String>(); + public List getDictionaries(InputStream in) { + List result = new ArrayList(); DocumentBuilder builder = XMLFactory.getDOMParser(false, false); try { Document doc = builder.parse(in); @@ -124,9 +143,10 @@ String errorCodes = child.getTextContent(); if (!StringUtils.isEmpty(errorCodes)) { String[] codes = errorCodes.split(ERROR_CODE_DELIMITER); - for (String code : codes) { - dict.addErrorCode(storeErrorTypes.get(errorType), - code.trim()); + for (int k = 0; k < codes.length; k++ ) { + dict.addErrorCode( + (Integer) storeErrorTypes.get(errorType), + codes[k].trim()); } } } Modified: openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLExceptions.java URL: http://svn.apache.org/viewvc/openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLExceptions.java?rev=692601&r1=692600&r2=692601&view=diff ============================================================================== --- openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLExceptions.java (original) +++ openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLExceptions.java Fri Sep 5 18:27:31 2008 @@ -117,32 +117,4 @@ } return (SQLException[]) errs.toArray(new SQLException[errs.size()]); } - - /** - * Narrows the given SQLException to a specific type of - * {@link StoreException#getSubtype() StoreException} by analyzing the - * SQLState code supplied by SQLException. Each database-specific - * {@link DBDictionary dictionary} can supply a set of error codes that will - * map to a specific specific type of StoreException via - * {@link DBDictionary#getSQLStates(int) getSQLStates()} method. - * The default behavior is to return generic {@link StoreException - * StoreException}. - */ - public static OpenJPAException narrow(String msg, SQLException se, - DBDictionary dict) { - String e = se.getSQLState(); - if (dict.getSQLStates(StoreException.LOCK).contains(e)) - return new LockException(msg); - else if (dict.getSQLStates(StoreException.OBJECT_EXISTS).contains(e)) - return new ObjectExistsException(msg); - else if (dict.getSQLStates(StoreException.OBJECT_NOT_FOUND).contains(e)) - return new ObjectNotFoundException(msg); - else if (dict.getSQLStates(StoreException.OPTIMISTIC).contains(e)) - return new OptimisticException(msg); - else if (dict.getSQLStates(StoreException.REFERENTIAL_INTEGRITY) - .contains(e)) - return new ReferentialIntegrityException(msg); - else - return new StoreException(msg); - } } Modified: openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/exception/PObject.java URL: http://svn.apache.org/viewvc/openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/exception/PObject.java?rev=692601&r1=692600&r2=692601&view=diff ============================================================================== --- openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/exception/PObject.java (original) +++ openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/exception/PObject.java Fri Sep 5 18:27:31 2008 @@ -33,7 +33,6 @@ @Entity public class PObject { @Id - @GeneratedValue private long id; private String name; @Version @@ -47,6 +46,10 @@ this.name = name; } + public void setId(long id) { + this.id = id; + } + public long getId() { return id; } Modified: openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/exception/TestException.java URL: http://svn.apache.org/viewvc/openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/exception/TestException.java?rev=692601&r1=692600&r2=692601&view=diff ============================================================================== --- openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/exception/TestException.java (original) +++ openjpa/branches/0.9.7-r547073/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/exception/TestException.java Fri Sep 5 18:27:31 2008 @@ -18,17 +18,32 @@ */ package org.apache.openjpa.persistence.exception; +import java.io.InputStream; import java.sql.SQLException; +import java.util.List; +import javax.persistence.EntityExistsException; import javax.persistence.EntityManager; +import javax.persistence.EntityNotFoundException; import javax.persistence.OptimisticLockException; +import javax.persistence.TransactionRequiredException; + +import org.apache.openjpa.jdbc.sql.DBDictionary; +import org.apache.openjpa.jdbc.sql.SQLErrorCodeReader; import org.apache.openjpa.persistence.test.SingleEMFTestCase; /** * Tests proper JPA exceptions are raised by the implementation. + * Actual runtime type of the raised exception is a subclass of JPA-defined + * exception. + * The raised exception may nest the expected exception. + * + * @author Pinaki Poddar */ public class TestException extends SingleEMFTestCase { - public void setUp() { + private static long ID_COUNTER = System.currentTimeMillis(); + + public void setUp() { super.setUp(PObject.class); } @@ -36,16 +51,17 @@ * Tests that when Optimistic transaction consistency is violated, the * exception thrown is an instance of javax.persistence.OptimisticException. */ - public void testThrowsJPADefinedOptimisticException() { + public void testThrowsOptimisticException() { EntityManager em1 = emf.createEntityManager(); EntityManager em2 = emf.createEntityManager(); assertNotEquals(em1, em2); em1.getTransaction().begin(); PObject pc = new PObject(); + long id = ++ID_COUNTER; + pc.setId(id); em1.persist(pc); em1.getTransaction().commit(); - Object id = pc.getId(); em1.clear(); em1.getTransaction().begin(); @@ -61,47 +77,121 @@ try { pc2.setName("Modified in TXN2"); em2.flush(); - fail("Expected optimistic exception on flush"); + fail("Expected " + OptimisticLockException.class); } catch (Throwable t) { - if (!isExpectedException(t, OptimisticLockException.class)) { - print(t); - fail(t.getCause().getClass() + " is not " + - OptimisticLockException.class); - } + assertException(t, OptimisticLockException.class); } em1.getTransaction().commit(); try { em2.getTransaction().commit(); - fail("Expected optimistic exception on commit"); + fail("Expected " + OptimisticLockException.class); + } catch (Throwable t) { + assertException(t, OptimisticLockException.class); + } + } + + public void testThrowsEntityExistsException() { + EntityManager em = emf.createEntityManager(); + + em.getTransaction().begin(); + PObject pc = new PObject(); + long id = ++ID_COUNTER; + pc.setId(id); + em.persist(pc); + em.getTransaction().commit(); + em.clear(); + + em.getTransaction().begin(); + PObject pc2 = new PObject(); + pc2.setId(id); + em.persist(pc2); + try { + em.getTransaction().commit(); + fail("Expected " + EntityExistsException.class); + } catch (Throwable t) { + assertException(t, EntityExistsException.class); + } + } + + public void testThrowsEntityNotFoundException() { + EntityManager em = emf.createEntityManager(); + + em.getTransaction().begin(); + PObject pc = new PObject(); + long id = ++ID_COUNTER; + pc.setId(id); + em.persist(pc); + em.getTransaction().commit(); + + EntityManager em2 = emf.createEntityManager(); + em2.getTransaction().begin(); + PObject pc2 = em2.find(PObject.class, id); + assertNotNull(pc2); + em2.remove(pc2); + em2.getTransaction().commit(); + + try { + em.refresh(pc); + fail("Expected " + EntityNotFoundException.class); } catch (Throwable t) { - if (!isExpectedException(t, OptimisticLockException.class)) { - print(t); - fail(t.getCause().getClass() + " is not " + - OptimisticLockException.class); + assertException(t, EntityNotFoundException.class); + } + } + + public void testErrorCodeConfigurationHasAllKnownDictionaries() { + SQLErrorCodeReader reader = new SQLErrorCodeReader(); + InputStream in = DBDictionary.class.getResourceAsStream + ("sql-error-state-codes.xml"); + assertNotNull(in); + List<String> names = reader.getDictionaries(in); + assertTrue(names.size()>=18); + for (String name:names) { + try { + Class.forName(name, false, Thread.currentThread() + .getContextClassLoader()); + } catch (Throwable t) { + fail("DB dictionary " + name + " can not be loaded"); + t.printStackTrace(); } } } + /** + * Asserts that the given expected type of the exception is equal to or a + * subclass of the given throwable or any of its nested exception. + * Otherwise fails assertion and prints the given throwable and its nested + * exception on the console. + */ + void assertException(Throwable t, Class expectedType) { + if (!isExpectedException(t, expectedType)) { + t.printStackTrace(); + print(t, 0); + fail(t + " or its cause is not instanceof " + expectedType); + } + } + + /** + * Affirms if the given expected type of the exception is equal to or a + * subclass of the given throwable or any of its nested exception. + */ boolean isExpectedException(Throwable t, Class expectedType) { - if (t == null) return false; + if (t == null) + return false; if (expectedType.isAssignableFrom(t.getClass())) return true; - if (t.getCause()==t) return false; return isExpectedException(t.getCause(), expectedType); } - void print(Throwable t) { - print(t, 0); - } - void print(Throwable t, int tab) { if (t == null) return; for (int i=0; i<tab*4;i++) System.out.print(" "); String sqlState = (t instanceof SQLException) ? - "(SQLState=" + ((SQLException)t).getSQLState() + ":" + t.getMessage() + ")":""; + "(SQLState=" + ((SQLException)t).getSQLState() + ":" + + t.getMessage() + ")" : ""; System.out.println(t.getClass().getName() + sqlState); - if (t.getCause()==t) return; + if (t.getCause() == t) + return; print(t.getCause(), tab+1); } } Modified: openjpa/branches/0.9.7-r547073/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceExceptions.java URL: http://svn.apache.org/viewvc/openjpa/branches/0.9.7-r547073/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceExceptions.java?rev=692601&r1=692600&r2=692601&view=diff ============================================================================== --- openjpa/branches/0.9.7-r547073/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceExceptions.java (original) +++ openjpa/branches/0.9.7-r547073/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PersistenceExceptions.java Fri Sep 5 18:27:31 2008 @@ -22,7 +22,10 @@ import org.apache.openjpa.kernel.Broker; import org.apache.openjpa.util.Exceptions; +import org.apache.openjpa.util.ObjectExistsException; +import org.apache.openjpa.util.ObjectNotFoundException; import org.apache.openjpa.util.OpenJPAException; +import org.apache.openjpa.util.OptimisticException; import org.apache.openjpa.util.RuntimeExceptionTranslator; import org.apache.openjpa.util.StoreException; import org.apache.openjpa.util.UserException; @@ -64,7 +67,7 @@ try { throwing = true; if (em.isOpen() && em.isActive()) - em.setRollbackOnly(re); + em.setRollbackOnly(ex); } finally { // handle re-entrancy throwing = false; @@ -139,24 +142,26 @@ */ private static Throwable translateStoreException(OpenJPAException ke) { Exception e; - switch (ke.getSubtype()) { - case StoreException.OBJECT_NOT_FOUND: + Throwable cause = (ke.getNestedThrowables() != null + && ke.getNestedThrowables().length == 1) + ? ke.getNestedThrowables()[0] : null; + if (ke.getSubtype() == StoreException.OBJECT_NOT_FOUND + || cause instanceof ObjectNotFoundException) { e = new org.apache.openjpa.persistence.EntityNotFoundException (ke.getMessage(), getNestedThrowables(ke), getFailedObject(ke), ke.isFatal()); - break; - case StoreException.OPTIMISTIC: - case StoreException.LOCK: - e = new org.apache.openjpa.persistence.OptimisticLockException + } else if (ke.getSubtype() == StoreException.OPTIMISTIC + || ke.getSubtype() == StoreException.LOCK + || cause instanceof OptimisticException) { + e = new org.apache.openjpa.persistence.OptimisticLockException (ke.getMessage(), getNestedThrowables(ke), getFailedObject(ke), ke.isFatal()); - break; - case StoreException.OBJECT_EXISTS: + } else if (ke.getSubtype() == StoreException.OBJECT_EXISTS + || cause instanceof ObjectExistsException) { e = new org.apache.openjpa.persistence.EntityExistsException (ke.getMessage(), getNestedThrowables(ke), getFailedObject(ke), ke.isFatal()); - break; - default: + } else { e = new org.apache.openjpa.persistence.PersistenceException (ke.getMessage(), getNestedThrowables(ke), getFailedObject(ke), ke.isFatal()); From commits-return-3341-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Sat Sep 06 03:48:02 2008 Return-Path: <commits-return-3341-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 99618 invoked from network); 6 Sep 2008 03:48:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 6 Sep 2008 03:48:02 -0000 Received: (qmail 38908 invoked by uid 500); 6 Sep 2008 03:48:00 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 38893 invoked by uid 500); 6 Sep 2008 03:48:00 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 38884 invoked by uid 99); 6 Sep 2008 03:48:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 Sep 2008 20:48:00 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 Sep 2008 03:47:10 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 6CBCE238896C; Fri, 5 Sep 2008 20:47:41 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r692609 - in /openjpa/trunk: openjpa-kernel/src/main/jjtree/org/apache/openjpa/kernel/jpql/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persiste... Date: Sat, 06 Sep 2008 03:47:41 -0000 To: commits@openjpa.apache.org From: fancy@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080906034741.6CBCE238896C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: fancy Date: Fri Sep 5 20:47:40 2008 New Revision: 692609 URL: http://svn.apache.org/viewvc?rev=692609&view=rev Log: OPENJPA-712 Not correctly parsing the "having" clause with aggregate functions (ie. max, min, etc) Committing patch provided by Fay Wang Modified: openjpa/trunk/openjpa-kernel/src/main/jjtree/org/apache/openjpa/kernel/jpql/JPQL.jjt openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestMultipleEntityProjection.java openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/domain/Magazine.java Modified: openjpa/trunk/openjpa-kernel/src/main/jjtree/org/apache/openjpa/kernel/jpql/JPQL.jjt URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/jjtree/org/apache/openjpa/kernel/jpql/JPQL.jjt?rev=692609&r1=692608&r2=692609&view=diff ============================================================================== --- openjpa/trunk/openjpa-kernel/src/main/jjtree/org/apache/openjpa/kernel/jpql/JPQL.jjt (original) +++ openjpa/trunk/openjpa-kernel/src/main/jjtree/org/apache/openjpa/kernel/jpql/JPQL.jjt Fri Sep 5 20:47:40 2008 @@ -729,7 +729,7 @@ void null_comparison_expression() #ISNULL : { } { - (input_parameter() | path()) + (input_parameter() | path() | aggregate_select_expression()) <IS> [<NOT> { jjtThis.not = true; }] <NULL> } @@ -931,7 +931,7 @@ void datetime_primary() : { } { - path() | functions_returning_datetime() | input_parameter() + path() | functions_returning_datetime() | input_parameter() | aggregate_select_expression() } Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestMultipleEntityProjection.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestMultipleEntityProjection.java?rev=692609&r1=692608&r2=692609&view=diff ============================================================================== --- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestMultipleEntityProjection.java (original) +++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestMultipleEntityProjection.java Fri Sep 5 20:47:40 2008 @@ -18,6 +18,11 @@ */ package org.apache.openjpa.persistence.jdbc.query; +import java.sql.Timestamp; +import java.text.DateFormat; +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Date; import java.util.List; import javax.persistence.EntityManager; @@ -72,6 +77,15 @@ Publisher pub = new Publisher(); pub.setName(pubName); mag.setPublisher(pub); + try { + DateFormat df = new SimpleDateFormat ("yyyy-MM-dd"); + Date date = df.parse("2001-01-01"); + mag.setDatePublished(date); + } catch (ParseException e) { + mag.setDatePublished(null); + } + mag.setTsPublished(new Timestamp(System.currentTimeMillis())); + em.persist(pub); } em.persist(mag); @@ -134,6 +148,24 @@ } } + public void testAggregateExpressionInHavingExpression() { + String jpql = "select m.publisher, max(m.datePublished) " + + "from Magazine m group by m.publisher " + + "having max(m.datePublished) is null"; + + EntityManager em = emf.createEntityManager(); + Query query = em.createQuery(jpql); + List result = query.getResultList(); + assertTrue(result.isEmpty()); + + jpql = "select m.publisher, max(m.datePublished) " + + "from Magazine m group by m.publisher " + + "having max(m.tsPublished) = CURRENT_TIMESTAMP"; + query = em.createQuery(jpql); + result = query.getResultList(); + assertTrue(result.isEmpty()); + } + /** * Count number of expected result based on inner/outer join condition and * the name of the Magazine. Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/domain/Magazine.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/domain/Magazine.java?rev=692609&r1=692608&r2=692609&view=diff ============================================================================== --- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/domain/Magazine.java (original) +++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/domain/Magazine.java Fri Sep 5 20:47:40 2008 @@ -18,6 +18,9 @@ */ package org.apache.openjpa.persistence.jdbc.query.domain; +import java.sql.Timestamp; +import java.util.Date; + import javax.persistence.*; /** @@ -38,6 +41,10 @@ @OneToOne private Publisher publisher; + private Date datePublished; + + private Timestamp tsPublished; + public String getName() { return name; } @@ -58,4 +65,20 @@ this.publisher = publisher; } + public Date getDatePublished() { + return datePublished; + } + + public void setDatePublished(Date datePublished) { + this.datePublished = datePublished; + } + + public Date getTsPublished() { + return tsPublished; + } + + public void setTsPublished(Timestamp tsPublished) { + this.tsPublished = tsPublished; + } + } From commits-return-3342-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Mon Sep 08 16:55:15 2008 Return-Path: <commits-return-3342-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 31850 invoked from network); 8 Sep 2008 16:55:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Sep 2008 16:55:15 -0000 Received: (qmail 90325 invoked by uid 500); 8 Sep 2008 16:55:13 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 90299 invoked by uid 500); 8 Sep 2008 16:55:12 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 90290 invoked by uid 99); 8 Sep 2008 16:55:12 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Sep 2008 09:55:12 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Sep 2008 16:54:22 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 706062388986; Mon, 8 Sep 2008 09:54:24 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r693162 - in /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats: ColumnVersionStrategy.java MultiColumnVersionStrategy.java Date: Mon, 08 Sep 2008 16:54:23 -0000 To: commits@openjpa.apache.org From: ppoddar@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080908165424.706062388986@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ppoddar Date: Mon Sep 8 09:54:21 2008 New Revision: 693162 URL: http://svn.apache.org/viewvc?rev=693162&view=rev Log: OPENJPA-697: Join if version column is in secondary table Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/ColumnVersionStrategy.java openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/MultiColumnVersionStrategy.java Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/ColumnVersionStrategy.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/ColumnVersionStrategy.java?rev=693162&r1=693161&r2=693162&view=diff ============================================================================== --- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/ColumnVersionStrategy.java (original) +++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/ColumnVersionStrategy.java Mon Sep 8 09:54:21 2008 @@ -22,16 +22,14 @@ import java.math.BigDecimal; import java.sql.SQLException; import java.util.Comparator; -import java.util.HashSet; -import java.util.Set; import org.apache.openjpa.jdbc.kernel.JDBCStore; import org.apache.openjpa.jdbc.meta.ClassMapping; import org.apache.openjpa.jdbc.meta.VersionMappingInfo; import org.apache.openjpa.jdbc.schema.Column; import org.apache.openjpa.jdbc.schema.ColumnIO; +import org.apache.openjpa.jdbc.schema.ForeignKey; import org.apache.openjpa.jdbc.schema.Index; -import org.apache.openjpa.jdbc.schema.Table; import org.apache.openjpa.jdbc.sql.Result; import org.apache.openjpa.jdbc.sql.Row; import org.apache.openjpa.jdbc.sql.RowManager; @@ -43,10 +41,8 @@ import org.apache.openjpa.util.InternalException; import org.apache.openjpa.util.MetaDataException; -import serp.util.Numbers; - /** - * Uses a single column and corresponding version object. + * Uses a one or more column(s) and corresponding version object. * * @author Marc Prud'hommeaux * @author Pinaki Poddar @@ -111,12 +107,15 @@ /** * Compare each element of the given arrays that must be of equal size. + * The given array values represent version values and the result designate + * whether first version is earlier, same or later than the second one. * * @return If any element of a1 is later than corresponding element of - * a2 then return 1 i.e. a1 as a whole is later than a2. - * If each element of a1 is to equal corresponding element of a2 then return - * 0 i.e. a1 is as a whole equals to a2. - * else return a negative number i.e. a1 is earlier than a2. + * a2 then returns 1 i.e. the first version is later than the second version. + * If each element of a1 is equal to corresponding element of a2 then return + * 0 i.e. the first version is same as the second version. + * else return a negative number i.e. the first version is earlier than + * the second version. */ protected int compare(Object[] a1, Object[] a2) { if (a1.length != a2.length) @@ -131,10 +130,6 @@ return total; } - int sign(int i) { - return (i > 0) ? 1 : (i == 0) ? 0 : -1; - } - public void map(boolean adapt) { ClassMapping cls = vers.getClassMapping(); if (cls.getJoinablePCSuperclassMapping() != null @@ -208,8 +203,15 @@ for (int i = 0; i < cols.length; i++) { Row row = rm.getRow(cols[i].getTable(), Row.ACTION_UPDATE, sm, true); row.setFailedObject(sm.getManagedInstance()); - if (curVersion != null && sm.isVersionCheckRequired()) + if (curVersion != null && sm.isVersionCheckRequired()) { row.whereObject(cols[i], getColumnValue(curVersion, i)); + if (isSecondaryColumn(cols[i], sm)) { + ForeignKey[] fks = cols[i].getTable().getForeignKeys(); + for (ForeignKey fk : fks) { + row.whereForeignKey(fk, sm); + } + } + } if (vers.getColumnIO().isUpdatable(i, nextVersion == null)) row.setObject(cols[i], getColumnValue(nextVersion, i)); } @@ -230,8 +232,15 @@ row.setFailedObject(sm.getManagedInstance()); cur = getColumnValue(curVersion, i); // set where and update conditions on row - if (cur != null) + if (cur != null) { row.whereObject(cols[i], cur); + if (isSecondaryColumn(cols[i], sm)) { + ForeignKey[] fks = cols[i].getTable().getForeignKeys(); + for (ForeignKey fk : fks) { + row.whereForeignKey(fk, sm); + } + } + } } } @@ -321,4 +330,15 @@ return Array.get(o, idx); return o; } + + boolean isSecondaryColumn(Column col, OpenJPAStateManager sm) { + ClassMapping mapping = (ClassMapping)sm.getMetaData(); + while (mapping != null) { + if (mapping.getTable() == col.getTable()) + return false; + else + mapping = mapping.getPCSuperclassMapping(); + } + return true; + } } Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/MultiColumnVersionStrategy.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/MultiColumnVersionStrategy.java?rev=693162&r1=693161&r2=693162&view=diff ============================================================================== --- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/MultiColumnVersionStrategy.java (original) +++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/MultiColumnVersionStrategy.java Mon Sep 8 09:54:21 2008 @@ -18,9 +18,6 @@ */ package org.apache.openjpa.jdbc.meta.strats; -import java.util.Arrays; -import java.util.List; - import org.apache.commons.lang.StringUtils; import org.apache.openjpa.jdbc.schema.Column; import org.apache.openjpa.jdbc.schema.Schemas; From commits-return-3343-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Mon Sep 08 20:12:27 2008 Return-Path: <commits-return-3343-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 78961 invoked from network); 8 Sep 2008 20:12:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Sep 2008 20:12:27 -0000 Received: (qmail 8471 invoked by uid 500); 8 Sep 2008 20:12:25 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 8456 invoked by uid 500); 8 Sep 2008 20:12:25 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 8447 invoked by uid 99); 8 Sep 2008 20:12:25 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Sep 2008 13:12:25 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Sep 2008 20:11:35 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 926EC23889BA; Mon, 8 Sep 2008 13:11:36 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r693233 - /openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/TemporaryClassLoader.java Date: Mon, 08 Sep 2008 20:11:36 -0000 To: commits@openjpa.apache.org From: kwsutter@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080908201136.926EC23889BA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: kwsutter Date: Mon Sep 8 13:11:35 2008 New Revision: 693233 URL: http://svn.apache.org/viewvc?rev=693233&view=rev Log: OPENJPA-646. Migrate this change from the 1.2.x branch to trunk. Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/TemporaryClassLoader.java Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/TemporaryClassLoader.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/TemporaryClassLoader.java?rev=693233&r1=693232&r2=693233&view=diff ============================================================================== --- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/TemporaryClassLoader.java (original) +++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/util/TemporaryClassLoader.java Mon Sep 8 13:11:35 2008 @@ -70,7 +70,10 @@ bout.write(b, 0, n)) ; byte[] classBytes = bout.toByteArray(); - if (isAnnotation(classBytes)) + // To avoid classloader issues with the JVM (Sun and IBM), we + // will not load Enums via the TemporaryClassLoader either. + // Reference JIRA Issue OPENJPA-646 for more information. + if (isAnnotation(classBytes) || isEnum(classBytes)) return Class.forName(name, resolve, getClass(). getClassLoader()); @@ -97,4 +100,16 @@ int access = ConstantPoolTable.readUnsignedShort(b, idx); return (access & 0x2000) != 0; // access constant for annotation type } + + /** + * Fast-parse the given class bytecode to determine if it is an + * enum class. + */ + private static boolean isEnum(byte[] b) { + if (JavaVersions.VERSION < 5) + return false; + int idx = ConstantPoolTable.getEndIndex(b); + int access = ConstantPoolTable.readUnsignedShort(b, idx); + return (access & 0x4000) != 0; // access constant for enum type + } } From commits-return-3344-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Mon Sep 08 21:20:17 2008 Return-Path: <commits-return-3344-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 16585 invoked from network); 8 Sep 2008 21:20:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Sep 2008 21:20:17 -0000 Received: (qmail 96565 invoked by uid 500); 8 Sep 2008 21:20:15 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 96550 invoked by uid 500); 8 Sep 2008 21:20:15 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 96541 invoked by uid 99); 8 Sep 2008 21:20:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Sep 2008 14:20:15 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Sep 2008 21:19:25 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id B08842388986; Mon, 8 Sep 2008 14:19:56 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r693275 - /openjpa/trunk/openjpa-project/pom.xml Date: Mon, 08 Sep 2008 21:19:56 -0000 To: commits@openjpa.apache.org From: mikedd@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080908211956.B08842388986@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mikedd Date: Mon Sep 8 14:19:55 2008 New Revision: 693275 URL: http://svn.apache.org/viewvc?rev=693275&view=rev Log: OPENJPA-695 adding a profile that uploads the latest zip files, manual and javadoc to openjpa.apache.org/builds/latest. Modified: openjpa/trunk/openjpa-project/pom.xml Modified: openjpa/trunk/openjpa-project/pom.xml URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/pom.xml?rev=693275&r1=693274&r2=693275&view=diff ============================================================================== --- openjpa/trunk/openjpa-project/pom.xml (original) +++ openjpa/trunk/openjpa-project/pom.xml Mon Sep 8 14:19:55 2008 @@ -303,6 +303,61 @@ </pluginRepository> </pluginRepositories> </profile> + <profile> + <id>nightly-upload</id> + <build> + <plugins> + <plugin> + <artifactId>maven-antrun-plugin</artifactId> + <executions> + <execution> + <phase>package</phase> + <configuration> + <tasks> + <mkdir dir="target/site/tempDocs"/> + <unzip dest="target/site/tempDocs"> + <fileset dir="target/site/downloads"> + <include name="*binary*.zip"/> + </fileset> + <patternset> + <include name="**/javadoc/**"/> + <include name="**/manual/**"/> + </patternset> + </unzip> + <chmod perm="g+rw"> + <fileset dir="target/site/downloads"/> + </chmod> + <!-- chmod returns 255 on the javadoc and manual dirs --> + <exec executable="chmod"> + <arg value="-R"/> + <arg value="g+w"/> + <arg value="target/site/tempDocs"/> + </exec> + + <!-- From the ant manual if we need to + preserve permissions we should use exec + --> + <exec executable="scp"> + <arg value="-rp"/> + <arg value="target/site/downloads"/> + <arg value="people.apache.org:/www/openjpa.apache.org/builds/latest/"/> + </exec> + <exec executable="scp"> + <arg value="-rp"/> + <arg value="target/site/tempDocs/apache-openjpa-${pom.version}/docs/"/> + <arg value="people.apache.org:/www/openjpa.apache.org/builds/latest/"/> + </exec> + </tasks> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> </profiles> <!-- need to explicitly list dependencies for assembly to work --> From commits-return-3345-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Mon Sep 08 21:32:49 2008 Return-Path: <commits-return-3345-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 26536 invoked from network); 8 Sep 2008 21:32:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Sep 2008 21:32:48 -0000 Received: (qmail 16512 invoked by uid 500); 8 Sep 2008 21:32:46 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 16502 invoked by uid 500); 8 Sep 2008 21:32:46 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 16493 invoked by uid 99); 8 Sep 2008 21:32:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Sep 2008 14:32:46 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Sep 2008 21:31:56 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 0226F2388A11; Mon, 8 Sep 2008 14:32:28 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r693283 - in /openjpa/branches/1.2.x: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ Date: Mon, 08 Sep 2008 21:32:27 -0000 To: commits@openjpa.apache.org From: kwsutter@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080908213228.0226F2388A11@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: kwsutter Date: Mon Sep 8 14:32:26 2008 New Revision: 693283 URL: http://svn.apache.org/viewvc?rev=693283&view=rev Log: OPENJPA-715. Committing the testcase provided by Ekin Sokmen and the patch provided by Fay Wang. Committing the change for both the 1.2.x service stream and 1.3.0 snapshot (trunk). Modified: openjpa/branches/1.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java Modified: openjpa/branches/1.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java?rev=693283&r1=693282&r2=693283&view=diff ============================================================================== --- openjpa/branches/1.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java (original) +++ openjpa/branches/1.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java Mon Sep 8 14:32:26 2008 @@ -356,7 +356,7 @@ } /** - * Return the primary key value for the given class. + * Return the primary key value for the sequence table for the given class. */ protected Object getPrimaryKey(ClassMapping mapping) { return Numbers.valueOf(0); Modified: openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java?rev=693283&r1=693282&r2=693283&view=diff ============================================================================== --- openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java (original) +++ openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java Mon Sep 8 14:32:26 2008 @@ -755,8 +755,12 @@ .setFailedObject(obj); } else { sm = _broker.getStateManager(obj); - if (sm == null || !sm.isProvisional()) + if (sm == null || !sm.isProvisional()) { sm = _broker.persist(obj, null, true, call); + // ensure generated IDs get assigned properly + if (!logical) + ((StateManagerImpl)sm).assignObjectId(false, true); + } } if (sm != null) { Modified: openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java?rev=693283&r1=693282&r2=693283&view=diff ============================================================================== --- openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java (original) +++ openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java Mon Sep 8 14:32:26 2008 @@ -512,7 +512,7 @@ * Ask store manager to assign our oid, optionally flushing and * optionally recaching on the new oid. */ - private boolean assignObjectId(boolean flush, boolean preFlushing) { + boolean assignObjectId(boolean flush, boolean preFlushing) { if (_oid != null || isEmbedded() || !isPersistent()) return true; From commits-return-3346-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Mon Sep 08 21:33:11 2008 Return-Path: <commits-return-3346-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 26770 invoked from network); 8 Sep 2008 21:33:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Sep 2008 21:33:11 -0000 Received: (qmail 17665 invoked by uid 500); 8 Sep 2008 21:33:08 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 17657 invoked by uid 500); 8 Sep 2008 21:33:08 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 17648 invoked by uid 99); 8 Sep 2008 21:33:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Sep 2008 14:33:08 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Sep 2008 21:32:18 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id D85182388A05; Mon, 8 Sep 2008 14:32:19 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r693282 - in /openjpa/trunk: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ Date: Mon, 08 Sep 2008 21:32:18 -0000 To: commits@openjpa.apache.org From: kwsutter@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080908213219.D85182388A05@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: kwsutter Date: Mon Sep 8 14:32:17 2008 New Revision: 693282 URL: http://svn.apache.org/viewvc?rev=693282&view=rev Log: OPENJPA-715. Committing the testcase provided by Ekin Sokmen and the patch provided by Fay Wang. Committing the change for both the 1.2.x service stream and 1.3.0 snapshot (trunk). Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java?rev=693282&r1=693281&r2=693282&view=diff ============================================================================== --- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java (original) +++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java Mon Sep 8 14:32:17 2008 @@ -356,7 +356,7 @@ } /** - * Return the primary key value for the given class. + * Return the primary key value for the sequence table for the given class. */ protected Object getPrimaryKey(ClassMapping mapping) { return Numbers.valueOf(0); Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java?rev=693282&r1=693281&r2=693282&view=diff ============================================================================== --- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java (original) +++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java Mon Sep 8 14:32:17 2008 @@ -755,8 +755,12 @@ .setFailedObject(obj); } else { sm = _broker.getStateManager(obj); - if (sm == null || !sm.isProvisional()) + if (sm == null || !sm.isProvisional()) { sm = _broker.persist(obj, null, true, call); + // ensure generated IDs get assigned properly + if (!logical) + ((StateManagerImpl)sm).assignObjectId(false, true); + } } if (sm != null) { Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java?rev=693282&r1=693281&r2=693282&view=diff ============================================================================== --- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java (original) +++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java Mon Sep 8 14:32:17 2008 @@ -512,7 +512,7 @@ * Ask store manager to assign our oid, optionally flushing and * optionally recaching on the new oid. */ - private boolean assignObjectId(boolean flush, boolean preFlushing) { + boolean assignObjectId(boolean flush, boolean preFlushing) { if (_oid != null || isEmbedded() || !isPersistent()) return true; From commits-return-3347-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Mon Sep 08 21:34:52 2008 Return-Path: <commits-return-3347-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 28114 invoked from network); 8 Sep 2008 21:34:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Sep 2008 21:34:52 -0000 Received: (qmail 22040 invoked by uid 500); 8 Sep 2008 21:34:49 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 22023 invoked by uid 500); 8 Sep 2008 21:34:49 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 22014 invoked by uid 99); 8 Sep 2008 21:34:49 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Sep 2008 14:34:49 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Sep 2008 21:33:59 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 1B32E2388A05; Mon, 8 Sep 2008 14:34:28 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r693287 - in /openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations: ChainEntityA.java ChainEntityB.java ChainEntityC.java TestChainEntities.java Date: Mon, 08 Sep 2008 21:34:27 -0000 To: commits@openjpa.apache.org From: kwsutter@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080908213428.1B32E2388A05@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: kwsutter Date: Mon Sep 8 14:34:26 2008 New Revision: 693287 URL: http://svn.apache.org/viewvc?rev=693287&view=rev Log: OPENJPA-715. Committing the testcase provided by Ekin Sokmen and the patch provided by Fay Wang. Committing the change for both the 1.2.x service stream and 1.3.0 snapshot (trunk). Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityA.java (with props) openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityB.java (with props) openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityC.java (with props) openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestChainEntities.java (with props) Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityA.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityA.java?rev=693287&view=auto ============================================================================== --- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityA.java (added) +++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityA.java Mon Sep 8 14:34:26 2008 @@ -0,0 +1,79 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.persistence.relations; + +import java.util.Collection; +import java.util.LinkedHashSet; +import java.util.Set; + +import javax.persistence.CascadeType; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.ManyToMany; +import javax.persistence.Version; + +@Entity +public class ChainEntityA { + + @Id + @GeneratedValue + private long aId; + + @Version + private Integer optLock; + + @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) + protected Set<ChainEntityB> chainEntityBSet; + + public ChainEntityA () { + super (); + } + + public void addChildEntityB (ChainEntityB bean) { + if (null == chainEntityBSet) + chainEntityBSet = new LinkedHashSet<ChainEntityB> (); + chainEntityBSet.add (bean); + } + + public Collection<ChainEntityB> getChildren () { + if (null == chainEntityBSet) + chainEntityBSet = new LinkedHashSet<ChainEntityB> (); + return chainEntityBSet; + } + + private String name; + + public String getName () { + return name; + } + + public void setName (String name) { + this.name = name; + } + + public long getId () { + return aId; + } + + public void setId (long id) { + this.aId = id; + } +} Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityA.java ------------------------------------------------------------------------------ svn:eol-style = native Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityB.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityB.java?rev=693287&view=auto ============================================================================== --- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityB.java (added) +++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityB.java Mon Sep 8 14:34:26 2008 @@ -0,0 +1,78 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.persistence.relations; + +import java.util.Collection; +import java.util.LinkedHashSet; +import java.util.Set; + +import javax.persistence.CascadeType; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Version; + +@Entity +public class ChainEntityB { + + @Id + @GeneratedValue + private long bId; + + @Version + private Integer optLock; + + //cascade = CascadeType.ALL, + @OneToMany(cascade=CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "chainEntityB") + protected Set<ChainEntityC> chainEntityCSet = null; + + public void addChainEntityC (ChainEntityC bean) { + if (null == chainEntityCSet) + chainEntityCSet = new LinkedHashSet<ChainEntityC> (); + chainEntityCSet.add (bean); + bean.setChainEntityB (this); + } + + public Collection<ChainEntityC> getChainEntityCSet () { + if (null == chainEntityCSet) + chainEntityCSet = new LinkedHashSet<ChainEntityC> (); + return chainEntityCSet; + } + + private String name; + + public String getName () { + return name; + } + + public void setName (String name) { + this.name = name; + } + + public long getId () { + return bId; + } + + public void setId (long id) { + this.bId = id; + } + +} Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityB.java ------------------------------------------------------------------------------ svn:eol-style = native Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityC.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityC.java?rev=693287&view=auto ============================================================================== --- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityC.java (added) +++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityC.java Mon Sep 8 14:34:26 2008 @@ -0,0 +1,69 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.persistence.relations; + +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.ManyToOne; +import javax.persistence.Version; + +@Entity +public class ChainEntityC { + + @Id + @GeneratedValue + private long cId; + + @Version + private Integer optLock; + + @ManyToOne(fetch = FetchType.EAGER, cascade=CascadeType.ALL) + protected ChainEntityB chainEntityB; + + @Basic + protected long chainEntityBId; + + public void setChainEntityB (ChainEntityB b) { + this.chainEntityB = b; +// this.chainEntityBId = null == b ? 0 : b.getId (); + } + + private String name; + + public String getName () { + return name; + } + + public void setName (String name) { + this.name = name; + } + + public long getId () { + return cId; + } + + public void setId (long id) { + this.cId = id; + } + +} Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityC.java ------------------------------------------------------------------------------ svn:eol-style = native Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestChainEntities.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestChainEntities.java?rev=693287&view=auto ============================================================================== --- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestChainEntities.java (added) +++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestChainEntities.java Mon Sep 8 14:34:26 2008 @@ -0,0 +1,117 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.persistence.relations; + +import javax.persistence.EntityManager; + +import org.apache.openjpa.persistence.test.SingleEMFTestCase; + +public class TestChainEntities extends SingleEMFTestCase { + + /* + * Set this magical number to 3 or less to avoid the error. + */ + private static final int MAGICAL_NUMBER = 50; + + long aid; + + public void setUp () { + setUp (ChainEntityA.class, ChainEntityB.class, ChainEntityC.class); + // Create A + ChainEntityA a = new ChainEntityA (); + a.setName ("TEST_A"); + // Persist A + EntityManager em = emf.createEntityManager (); + em.getTransaction ().begin (); + em.persist (a); + aid = a.getId (); + em.getTransaction ().commit (); + em.close (); + System.out.println ("ChainEntityA id = " + aid); + } + + public void testChainEntities () { + chainUpdate (); + } + + protected void chainUpdate () { + // Get A + ChainEntityA a = getA (); + // Create B + ChainEntityB b = new ChainEntityB (); + b.setName ("Test_B_"); + ChainEntityC c; + /* + * Create and add C to B. Increasing the number of iterations (number of + * ChainEntityC) increases the probability to get the unique key + * constraint violation error. + */ + for (int i = 1; i <= MAGICAL_NUMBER; i++) { + c = new ChainEntityC (); + c.setName ("Test_C_" + i); + b.addChainEntityC (c); + } + a.addChildEntityB (b); + // dump (a); // debug + // Merge A + EntityManager em = emf.createEntityManager (); + em.getTransaction ().begin (); + a = em.merge (a); + /* + * workaround: Uncommenting following line is a workaround. If we + * retrive Ids of ChainEntityC objects after merge but before commit we + * don't get the error. + */ + //dump (a); + em.getTransaction ().commit (); + em.close (); + // dump (getA ()); // debug + } + + /** + * Get created ChainEntityA using aid field. + * + * @return + */ + protected ChainEntityA getA () { + EntityManager em = emf.createEntityManager (); + ChainEntityA a = em.find (ChainEntityA.class, aid); + em.close (); + return a; + } + + /** + * Print the object graph of given ChainEntityA to System.out + * + * @param testA + */ + protected void dump (ChainEntityA testA) { + System.out.println ("-------"); + System.out.println (testA.getName () + "[" + testA.getId () + "]"); + for (ChainEntityB testB : testA.getChildren ()) { + System.out.println (testB.getName () + "[" + testB.getId () + "]"); + for (ChainEntityC testC : testB.getChainEntityCSet ()) { + System.out.println (testC.getName () + "[" + testC.getId () + + "]"); + } + } + System.out.println ("-------"); + } + +} Propchange: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestChainEntities.java ------------------------------------------------------------------------------ svn:eol-style = native From commits-return-3348-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Mon Sep 08 21:35:31 2008 Return-Path: <commits-return-3348-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 28312 invoked from network); 8 Sep 2008 21:35:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 8 Sep 2008 21:35:30 -0000 Received: (qmail 22225 invoked by uid 500); 8 Sep 2008 21:35:28 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 22209 invoked by uid 500); 8 Sep 2008 21:35:28 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 22200 invoked by uid 99); 8 Sep 2008 21:35:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Sep 2008 14:35:28 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Sep 2008 21:34:38 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id AD7B42388A10; Mon, 8 Sep 2008 14:34:35 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r693288 - in /openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations: ChainEntityA.java ChainEntityB.java ChainEntityC.java TestChainEntities.java Date: Mon, 08 Sep 2008 21:34:35 -0000 To: commits@openjpa.apache.org From: kwsutter@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080908213435.AD7B42388A10@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: kwsutter Date: Mon Sep 8 14:34:34 2008 New Revision: 693288 URL: http://svn.apache.org/viewvc?rev=693288&view=rev Log: OPENJPA-715. Committing the testcase provided by Ekin Sokmen and the patch provided by Fay Wang. Committing the change for both the 1.2.x service stream and 1.3.0 snapshot (trunk). Added: openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityA.java (with props) openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityB.java (with props) openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityC.java (with props) openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestChainEntities.java (with props) Added: openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityA.java URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityA.java?rev=693288&view=auto ============================================================================== --- openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityA.java (added) +++ openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityA.java Mon Sep 8 14:34:34 2008 @@ -0,0 +1,79 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.persistence.relations; + +import java.util.Collection; +import java.util.LinkedHashSet; +import java.util.Set; + +import javax.persistence.CascadeType; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.ManyToMany; +import javax.persistence.Version; + +@Entity +public class ChainEntityA { + + @Id + @GeneratedValue + private long aId; + + @Version + private Integer optLock; + + @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) + protected Set<ChainEntityB> chainEntityBSet; + + public ChainEntityA () { + super (); + } + + public void addChildEntityB (ChainEntityB bean) { + if (null == chainEntityBSet) + chainEntityBSet = new LinkedHashSet<ChainEntityB> (); + chainEntityBSet.add (bean); + } + + public Collection<ChainEntityB> getChildren () { + if (null == chainEntityBSet) + chainEntityBSet = new LinkedHashSet<ChainEntityB> (); + return chainEntityBSet; + } + + private String name; + + public String getName () { + return name; + } + + public void setName (String name) { + this.name = name; + } + + public long getId () { + return aId; + } + + public void setId (long id) { + this.aId = id; + } +} Propchange: openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityA.java ------------------------------------------------------------------------------ svn:eol-style = native Added: openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityB.java URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityB.java?rev=693288&view=auto ============================================================================== --- openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityB.java (added) +++ openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityB.java Mon Sep 8 14:34:34 2008 @@ -0,0 +1,78 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.persistence.relations; + +import java.util.Collection; +import java.util.LinkedHashSet; +import java.util.Set; + +import javax.persistence.CascadeType; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Version; + +@Entity +public class ChainEntityB { + + @Id + @GeneratedValue + private long bId; + + @Version + private Integer optLock; + + //cascade = CascadeType.ALL, + @OneToMany(cascade=CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "chainEntityB") + protected Set<ChainEntityC> chainEntityCSet = null; + + public void addChainEntityC (ChainEntityC bean) { + if (null == chainEntityCSet) + chainEntityCSet = new LinkedHashSet<ChainEntityC> (); + chainEntityCSet.add (bean); + bean.setChainEntityB (this); + } + + public Collection<ChainEntityC> getChainEntityCSet () { + if (null == chainEntityCSet) + chainEntityCSet = new LinkedHashSet<ChainEntityC> (); + return chainEntityCSet; + } + + private String name; + + public String getName () { + return name; + } + + public void setName (String name) { + this.name = name; + } + + public long getId () { + return bId; + } + + public void setId (long id) { + this.bId = id; + } + +} Propchange: openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityB.java ------------------------------------------------------------------------------ svn:eol-style = native Added: openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityC.java URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityC.java?rev=693288&view=auto ============================================================================== --- openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityC.java (added) +++ openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityC.java Mon Sep 8 14:34:34 2008 @@ -0,0 +1,69 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.persistence.relations; + +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.ManyToOne; +import javax.persistence.Version; + +@Entity +public class ChainEntityC { + + @Id + @GeneratedValue + private long cId; + + @Version + private Integer optLock; + + @ManyToOne(fetch = FetchType.EAGER, cascade=CascadeType.ALL) + protected ChainEntityB chainEntityB; + + @Basic + protected long chainEntityBId; + + public void setChainEntityB (ChainEntityB b) { + this.chainEntityB = b; +// this.chainEntityBId = null == b ? 0 : b.getId (); + } + + private String name; + + public String getName () { + return name; + } + + public void setName (String name) { + this.name = name; + } + + public long getId () { + return cId; + } + + public void setId (long id) { + this.cId = id; + } + +} Propchange: openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityC.java ------------------------------------------------------------------------------ svn:eol-style = native Added: openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestChainEntities.java URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestChainEntities.java?rev=693288&view=auto ============================================================================== --- openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestChainEntities.java (added) +++ openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestChainEntities.java Mon Sep 8 14:34:34 2008 @@ -0,0 +1,117 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.persistence.relations; + +import javax.persistence.EntityManager; + +import org.apache.openjpa.persistence.test.SingleEMFTestCase; + +public class TestChainEntities extends SingleEMFTestCase { + + /* + * Set this magical number to 3 or less to avoid the error. + */ + private static final int MAGICAL_NUMBER = 50; + + long aid; + + public void setUp () { + setUp (ChainEntityA.class, ChainEntityB.class, ChainEntityC.class); + // Create A + ChainEntityA a = new ChainEntityA (); + a.setName ("TEST_A"); + // Persist A + EntityManager em = emf.createEntityManager (); + em.getTransaction ().begin (); + em.persist (a); + aid = a.getId (); + em.getTransaction ().commit (); + em.close (); + System.out.println ("ChainEntityA id = " + aid); + } + + public void testChainEntities () { + chainUpdate (); + } + + protected void chainUpdate () { + // Get A + ChainEntityA a = getA (); + // Create B + ChainEntityB b = new ChainEntityB (); + b.setName ("Test_B_"); + ChainEntityC c; + /* + * Create and add C to B. Increasing the number of iterations (number of + * ChainEntityC) increases the probability to get the unique key + * constraint violation error. + */ + for (int i = 1; i <= MAGICAL_NUMBER; i++) { + c = new ChainEntityC (); + c.setName ("Test_C_" + i); + b.addChainEntityC (c); + } + a.addChildEntityB (b); + // dump (a); // debug + // Merge A + EntityManager em = emf.createEntityManager (); + em.getTransaction ().begin (); + a = em.merge (a); + /* + * workaround: Uncommenting following line is a workaround. If we + * retrive Ids of ChainEntityC objects after merge but before commit we + * don't get the error. + */ + //dump (a); + em.getTransaction ().commit (); + em.close (); + // dump (getA ()); // debug + } + + /** + * Get created ChainEntityA using aid field. + * + * @return + */ + protected ChainEntityA getA () { + EntityManager em = emf.createEntityManager (); + ChainEntityA a = em.find (ChainEntityA.class, aid); + em.close (); + return a; + } + + /** + * Print the object graph of given ChainEntityA to System.out + * + * @param testA + */ + protected void dump (ChainEntityA testA) { + System.out.println ("-------"); + System.out.println (testA.getName () + "[" + testA.getId () + "]"); + for (ChainEntityB testB : testA.getChildren ()) { + System.out.println (testB.getName () + "[" + testB.getId () + "]"); + for (ChainEntityC testC : testB.getChainEntityCSet ()) { + System.out.println (testC.getName () + "[" + testC.getId () + + "]"); + } + } + System.out.println ("-------"); + } + +} Propchange: openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestChainEntities.java ------------------------------------------------------------------------------ svn:eol-style = native From commits-return-3349-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Tue Sep 09 02:04:02 2008 Return-Path: <commits-return-3349-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 57281 invoked from network); 9 Sep 2008 02:04:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Sep 2008 02:04:02 -0000 Received: (qmail 57239 invoked by uid 500); 9 Sep 2008 02:03:59 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 57227 invoked by uid 500); 9 Sep 2008 02:03:59 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 57218 invoked by uid 99); 9 Sep 2008 02:03:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Sep 2008 19:03:59 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Sep 2008 02:03:08 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 4B22B23889BA; Mon, 8 Sep 2008 19:03:40 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r693341 [2/2] - in /openjpa/branches/sql-cache: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/ openjpa-kerne... Date: Tue, 09 Sep 2008 02:03:38 -0000 To: commits@openjpa.apache.org From: ppoddar@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080909020340.4B22B23889BA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java?rev=693341&r1=693340&r2=693341&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java (original) +++ openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java Mon Sep 8 19:03:37 2008 @@ -1,335 +1,358 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.openjpa.persistence; - -import java.lang.reflect.Constructor; -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; -import java.util.Collections; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Properties; -import java.util.Set; -import javax.persistence.EntityManagerFactory; - -import org.apache.openjpa.conf.OpenJPAConfiguration; -import org.apache.openjpa.enhance.Reflection; -import org.apache.openjpa.kernel.AutoDetach; -import org.apache.openjpa.kernel.Broker; -import org.apache.openjpa.kernel.BrokerFactory; -import org.apache.openjpa.kernel.DelegatingBrokerFactory; -import org.apache.openjpa.kernel.DelegatingFetchConfiguration; -import org.apache.openjpa.kernel.FetchConfiguration; -import org.apache.openjpa.lib.conf.Configurations; -import org.apache.openjpa.lib.conf.ProductDerivations; -import org.apache.openjpa.lib.conf.Value; -import org.apache.openjpa.lib.util.Localizer; -import org.apache.openjpa.lib.util.Closeable; -import org.apache.openjpa.util.OpenJPAException; -import serp.util.Strings; - -/** - * Implementation of {@link EntityManagerFactory} that acts as a - * facade to a {@link BrokerFactory}. - * - * @author Marc Prud'hommeaux - * @nojavadoc - */ -public class EntityManagerFactoryImpl - implements OpenJPAEntityManagerFactory, OpenJPAEntityManagerFactorySPI, - Closeable { - - private static final Localizer _loc = Localizer.forPackage - (EntityManagerFactoryImpl.class); - - private DelegatingBrokerFactory _factory = null; - private transient Constructor<FetchPlan> _plan = null; - private transient StoreCache _cache = null; - private transient QueryResultCache _queryCache = null; - - /** - * Default constructor provided for auto-instantiation. - */ - public EntityManagerFactoryImpl() { - } - - /** - * Supply delegate on construction. - */ - public EntityManagerFactoryImpl(BrokerFactory factory) { - setBrokerFactory(factory); - } - - /** - * Delegate. - */ - public BrokerFactory getBrokerFactory() { - return _factory.getDelegate(); - } - - /** - * Delegate must be provided before use. - */ - public void setBrokerFactory(BrokerFactory factory) { - _factory = new DelegatingBrokerFactory(factory, - PersistenceExceptions.TRANSLATOR); - } - - public OpenJPAConfiguration getConfiguration() { - return _factory.getConfiguration(); - } - - public Properties getProperties() { - return _factory.getProperties(); - } - - public Object putUserObject(Object key, Object val) { - return _factory.putUserObject(key, val); - } - - public Object getUserObject(Object key) { - return _factory.getUserObject(key); - } - - public StoreCache getStoreCache() { - _factory.lock(); - try { - if (_cache == null) { - OpenJPAConfiguration conf = _factory.getConfiguration(); - _cache = new StoreCacheImpl(this, - conf.getDataCacheManagerInstance().getSystemDataCache()); - } - return _cache; - } finally { - _factory.unlock(); - } - } - - public StoreCache getStoreCache(String cacheName) { - return new StoreCacheImpl(this, _factory.getConfiguration(). - getDataCacheManagerInstance().getDataCache(cacheName, true)); - } - - public QueryResultCache getQueryResultCache() { - _factory.lock(); - try { - if (_queryCache == null) - _queryCache = new QueryResultCacheImpl(_factory. - getConfiguration().getDataCacheManagerInstance(). - getSystemQueryCache()); - return _queryCache; - } finally { - _factory.unlock(); - } - } - - public OpenJPAEntityManagerSPI createEntityManager() { - return createEntityManager(null); - } - - public OpenJPAEntityManagerSPI createEntityManager(Map props) { - if (props == null) - props = Collections.EMPTY_MAP; - else if (!props.isEmpty()) - props = new HashMap(props); - - OpenJPAConfiguration conf = getConfiguration(); - String user = (String) Configurations.removeProperty - ("ConnectionUserName", props); - if (user == null) - user = conf.getConnectionUserName(); - String pass = (String) Configurations.removeProperty - ("ConnectionPassword", props); - if (pass == null) - pass = conf.getConnectionPassword(); - - String str = (String) Configurations.removeProperty - ("TransactionMode", props); - boolean managed; - if (str == null) - managed = conf.isTransactionModeManaged(); - else { - Value val = conf.getValue("TransactionMode"); - managed = Boolean.parseBoolean(val.unalias(str)); - } - - Object obj = Configurations.removeProperty("ConnectionRetainMode", - props); - int retainMode; - if (obj instanceof Number) - retainMode = ((Number) obj).intValue(); - else if (obj == null) - retainMode = conf.getConnectionRetainModeConstant(); - else { - Value val = conf.getValue("ConnectionRetainMode"); - try { - retainMode = Integer.parseInt(val.unalias((String) obj)); - } catch (Exception e) { - throw new ArgumentException(_loc.get("bad-em-prop", - "openjpa.ConnectionRetainMode", obj), - new Throwable[]{ e }, obj, true); - } - } - - Broker broker = _factory.newBroker(user, pass, managed, retainMode, - false); - - // add autodetach for close and rollback conditions to the configuration - broker.setAutoDetach(AutoDetach.DETACH_CLOSE, true); - broker.setAutoDetach(AutoDetach.DETACH_ROLLBACK, true); - - broker.setDetachedNew(false); - OpenJPAEntityManagerSPI em = newEntityManagerImpl(broker); - - // allow setting of other bean properties of EM - String[] prefixes = ProductDerivations.getConfigurationPrefixes(); - List<RuntimeException> errs = null; - Method setter; - String prop, prefix; - Object val; - for (Map.Entry entry : (Set<Map.Entry>) props.entrySet()) { - prop = (String) entry.getKey(); - prefix = null; - for (int i = 0; i < prefixes.length; i++) { - prefix = prefixes[i] + "."; - if (prop.startsWith(prefix)) - break; - prefix = null; - } - if (prefix == null) - continue; - prop = prop.substring(prefix.length()); - try { - setter = Reflection.findSetter(em.getClass(), prop, true); - } catch (OpenJPAException ke) { - if (errs == null) - errs = new LinkedList<RuntimeException>(); - errs.add(PersistenceExceptions.toPersistenceException(ke)); - continue; - } - - val = entry.getValue(); - try { - if (val instanceof String) { - if ("null".equals(val)) - val = null; - else - val = Strings.parse((String) val, - setter.getParameterTypes()[0]); - } - Reflection.set(em, setter, val); - } catch (Throwable t) { - while (t.getCause() != null) - t = t.getCause(); - ArgumentException err = new ArgumentException(_loc.get - ("bad-em-prop", prop, entry.getValue()), - new Throwable[]{ t }, null, true); - if (errs == null) - errs = new LinkedList<RuntimeException>(); - errs.add(err); - } - } - - if (errs != null) { - em.close(); - if (errs.size() == 1) - throw errs.get(0); - throw new ArgumentException(_loc.get("bad-em-props"), - errs.toArray(new Throwable[errs.size()]), - null, true); - } - return em; - } - - /** - * Create a new entity manager around the given broker. - */ - protected EntityManagerImpl newEntityManagerImpl(Broker broker) { - return new EntityManagerImpl(this, broker); - } - - public void addLifecycleListener(Object listener, Class... classes) { - _factory.addLifecycleListener(listener, classes); - } - - public void removeLifecycleListener(Object listener) { - _factory.removeLifecycleListener(listener); - } - - public void addTransactionListener(Object listener) { - _factory.addTransactionListener(listener); - } - - public void removeTransactionListener(Object listener) { - _factory.removeTransactionListener(listener); - } - - public void close() { - _factory.close(); - } - - public boolean isOpen() { - return !_factory.isClosed(); - } - - public int hashCode() { - return _factory.hashCode(); - } - - public boolean equals(Object other) { - if (other == this) - return true; - if (!(other instanceof EntityManagerFactoryImpl)) - return false; - return _factory.equals(((EntityManagerFactoryImpl) other)._factory); - } - - /** - * Create a store-specific facade for the given fetch configuration. - * If no facade class exists, we use the default {@link FetchPlan}. - */ - FetchPlan toFetchPlan(Broker broker, FetchConfiguration fetch) { - if (fetch == null) - return null; - - if (fetch instanceof DelegatingFetchConfiguration) - fetch = ((DelegatingFetchConfiguration) fetch). - getInnermostDelegate(); - - try { - if (_plan == null) { - Class storeType = (broker == null) ? null : broker. - getStoreManager().getInnermostDelegate().getClass(); - Class cls = _factory.getConfiguration(). - getStoreFacadeTypeRegistry(). - getImplementation(FetchPlan.class, storeType, - FetchPlanImpl.class); - _plan = cls.getConstructor(FetchConfiguration.class); - } - return _plan.newInstance(fetch); - } catch (InvocationTargetException ite) { - throw PersistenceExceptions.toPersistenceException - (ite.getTargetException()); - } catch (Exception e) { - throw PersistenceExceptions.toPersistenceException(e); - } - } -} +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.persistence; + +import java.lang.reflect.Constructor; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; + +import javax.persistence.EntityManagerFactory; + +import org.apache.openjpa.conf.OpenJPAConfiguration; +import org.apache.openjpa.enhance.Reflection; +import org.apache.openjpa.kernel.AutoDetach; +import org.apache.openjpa.kernel.Broker; +import org.apache.openjpa.kernel.BrokerFactory; +import org.apache.openjpa.kernel.DelegatingBrokerFactory; +import org.apache.openjpa.kernel.DelegatingFetchConfiguration; +import org.apache.openjpa.kernel.FetchConfiguration; +import org.apache.openjpa.lib.conf.Configurations; +import org.apache.openjpa.lib.conf.ProductDerivations; +import org.apache.openjpa.lib.conf.Value; +import org.apache.openjpa.lib.util.Closeable; +import org.apache.openjpa.lib.util.Localizer; +import org.apache.openjpa.util.OpenJPAException; + +import serp.util.Strings; + +/** + * Implementation of {@link EntityManagerFactory} that acts as a + * facade to a {@link BrokerFactory}. + * + * @author Marc Prud'hommeaux + * @nojavadoc + */ +public class EntityManagerFactoryImpl + implements OpenJPAEntityManagerFactory, OpenJPAEntityManagerFactorySPI, + Closeable { + + private static final Localizer _loc = Localizer.forPackage + (EntityManagerFactoryImpl.class); + + private DelegatingBrokerFactory _factory = null; + private transient Constructor<FetchPlan> _plan = null; + private transient StoreCache _cache = null; + private transient QueryResultCache _queryCache = null; + private transient Map<String, PreparedQuery> _sqlQueryCache = null; + + /** + * Default constructor provided for auto-instantiation. + */ + public EntityManagerFactoryImpl() { + } + + /** + * Supply delegate on construction. + */ + public EntityManagerFactoryImpl(BrokerFactory factory) { + setBrokerFactory(factory); + } + + /** + * Delegate. + */ + public BrokerFactory getBrokerFactory() { + return _factory.getDelegate(); + } + + /** + * Delegate must be provided before use. + */ + public void setBrokerFactory(BrokerFactory factory) { + _factory = new DelegatingBrokerFactory(factory, + PersistenceExceptions.TRANSLATOR); + } + + public OpenJPAConfiguration getConfiguration() { + return _factory.getConfiguration(); + } + + public Properties getProperties() { + return _factory.getProperties(); + } + + public Object putUserObject(Object key, Object val) { + return _factory.putUserObject(key, val); + } + + public Object getUserObject(Object key) { + return _factory.getUserObject(key); + } + + public StoreCache getStoreCache() { + _factory.lock(); + try { + if (_cache == null) { + OpenJPAConfiguration conf = _factory.getConfiguration(); + _cache = new StoreCacheImpl(this, + conf.getDataCacheManagerInstance().getSystemDataCache()); + } + return _cache; + } finally { + _factory.unlock(); + } + } + + public StoreCache getStoreCache(String cacheName) { + return new StoreCacheImpl(this, _factory.getConfiguration(). + getDataCacheManagerInstance().getDataCache(cacheName, true)); + } + + public QueryResultCache getQueryResultCache() { + _factory.lock(); + try { + if (_queryCache == null) + _queryCache = new QueryResultCacheImpl(_factory. + getConfiguration().getDataCacheManagerInstance(). + getSystemQueryCache()); + return _queryCache; + } finally { + _factory.unlock(); + } + } + + public OpenJPAEntityManagerSPI createEntityManager() { + return createEntityManager(null); + } + + public OpenJPAEntityManagerSPI createEntityManager(Map props) { + if (props == null) + props = Collections.EMPTY_MAP; + else if (!props.isEmpty()) + props = new HashMap(props); + + OpenJPAConfiguration conf = getConfiguration(); + String user = (String) Configurations.removeProperty + ("ConnectionUserName", props); + if (user == null) + user = conf.getConnectionUserName(); + String pass = (String) Configurations.removeProperty + ("ConnectionPassword", props); + if (pass == null) + pass = conf.getConnectionPassword(); + + String str = (String) Configurations.removeProperty + ("TransactionMode", props); + boolean managed; + if (str == null) + managed = conf.isTransactionModeManaged(); + else { + Value val = conf.getValue("TransactionMode"); + managed = Boolean.parseBoolean(val.unalias(str)); + } + + Object obj = Configurations.removeProperty("ConnectionRetainMode", + props); + int retainMode; + if (obj instanceof Number) + retainMode = ((Number) obj).intValue(); + else if (obj == null) + retainMode = conf.getConnectionRetainModeConstant(); + else { + Value val = conf.getValue("ConnectionRetainMode"); + try { + retainMode = Integer.parseInt(val.unalias((String) obj)); + } catch (Exception e) { + throw new ArgumentException(_loc.get("bad-em-prop", + "openjpa.ConnectionRetainMode", obj), + new Throwable[]{ e }, obj, true); + } + } + + Broker broker = _factory.newBroker(user, pass, managed, retainMode, + false); + + // add autodetach for close and rollback conditions to the configuration + broker.setAutoDetach(AutoDetach.DETACH_CLOSE, true); + broker.setAutoDetach(AutoDetach.DETACH_ROLLBACK, true); + + broker.setDetachedNew(false); + OpenJPAEntityManagerSPI em = newEntityManagerImpl(broker); + + // allow setting of other bean properties of EM + String[] prefixes = ProductDerivations.getConfigurationPrefixes(); + List<RuntimeException> errs = null; + Method setter; + String prop, prefix; + Object val; + for (Map.Entry entry : (Set<Map.Entry>) props.entrySet()) { + prop = (String) entry.getKey(); + prefix = null; + for (int i = 0; i < prefixes.length; i++) { + prefix = prefixes[i] + "."; + if (prop.startsWith(prefix)) + break; + prefix = null; + } + if (prefix == null) + continue; + prop = prop.substring(prefix.length()); + try { + setter = Reflection.findSetter(em.getClass(), prop, true); + } catch (OpenJPAException ke) { + if (errs == null) + errs = new LinkedList<RuntimeException>(); + errs.add(PersistenceExceptions.toPersistenceException(ke)); + continue; + } + + val = entry.getValue(); + try { + if (val instanceof String) { + if ("null".equals(val)) + val = null; + else + val = Strings.parse((String) val, + setter.getParameterTypes()[0]); + } + Reflection.set(em, setter, val); + } catch (Throwable t) { + while (t.getCause() != null) + t = t.getCause(); + ArgumentException err = new ArgumentException(_loc.get + ("bad-em-prop", prop, entry.getValue()), + new Throwable[]{ t }, null, true); + if (errs == null) + errs = new LinkedList<RuntimeException>(); + errs.add(err); + } + } + + if (errs != null) { + em.close(); + if (errs.size() == 1) + throw errs.get(0); + throw new ArgumentException(_loc.get("bad-em-props"), + errs.toArray(new Throwable[errs.size()]), + null, true); + } + return em; + } + + /** + * Create a new entity manager around the given broker. + */ + protected EntityManagerImpl newEntityManagerImpl(Broker broker) { + return new EntityManagerImpl(this, broker); + } + + public void addLifecycleListener(Object listener, Class... classes) { + _factory.addLifecycleListener(listener, classes); + } + + public void removeLifecycleListener(Object listener) { + _factory.removeLifecycleListener(listener); + } + + public void addTransactionListener(Object listener) { + _factory.addTransactionListener(listener); + } + + public void removeTransactionListener(Object listener) { + _factory.removeTransactionListener(listener); + } + + public void close() { + _factory.close(); + } + + public boolean isOpen() { + return !_factory.isClosed(); + } + + public int hashCode() { + return _factory.hashCode(); + } + + public boolean equals(Object other) { + if (other == this) + return true; + if (!(other instanceof EntityManagerFactoryImpl)) + return false; + return _factory.equals(((EntityManagerFactoryImpl) other)._factory); + } + + /** + * Create a store-specific facade for the given fetch configuration. + * If no facade class exists, we use the default {@link FetchPlan}. + */ + FetchPlan toFetchPlan(Broker broker, FetchConfiguration fetch) { + if (fetch == null) + return null; + + if (fetch instanceof DelegatingFetchConfiguration) + fetch = ((DelegatingFetchConfiguration) fetch). + getInnermostDelegate(); + + try { + if (_plan == null) { + Class storeType = (broker == null) ? null : broker. + getStoreManager().getInnermostDelegate().getClass(); + Class cls = _factory.getConfiguration(). + getStoreFacadeTypeRegistry(). + getImplementation(FetchPlan.class, storeType, + FetchPlanImpl.class); + _plan = cls.getConstructor(FetchConfiguration.class); + } + return _plan.newInstance(fetch); + } catch (InvocationTargetException ite) { + throw PersistenceExceptions.toPersistenceException + (ite.getTargetException()); + } catch (Exception e) { + throw PersistenceExceptions.toPersistenceException(e); + } + } + +// boolean cacheQuery(String qid, PreparedQuery sql) { +// if (!isCacheingSQL()) +// return false; +// if (_sqlQueryCache == null) +// _sqlQueryCache = new ConcurrentHashMap<String, PreparedQuery>(); +// _sqlQueryCache.put(qid, sql); +// return true; +// } +// +// PreparedQuery getPreparedQuery(String qid) { +// if (!isCacheingSQL()) +// return null; +// if (_sqlQueryCache == null) +// return null; +// PreparedQuery result = _sqlQueryCache.get(qid); +// return result; +// } + +} Modified: openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java?rev=693341&r1=693340&r2=693341&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java (original) +++ openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java Mon Sep 8 19:03:37 2008 @@ -64,6 +64,7 @@ import org.apache.openjpa.meta.SequenceMetaData; import org.apache.openjpa.util.Exceptions; import org.apache.openjpa.util.ImplHelper; +import org.apache.openjpa.util.ParameterMap; import org.apache.openjpa.util.RuntimeExceptionTranslator; import org.apache.openjpa.util.UserException; @@ -868,12 +869,21 @@ public OpenJPAQuery createQuery(String language, String query) { assertNotCloseInvoked(); try { + String qid = query; + PreparedQuery cached = getPreparedQuery(qid); + if (cached != null) { + language = QueryLanguages.LANG_PREPARED_SQL; + query = cached.getSQL(); + } org.apache.openjpa.kernel.Query q = _broker.newQuery(language, query); // have to validate JPQL according to spec if (JPQLParser.LANG_JPQL.equals(language)) q.compile(); - return new QueryImpl(this, _ret, q); + if (cached != null) { + cached.setInto(q); + } + return new QueryImpl(this, _ret, q).setId(qid); } catch (RuntimeException re) { throw PersistenceExceptions.toPersistenceException(re); } @@ -936,6 +946,16 @@ if (StringUtils.trimToNull(query) == null) throw new ArgumentException(_loc.get("no-sql"), null, null, false); } + + private PreparedQuery getPreparedQuery(String id) { + Map cache = getConfiguration().getPreparedQueryCacheInstance(); + if (cache == null) + return null; + Object val = cache.get(id); + if (val == PreparedQuery.NOT_CACHABLE) + return null; + return (PreparedQuery)val; + } public void setFlushMode(FlushModeType flushMode) { assertNotCloseInvoked(); Added: openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQuery.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQuery.java?rev=693341&view=auto ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQuery.java (added) +++ openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQuery.java Mon Sep 8 19:03:37 2008 @@ -0,0 +1,87 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.persistence; + +import org.apache.openjpa.kernel.Query; + +/** + * A prepared query binds a compiled query to its target SQL. + * + * The target SQL is meant to be executed directly bypassing the critical + * cost of constructing the SQL on every query execution. As the subsequent + * execution of a cached query will bypass compilation as a JPQL query, + * the post-compilation state of the original query is captured in this receiver + * to be transferred to the executable query instance. + * + * @author Pinaki Poddar + * + */ +public class PreparedQuery { + public static final PreparedQuery NOT_CACHABLE = new PreparedQuery(); + private final String _sql; + private final String _id; + + // Post-compilation state of an executable query + Class _candidate = null; + boolean _subclasses = true; + boolean _isProjection = false; + + private PreparedQuery() { + _sql = null; + _id = null; + } + + public PreparedQuery(String id, String sql, Query compiled) { + this._id = id; + this._sql = sql; + + _candidate = compiled.getCandidateType(); + _subclasses = compiled.hasSubclasses(); + _isProjection = compiled.getProjectionAliases().length > 0; + } + + public String getIdentifier() { + return _id; + } + + public String getSQL() { + return _sql; + } + + public String toString() { + return "PreparedQuery " + _id + "==>" + _sql; + } + + void setInto(Query q) { +// q.setCandidateCollection(last.getCandidateCollection()); +// q.setCandidateExtent(last.getCandidateExtent()); + + if (!_isProjection) + q.setCandidateType(_candidate, _subclasses); + +// q.setIgnoreChanges(last.getIgnoreChanges()); +// q.setRange(last.getStartRange(), last.getEndRange()); +// q.setReadOnly(last.isReadOnly()); +// q.setResultMapping(last.getResultMappingScope(), last.getResultMappingName()); +// q.setResultType(last.getResultType()); +// q.setUnique(last.isUnique()); + } + + +} Modified: openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java?rev=693341&r1=693340&r2=693341&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java (original) +++ openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java Mon Sep 8 19:03:37 2008 @@ -22,18 +22,13 @@ import java.lang.reflect.Method; import java.sql.Time; import java.sql.Timestamp; -import java.util.ArrayList; -import java.util.Arrays; import java.util.Calendar; import java.util.Collection; import java.util.Collections; import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; -import java.util.TreeMap; import javax.persistence.FlushModeType; import javax.persistence.Query; @@ -51,13 +46,16 @@ import org.apache.openjpa.lib.rop.ResultList; import org.apache.openjpa.lib.util.Localizer; import org.apache.openjpa.util.ImplHelper; +import org.apache.openjpa.util.ParameterMap; import org.apache.openjpa.util.RuntimeExceptionTranslator; +import org.apache.openjpa.util.UserException; /** * Implementation of {@link Query} interface. * * @author Marc Prud'hommeaux * @author Abe White + * @author Pinaki Poddar * @nojavadoc */ public class QueryImpl implements OpenJPAQuerySPI, Serializable { @@ -69,17 +67,16 @@ private final DelegatingQuery _query; private transient EntityManagerImpl _em; private transient FetchPlan _fetch; + private ParameterMap _params; + private transient Boolean _cacheable = null; + private String _id; - private Map<String, Object> _named; - private Map<Integer, Object> _positional; - - private static Object GAP_FILLER = new Object(); /** * Constructor; supply factory exception translator and delegate. * * @param em The EntityManager which created this query - * @param ret Exception translater for this query + * @param ret Exception translator for this query * @param query The underlying "kernel" query. */ public QueryImpl(EntityManagerImpl em, RuntimeExceptionTranslator ret, @@ -246,183 +243,13 @@ if (_query.getOperation() != QueryOperations.OP_SELECT) throw new InvalidStateException(_loc.get("not-select-query", _query .getQueryString()), null, null, false); - - validateParameters(); - - // handle which types of parameters we are using, if any - if (_positional != null) - return _query.execute(_positional); - if (_named != null) - return _query.execute(_named); - return _query.execute(); + PreparedQuery cachedQuery = cache(); + boolean usingCachedQuery = (cachedQuery != null); + validate(_query.getParameterTypes(), !usingCachedQuery); + Object result = _query.execute(getParameterMap(usingCachedQuery)); + return result; } - /** - * Validate that the types of the parameters are correct. - * The idea is to catch as many validation error as possible at the facade - * layer itself. - * For native SQL queries, however, parameter validation is bypassed as - * we do not parse SQL. - * - * The expected parameters are parsed from the query and in a LinkedMap - * key : name of the parameter as declared in query - * value : expected Class of allowed value - * - * The bound parameters depends on positional or named parameter style - * - * TreeMap<Integer, Object> for positional parameters: - * key : 1-based Integer index - * value : bound value. GAP_FILLER if the position is not set. This - * simplifies validation at the kernel layer - * - * Map<String, Object> for named parameters: - * key : parameter name - * value : the bound value - * - * Validation accounts for - * a) gaps in positional parameters - * SELECT p FROM PObject p WHERE p.a1=?1 AND p.a3=?3 - * - * b) repeated parameters - * SELECT p FROM PObject p WHERE p.a1=?1 AND p.a2=?1 AND p.a3=?2 - * - * c) parameter is bound but not declared - * - * d) parameter is declared but not bound - * - * e) parameter does not match the value type - * - * f) parameter is primitive type but bound to null value - */ - private void validateParameters() { - if (isNative()) { - removeGaps(_positional); - return; - } - String query = getQueryString(); - if (_positional != null) { - LinkedMap expected = _query.getParameterTypes(); - Map<Integer, Object> actual = _positional; - for (Object o : expected.keySet()) { - String position = (String) o; - Class expectedParamType = (Class) expected.get(position); - try { - Integer.parseInt(position); - } catch (NumberFormatException ex) { - newValidationException("param-style-mismatch", query, - expected.asList(), - Arrays.toString(actual.keySet().toArray())); - } - Object actualValue = actual.get(Integer.parseInt(position)); - boolean valueUnspecified = (actualValue == GAP_FILLER) - || (actualValue == null && (actual.size() < expected - .size())); - if (valueUnspecified) - newValidationException("param-missing", position, query, - Arrays.toString(actual.keySet().toArray())); - - if (expectedParamType.isPrimitive() && actualValue == null) - newValidationException("param-type-null", - position, query, expectedParamType.getName()); - if (actualValue != null && - !Filters.wrap(expectedParamType).isInstance(actualValue)) - newValidationException("param-type-mismatch", - position, query, actualValue, - actualValue.getClass().getName(), - expectedParamType.getName()); - - } - for (Integer position : actual.keySet()) { - Object actualValue = actual.get(position); - Class expectedParamType = (Class) expected.get("" + position); - boolean paramExpected = expected.containsKey("" + position); - if (actualValue == GAP_FILLER) { - if (paramExpected) { - newValidationException("param-missing", position, query, - Arrays.toString(actual.keySet().toArray())); - } - } else { - if (!paramExpected) - newValidationException("param-extra", position, query, - expected.asList()); - if (expectedParamType.isPrimitive() && actualValue == null) - newValidationException("param-type-null", - position, query, expectedParamType.getName()); - if (actualValue != null - && !Filters.wrap(expectedParamType).isInstance(actualValue)) - newValidationException("param-type-mismatch", - position, query, actualValue, - actualValue.getClass().getName(), - expectedParamType.getName()); - - } - } - - } else if (_named != null) { - LinkedMap expected = _query.getParameterTypes(); - // key : name of the parameter used while binding - // value : user supplied parameter value. null may mean either - // user has supplied a value or not specified at all - Map<String, Object> actual = _named; - for (Object o : expected.keySet()) { - String expectedName = (String) o; - Class expectedParamType = (Class) expected.get(expectedName); - Object actualValue = actual.get(expectedName); - boolean valueUnspecified = !actual.containsKey(expectedName); - if (valueUnspecified) { - newValidationException("param-missing", expectedName, query, - Arrays.toString(actual.keySet().toArray())); - } - if (expectedParamType.isPrimitive() && actualValue == null) - newValidationException("param-type-null", - expectedName, query, expectedParamType.getName()); - if (actualValue != null - && !Filters.wrap(expectedParamType).isInstance(actualValue)) { - newValidationException("param-type-mismatch", - expectedName, query, actualValue, - actualValue.getClass().getName(), - expectedParamType.getName()); - } - } - for (String actualName : actual.keySet()) { - Object actualValue = actual.get(actualName); - Class expectedParamType = (Class) expected.get(actualName); - boolean paramExpected = expected.containsKey(actualName); - if (!paramExpected) { - newValidationException("param-extra", actualName, query, - expected.asList()); - } - if (expectedParamType.isPrimitive() && actualValue == null) - newValidationException("param-type-null", - actualName, query, expectedParamType.getName()); - if (actualValue != null - && !Filters.wrap(expectedParamType).isInstance(actualValue)) { - newValidationException("param-type-mismatch", - actualName, query, actualValue, - actualValue.getClass().getName(), - expectedParamType.getName()); - } - } - } - } - - Map<Integer, Object> removeGaps(Map<Integer, Object> map) { - if (map == null || !map.containsValue(GAP_FILLER)) - return map; - List<Integer> gaps = new ArrayList<Integer>(); - for (Integer key : map.keySet()) - if (map.get(key) == GAP_FILLER) - gaps.add(key); - for (Integer gap : gaps) { - map.remove(gap); - } - return map; - } - - void newValidationException(String msgKey, Object...args) { - throw new ArgumentException(_loc.get(msgKey, args), null, null, false); - } - public List getResultList() { _em.assertNotCloseInvoked(); Object ob = execute(); @@ -457,20 +284,10 @@ public int executeUpdate() { _em.assertNotCloseInvoked(); if (_query.getOperation() == QueryOperations.OP_DELETE) { - // handle which types of parameters we are using, if any - if (_positional != null) - return asInt(_query.deleteAll(_positional)); - if (_named != null) - return asInt(_query.deleteAll(_named)); - return asInt(_query.deleteAll()); + return asInt(_query.deleteAll(_params)); } if (_query.getOperation() == QueryOperations.OP_UPDATE) { - // handle which types of parameters we are using, if any - if (_positional != null) - return asInt(_query.updateAll(_positional)); - if (_named != null) - return asInt(_query.updateAll(_named)); - return asInt(_query.updateAll()); + return asInt(_query.updateAll(_params)); } throw new InvalidStateException(_loc.get("not-update-delete-query", _query.getQueryString()), null, null, false); @@ -510,6 +327,8 @@ if (value instanceof String) value = Boolean.valueOf((String) value); setSubclasses(((Boolean) value).booleanValue()); + } else if ("InvalidateCache".equals(k)) { + invalidate(); } else if ("FilterListener".equals(k)) addFilterListener(Filters.hintToFilterListener(value, _query .getBroker().getClassLoader())); @@ -570,8 +389,8 @@ return setParameter(position, convertTemporalType(value, t)); } - public OpenJPAQuery setParameter(int position, Date value, TemporalType type) { - return setParameter(position, convertTemporalType(value, type)); + public OpenJPAQuery setParameter(int pos, Date value, TemporalType type) { + return setParameter(pos, convertTemporalType(value, type)); } /** @@ -600,28 +419,10 @@ _em.assertNotCloseInvoked(); _query.lock(); try { - if (isNative() && position < 1) { - throw new IllegalArgumentException(_loc.get("bad-pos-params", - position, _query.getQueryString()).toString()); - } - // not allowed to mix positional and named parameters (EDR2 3.6.4) - if (_named != null) - throw new InvalidStateException(_loc.get( - "no-pos-named-params-mix", _query.getQueryString()), - null, null, false); - - if (position < 1) - throw new InvalidStateException(_loc.get("illegal-index", - position), null, null, false); - - if (_positional == null) - _positional = new TreeMap<Integer, Object>(); - - _positional.put(position, value); - for (int i = 1; i < position; i++) - if (!_positional.containsKey(i)) - _positional.put(i, GAP_FILLER); - + if (_params == null) + _params = new ParameterMap(isNative() ? + ParameterMap.Type.POSITIONAL : null); + _params.put(position, value); return this; } finally { _query.unlock(); @@ -633,8 +434,8 @@ return setParameter(name, convertTemporalType(value, type)); } - public OpenJPAQuery setParameter(String name, Date value, TemporalType type) { - return setParameter(name, convertTemporalType(value, type)); + public OpenJPAQuery setParameter(String name, Date value, TemporalType t) { + return setParameter(name, convertTemporalType(value, t)); } public OpenJPAQuery setParameter(String name, Object value) { @@ -642,19 +443,10 @@ _em.assertNotCloseInvoked(); _query.lock(); try { - if (isNative()) { - throw new IllegalArgumentException(_loc.get("no-named-params", - name, _query.getQueryString()).toString()); - } - // not allowed to mix positional and named parameters (EDR2 3.6.4) - if (_positional != null) - throw new InvalidStateException(_loc.get( - "no-pos-named-params-mix", _query.getQueryString()), - null, null, false); - - if (_named == null) - _named = new HashMap(); - _named.put(name, value); + if (_params == null) + _params = new ParameterMap(isNative() ? + ParameterMap.Type.POSITIONAL : null); + _params.put(name, value); return this; } finally { _query.unlock(); @@ -664,37 +456,30 @@ public boolean isNative() { return QueryLanguages.LANG_SQL.equals(getLanguage()); } - + public boolean hasPositionalParameters() { - return _positional != null; + return _params != null && _params.isPositional() && !_params.isEmpty(); } - /** - * Gets the array of positional parameter values. A value of - * <code>GAP_FILLER</code> indicates that user has not set the - * corresponding positional parameter. A value of null implies that user has - * set the value as null. - */ public Object[] getPositionalParameters() { _query.lock(); try { - return (_positional == null) ? EMPTY_ARRAY : _positional.values() - .toArray(); + return hasPositionalParameters() ? _params.values().toArray() + : EMPTY_ARRAY; } finally { _query.unlock(); } } - + public OpenJPAQuery setParameters(Object... params) { _query.assertOpen(); _em.assertNotCloseInvoked(); _query.lock(); try { - _positional = null; - _named = null; - if (params != null) - for (int i = 0; i < params.length; i++) - setParameter(i + 1, params[i]); + if (params == null) + return this; + for (int i = 0; i < params.length; i++) + setParameter(i + 1, params[i]); return this; } finally { _query.unlock(); @@ -704,8 +489,8 @@ public Map getNamedParameters() { _query.lock(); try { - return (_named == null) ? Collections.EMPTY_MAP : Collections - .unmodifiableMap(_named); + return (_params == null || !_params.isNamed()) + ? Collections.EMPTY_MAP : _params.getMap(); } finally { _query.unlock(); } @@ -716,11 +501,12 @@ _em.assertNotCloseInvoked(); _query.lock(); try { - _positional = null; - _named = null; - if (params != null) - for (Map.Entry e : (Set<Map.Entry>) params.entrySet()) - setParameter((String) e.getKey(), e.getValue()); + if (params == null) + return this; + if (_params == null) + _params = new ParameterMap(isNative() ? + ParameterMap.Type.POSITIONAL : null); + _params.putAll(params); return this; } finally { _query.unlock(); @@ -735,6 +521,77 @@ public String[] getDataStoreActions(Map params) { return _query.getDataStoreActions(params); } + + QueryImpl setId(String id) { + _id = id; + return this; + } + + /** + * Validates internal parameters against a given expected parameter types. + * + * @param expected contains expected types of parameters. + * @param strict if true then also enforces that the parameter keys match. + * Otherwise only the types are compared. + * A more lenient strategy is required to accommodate the use case where + * named parameters are set on a JPQL query but the query is executed + * directly as a cached SQL which only supports positional parameters. + */ + void validate(LinkedMap expected, boolean strict) { + if (_params == null) { + if (expected != null && !expected.isEmpty()) + throw new UserException(_loc.get("param-unset", expected)); + } else { + _params.validate(expected, strict); + } + } + + /** + * Gets the values from ParameterMap as a map with deterministic iteration + * order, optionally converting a named map to a positional one. + */ + Map getParameterMap(boolean convertToPositional) { + if (_params == null) + return null; + if (convertToPositional && !_params.isPositional()) + return _params.toPositional().getMap(); + return _params.getMap(); + } + + /** + * Cache this query with its identifier as key and SQL as value if this + * query is amenable to caching and has not already been cached. + * + * @return non-null if this query has already been cached. null if it can + * not be cached or cached in this call. + */ + PreparedQuery cache() { + if (_id == null) + return null; + Map cache = _em.getConfiguration().getPreparedQueryCacheInstance(); + if (cache == null) + return null; + PreparedQuery cached = (PreparedQuery)cache.get(_id); + if (cached == PreparedQuery.NOT_CACHABLE) + return null; + if (cached == null) { + String[] sqls = _query.getDataStoreActions(getParameterMap(true)); + boolean cacheable = sqls.length == 1; + if (!cacheable) { + cache.put(_id, PreparedQuery.NOT_CACHABLE); + return null; + } + cached = new PreparedQuery(_id, sqls[0], _query); + cache.put(_id, cached); + return null; + } + return cached; + } + + public boolean invalidate() { + Map cache = _em.getConfiguration().getPreparedQueryCacheInstance(); + return cache != null && cache.remove(_id) != null; + } public int hashCode() { return _query.hashCode(); From commits-return-3350-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Tue Sep 09 02:04:10 2008 Return-Path: <commits-return-3350-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 57419 invoked from network); 9 Sep 2008 02:04:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Sep 2008 02:04:10 -0000 Received: (qmail 57367 invoked by uid 500); 9 Sep 2008 02:04:08 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 57342 invoked by uid 500); 9 Sep 2008 02:04:08 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 57319 invoked by uid 99); 9 Sep 2008 02:04:08 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 08 Sep 2008 19:04:08 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Sep 2008 02:03:08 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 421942388986; Mon, 8 Sep 2008 19:03:40 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r693341 [1/2] - in /openjpa/branches/sql-cache: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/ openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/ openjpa-kerne... Date: Tue, 09 Sep 2008 02:03:38 -0000 To: commits@openjpa.apache.org From: ppoddar@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080909020340.421942388986@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ppoddar Date: Mon Sep 8 19:03:37 2008 New Revision: 693341 URL: http://svn.apache.org/viewvc?rev=693341&view=rev Log: Savepoint commit for Prepared Query cache with 2 tests failing Added: openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/PreparedQueryCacheValue.java openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/util/ParameterMap.java openjpa/branches/sql-cache/openjpa-kernel/src/test/java/org/apache/openjpa/kernel/ openjpa/branches/sql-cache/openjpa-kernel/src/test/java/org/apache/openjpa/kernel/TestParameterMap.java openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/ openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/Address.java openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/Company.java openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/Department.java openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/Employee.java openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQuery.java Modified: openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreQuery.java openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Param.java openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/LogicalUnion.java openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLBuffer.java openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/Select.java openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfiguration.java openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryLanguages.java openjpa/branches/sql-cache/openjpa-kernel/src/main/resources/org/apache/openjpa/util/localizer.properties openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestNativeQueryParameterBinding.java openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java Modified: openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java?rev=693341&r1=693340&r2=693341&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java (original) +++ openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreManager.java Mon Sep 8 19:03:37 2008 @@ -736,7 +736,8 @@ ExpressionParser ep = QueryLanguages.parserForLanguage(language); if (ep != null) return new JDBCStoreQuery(this, ep); - if (QueryLanguages.LANG_SQL.equals(language)) + if (QueryLanguages.LANG_SQL.equals(language) + || QueryLanguages.LANG_PREPARED_SQL.equals(language)) return new SQLStoreQuery(this); return null; } Modified: openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreQuery.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreQuery.java?rev=693341&r1=693340&r2=693341&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreQuery.java (original) +++ openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/JDBCStoreQuery.java Mon Sep 8 19:03:37 2008 @@ -658,14 +658,27 @@ idx++; } } - - String[] sql = new String[sels.size()]; + // add a sentinel null String to denote that extra SQL will be + // required during execution + String[] sql = new String[sels.size() + (hasExtraSQL(sels) ? 1 : 0)]; for (int i = 0; i < sels.size(); i++) sql[i] = ((Select) sels.get(i)).toSelect(false, fetch).getSQL(true); return sql; } /** + * Affirms if any of the given Selects will require extra Select to load + * requisite data + */ + boolean hasExtraSQL(List sels) { + for (Object sel : sels) { + if (sel instanceof Select && ((Select)sel).hasNewEagerSelects()) + return true; + } + return false; + } + + /** * This method is to provide override for non-JDBC or JDBC-like * implementation of executing update. */ Modified: openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java?rev=693341&r1=693340&r2=693341&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java (original) +++ openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java Mon Sep 8 19:03:37 2008 @@ -33,6 +33,7 @@ import java.util.List; import java.util.Set; +import org.apache.commons.collections.map.LinkedMap; import org.apache.commons.lang.StringUtils; import org.apache.openjpa.jdbc.meta.ClassMapping; import org.apache.openjpa.jdbc.meta.MappingRepository; @@ -409,5 +410,40 @@ throws SQLException { return stmnt.executeQuery(); } + + /** + * Counts number of bind parameter marker <code>'?'</code> in the + * query string. The type of these parameters are unknown but the + * count can be used. + */ + public LinkedMap getParameterTypes(StoreQuery q) { + int count = -1; + try { + count = countParamMarker(q.getContext().getQueryString()); + } catch (IOException e) { + + } + LinkedMap map = new LinkedMap(); + for (int i = 0; i < count; i++) { + map.put(i+1, null); + } + return map; + } + + private static int countParamMarker(String sql) throws IOException { + if (sql.indexOf("?") == -1) + return 0; + + StreamTokenizer tok = new StreamTokenizer(new StringReader(sql)); + tok.resetSyntax(); + tok.quoteChar('\''); + tok.wordChars('?', '?'); + int count = 0; + for (int ttype; (ttype = tok.nextToken()) != StreamTokenizer.TT_EOF;) { + if (ttype == StreamTokenizer.TT_WORD && "?".equals(tok.sval)) + count++; + } + return count; + } } } Modified: openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Param.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Param.java?rev=693341&r1=693340&r2=693341&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Param.java (original) +++ openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/exps/Param.java Mon Sep 8 19:03:37 2008 @@ -123,9 +123,9 @@ SQLBuffer sql, int index) { ParamExpState pstate = (ParamExpState) state; if (pstate.otherLength > 1) - sql.appendValue(((Object[]) pstate.sqlValue)[index], + sql.appendBindParameter(((Object[]) pstate.sqlValue)[index], pstate.getColumn(index)); else - sql.appendValue(pstate.sqlValue, pstate.getColumn(index)); + sql.appendBindParameter(pstate.sqlValue, pstate.getColumn(index)); } } Modified: openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/LogicalUnion.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/LogicalUnion.java?rev=693341&r1=693340&r2=693341&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/LogicalUnion.java (original) +++ openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/LogicalUnion.java Mon Sep 8 19:03:37 2008 @@ -819,6 +819,10 @@ SelectExecutor ex = sel.getEager(key); return (ex == sel) ? this : ex; } + + public boolean hasNewEagerSelects() { + return sel.hasNewEagerSelects(); + } public Joins newJoins() { return sel.newJoins(); Modified: openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLBuffer.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLBuffer.java?rev=693341&r1=693340&r2=693341&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLBuffer.java (original) +++ openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLBuffer.java Mon Sep 8 19:03:37 2008 @@ -25,6 +25,7 @@ import java.sql.ResultSet; import java.sql.SQLException; import java.util.ArrayList; +import java.util.BitSet; import java.util.Collections; import java.util.Iterator; import java.util.List; @@ -33,7 +34,6 @@ import org.apache.openjpa.jdbc.kernel.JDBCFetchConfiguration; import org.apache.openjpa.jdbc.kernel.exps.Val; import org.apache.openjpa.jdbc.schema.Column; -import org.apache.openjpa.jdbc.schema.ForeignKey; import org.apache.openjpa.jdbc.schema.Sequence; import org.apache.openjpa.jdbc.schema.Table; import serp.util.Numbers; @@ -41,22 +41,33 @@ /** * Buffer for SQL statements that can be used to create * java.sql.PreparedStatements. + * + * The buffer holds both the literals and bind variables in the same parameter + * list and substitutes them to PreparedStatement. However, a bind variable + * is distinguished from the literals by a bit mask on the index of the list + * index. * * @author Marc Prud'hommeaux * @author Abe White + * @author Pinaki Poddar * @since 0.2.4 */ public final class SQLBuffer implements Serializable, Cloneable { private static final String PARAMETER_TOKEN = "?"; - + private static final char PARAMETER_TOKEN_CHAR = '?'; + private static final String SINGLE_QUOTE = "'"; + private static final String NULL_STRING = "NULL"; + private static final String OPEN_BRACKET = "("; + private static final String CLOSE_BRACKET = ")"; + private final DBDictionary _dict; private final StringBuffer _sql = new StringBuffer(); private List _subsels = null; private List _params = null; + private BitSet _varIndex = null; private List _cols = null; - private List _nonFKParams = null; /** * Default constructor. @@ -123,8 +134,10 @@ _sql.insert(sqlIndex, buf._sql.toString()); if (buf._params != null) { - if (_params == null) + if (_params == null) { _params = new ArrayList(); + _varIndex = new BitSet(); + } if (_cols == null && buf._cols != null) { _cols = new ArrayList(); while (_cols.size() < _params.size()) @@ -133,6 +146,8 @@ if (paramIndex == _params.size()) { _params.addAll(buf._params); + for (int i = 0; i < buf._varIndex.size(); i++) + _varIndex.set(paramIndex + i, buf._varIndex.get(i)); if (buf._cols != null) _cols.addAll(buf._cols); else if (_cols != null) @@ -140,6 +155,11 @@ _cols.add(null); } else { _params.addAll(paramIndex, buf._params); + for (int i = 0; i < buf._varIndex.size(); i++) { + _varIndex.set(paramIndex + i + buf._varIndex.size(), + _varIndex.get(paramIndex+i)); + _varIndex.set(paramIndex + i, buf._varIndex.get(i)); + } if (buf._cols != null) _cols.addAll(paramIndex, buf._cols); else if (_cols != null) @@ -147,11 +167,6 @@ _cols.add(paramIndex, null); } } - if (buf._nonFKParams != null) { - if (_nonFKParams == null) - _nonFKParams = new ArrayList(); - _nonFKParams.addAll(buf._nonFKParams); - } } public SQLBuffer append(Table table) { @@ -193,14 +208,14 @@ */ private SQLBuffer append(Select sel, JDBCFetchConfiguration fetch, boolean count) { - _sql.append("("); + _sql.append(OPEN_BRACKET); Subselect sub = new Subselect(); sub.select = sel; sub.fetch = fetch; sub.count = count; sub.sqlIndex = _sql.length(); sub.paramIndex = (_params == null) ? 0 : _params.size(); - _sql.append(")"); + _sql.append(CLOSE_BRACKET); if (_subsels == null) _subsels = new ArrayList(2); @@ -224,6 +239,13 @@ } return false; } + + /** + * Appends a bind variable. + */ + public SQLBuffer appendBindParameter(Object o, Column col) { + return appendValue(o, col, true); + } /** * Append a parameter value. @@ -231,13 +253,17 @@ public SQLBuffer appendValue(Object o) { return appendValue(o, null); } - + + public SQLBuffer appendValue(Object o, Column col) { + return appendValue(o, col, false); + } + /** * Append a parameter value for a specific column. */ - public SQLBuffer appendValue(Object o, Column col) { + public SQLBuffer appendValue(Object o, Column col, boolean isParam) { if (o == null) - _sql.append("NULL"); + _sql.append(NULL_STRING); else if (o instanceof Raw) _sql.append(o.toString()); else { @@ -245,37 +271,20 @@ // initialize param and col lists; we hold off on col list until // we get the first non-null col - if (_params == null) + if (_params == null) { _params = new ArrayList(); + _varIndex = new BitSet(); + } if (col != null && _cols == null) { _cols = new ArrayList(); while (_cols.size() < _params.size()) _cols.add(null); } + _varIndex.set(_params.size(), isParam); _params.add(o); if (_cols != null) _cols.add(col); - if (col == null) - return this; - boolean isFK = false; - ForeignKey[] fks = col.getTable().getForeignKeys(); - for (int i = 0; i < fks.length; i++) { - Column[] cols = fks[i].getColumns(); - for (int j = 0; j < cols.length; j++) { - if (cols[j] == col) { - isFK = true; - break; - } - } - if (isFK) - break; - } - if (!isFK) { - if (_nonFKParams == null) - _nonFKParams = new ArrayList(); - _nonFKParams.add(o); - } } return this; } @@ -399,21 +408,16 @@ return (_params == null) ? Collections.EMPTY_LIST : _params; } - public List getNonFKParameters() { - return (_nonFKParams == null) ? Collections.EMPTY_LIST : _nonFKParams; - } /** * Return the SQL for this buffer. */ public String getSQL() { return getSQL(false); } - + /** * Returns the SQL for this buffer. * - * @param replaceParams if true, then replace parameters with the - * actual parameter values */ public String getSQL(boolean replaceParams) { resolveSubselects(); @@ -423,21 +427,26 @@ StringBuffer buf = new StringBuffer(); Iterator pi = _params.iterator(); + int iParam = 0; for (int i = 0; i < sql.length(); i++) { - if (sql.charAt(i) != '?') { + if (sql.charAt(i) != PARAMETER_TOKEN_CHAR) { buf.append(sql.charAt(i)); continue; } - Object param = pi.hasNext() ? pi.next() : null; + // bind parameter variables are never replaced + if (_varIndex.get(iParam++)) { + buf.append(PARAMETER_TOKEN); + continue; + } if (param == null) - buf.append("NULL"); + buf.append(NULL_STRING); else if (param instanceof Number || param instanceof Boolean) buf.append(param); else if (param instanceof String || param instanceof Character) - buf.append("'").append(param).append("'"); + buf.append(SINGLE_QUOTE).append(param).append(SINGLE_QUOTE); else - buf.append("?"); + buf.append(PARAMETER_TOKEN); } return buf.toString(); } @@ -598,7 +607,7 @@ _dict.setUnknown(ps, i + 1, _params.get(i), col); } } - + public int hashCode() { int hash = _sql.hashCode(); return (_params == null) ? hash : hash ^ _params.hashCode(); @@ -629,7 +638,7 @@ * @param val */ public void addCastForParam(String oper, Val val) { - if (_sql.charAt(_sql.length() - 1) == '?') { + if (_sql.charAt(_sql.length() - 1) == PARAMETER_TOKEN_CHAR) { String castString = _dict.addCastAsType(oper, val); if (castString != null) _sql.replace(_sql.length() - 1, _sql.length(), castString); Modified: openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/Select.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/Select.java?rev=693341&r1=693340&r2=693341&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/Select.java (original) +++ openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/Select.java Mon Sep 8 19:03:37 2008 @@ -657,6 +657,11 @@ * Return the eager select for the given key. */ public SelectExecutor getEager(FieldMapping key); + + /** + * Affirms if this select will use extra selects for eager loading. + */ + public boolean hasNewEagerSelects(); /** * Return a new instance to use for joining. Modified: openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java?rev=693341&r1=693340&r2=693341&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java (original) +++ openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java Mon Sep 8 19:03:37 2008 @@ -1809,6 +1809,16 @@ public Map getEagerMap() { return _eager; } + + public boolean hasNewEagerSelects() { + if (_eager == null) + return false; + for (Object eagerRes : _eager.values()) { + if (eagerRes != this) + return true; + } + return false; + } public SelectExecutor getEager(FieldMapping key) { if (_eager == null || !_eagerKeys.contains(key)) Modified: openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfiguration.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfiguration.java?rev=693341&r1=693340&r2=693341&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfiguration.java (original) +++ openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfiguration.java Mon Sep 8 19:03:37 2008 @@ -1526,4 +1526,24 @@ * @since 1.3.0 */ public void setInitializeEagerly(boolean flag); + + /** + * Configuration settings for the Prepared Query Cache to use. + * @see PreparedQueryCacheValue + * @since 1.3.0 + */ + public String getPreparedQueryCache(); + + /** + * Configuration settings for the Prepared Query Cache to use. + * @see PreparedQueryCacheValue + * @since 1.3.0 + */ + public void setPreparedQueryCache(String cache); + + /** + * Gets the modifable map of the cached prepared query indexed by query + * String. + */ + public Map getPreparedQueryCacheInstance(); } Modified: openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java?rev=693341&r1=693340&r2=693341&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java (original) +++ openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java Mon Sep 8 19:03:37 2008 @@ -136,6 +136,7 @@ public IntValue runtimeUnenhancedClasses; public CacheMarshallersValue cacheMarshallerPlugins; public BooleanValue eagerInitialization; + public PreparedQueryCacheValue preparedQueryCachePlugin; // custom values public BrokerFactoryValue brokerFactoryPlugin; @@ -493,6 +494,13 @@ "getQueryCompilationCacheInstance"); addValue(queryCompilationCachePlugin); + preparedQueryCachePlugin = new PreparedQueryCacheValue( + "PreparedQueryCache"); + preparedQueryCachePlugin.setInstantiatingGetter( + "getPreparedQueryCacheInstance"); + addValue(preparedQueryCachePlugin); + preparedQueryCachePlugin.setDynamic(true); + runtimeUnenhancedClasses = addInt("RuntimeUnenhancedClasses"); runtimeUnenhancedClasses.setAliases(new String[] { "supported", String.valueOf( @@ -1395,6 +1403,20 @@ return (Map) queryCompilationCachePlugin.get(); } + public String getPreparedQueryCache() { + return preparedQueryCachePlugin.getString(); + } + + public void setPreparedQueryCache(String queryCompilationCache) { + preparedQueryCachePlugin.setString(queryCompilationCache); + } + + public Map getPreparedQueryCacheInstance() { + if (preparedQueryCachePlugin.get() == null) + preparedQueryCachePlugin.instantiate(Map.class, this); + return (Map) preparedQueryCachePlugin.get(); + } + public StoreFacadeTypeRegistry getStoreFacadeTypeRegistry() { return _storeFacadeRegistry; } Added: openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/PreparedQueryCacheValue.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/PreparedQueryCacheValue.java?rev=693341&view=auto ============================================================================== --- openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/PreparedQueryCacheValue.java (added) +++ openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/PreparedQueryCacheValue.java Mon Sep 8 19:03:37 2008 @@ -0,0 +1,78 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.conf; + +import java.util.Collections; +import java.util.Hashtable; +import java.util.Map; + +import org.apache.openjpa.lib.conf.Configuration; +import org.apache.openjpa.lib.conf.PluginValue; +import java.util.concurrent.ConcurrentHashMap; +import org.apache.openjpa.lib.util.ParseException; +import org.apache.openjpa.util.CacheMap; + +/** + * A cache of prepared queries indexed by an identifier. + * + * @author Pinaki Poddar + * @since 1.3.0 + * @nojavadoc + */ +public class PreparedQueryCacheValue + extends PluginValue { + + public static final String[] ALIASES = { + "true", CacheMap.class.getName(), + "all", ConcurrentHashMap.class.getName(), + "false", null, + }; + + public PreparedQueryCacheValue(String prop) { + super(prop, true); + setAliases(ALIASES); + setDefault(ALIASES[0]); + setClassName(ALIASES[1]); + } + + public Object newInstance(String clsName, Class type, + Configuration conf, boolean fatal) { + // make sure map handles concurrency + Map map; + + try { + map = (Map) super.newInstance(clsName, type, conf, fatal); + } catch (ParseException pe) { + // For comment on special classloading see QueryCompilationCacheValue + map = (Map) super.newInstance(clsName, + PreparedQueryCacheValue.class, conf, fatal); + } catch (IllegalArgumentException iae) { + map = (Map) super.newInstance(clsName, + PreparedQueryCacheValue.class, conf, fatal); + } + + if (map != null && !(map instanceof Hashtable) + && !(map instanceof CacheMap) + && !(map instanceof + org.apache.openjpa.lib.util.concurrent.ConcurrentMap) + && !(map instanceof java.util.concurrent.ConcurrentMap)) + map = Collections.synchronizedMap(map); + return map; + } +} Modified: openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryLanguages.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryLanguages.java?rev=693341&r1=693340&r2=693341&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryLanguages.java (original) +++ openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryLanguages.java Mon Sep 8 19:03:37 2008 @@ -34,6 +34,7 @@ public class QueryLanguages { public static final String LANG_SQL = "openjpa.SQL"; + public static final String LANG_PREPARED_SQL = "openjpa.SQL.Prepared"; public static final String LANG_METHODQL = "openjpa.MethodQL"; private static Map _expressionParsers = new HashMap(); Added: openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/util/ParameterMap.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/util/ParameterMap.java?rev=693341&view=auto ============================================================================== --- openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/util/ParameterMap.java (added) +++ openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/util/ParameterMap.java Mon Sep 8 19:03:37 2008 @@ -0,0 +1,393 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.util; + +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; + +import org.apache.commons.collections.map.LinkedMap; +import org.apache.openjpa.lib.util.Localizer; + +/** + * Structure for holding binding query parameters. + * + * Allows either named or positional parameter keys. The parameter key type is + * determined at the first insertion unless specified at construction. + * + * Maintains parameter ordering. + * The parameter ordering for named keys is same as the insertion order. + * Positional parameters can use an starting offset that defaults to 1. + * + * Allows to set expected types of values for each parameter. + * + * Can validate itself. + * + * Can convert a named parameter map to a positional parameter map. + * + * @author Pinaki Poddar + * + */ +public class ParameterMap implements Map { + public static enum Type {POSITIONAL, NAMED}; + + private static final Localizer _loc = + Localizer.forPackage(ParameterMap.class); + + private Map _delegate = null; + private final Map<Object,Class> _valueTypes = new HashMap<Object,Class>(); + private Type _type = null; + private final int _offset; + + /** + * Construct a map with indefinite key type and positional offset of 1. + */ + public ParameterMap() { + this(null, 1); + } + + /** + * Construct a map with indefinite key type and given positional offset. + */ + public ParameterMap(int offset) { + this(null, offset); + } + + /** + * Construct a map with indefinite key type and positional offset of 1. + */ + public ParameterMap(Type type) { + this(type, 1); + } + + /** + * Construct a map with given key type and given positional offset. + * Even if this map is not positional then the offset is used when the + * map is converted to positional map. + */ + public ParameterMap(Type type, int offset) { + setType(type); + _offset = offset; + + } + + private void setType(Type type) { + _type = type; + if (isNamed()) + _delegate = new LinkedMap(); + if (isPositional()) + _delegate = new TreeMap<Integer, Object>(); + } + + /** + * Affirms if this receiver contains named parameter keys. + * + * @return false also denotes that the parameter key type is not yet known. + * Map that are constructed with unspecified key type becomes known at + * first insertion. + * + * @see #put(Object, Object) + */ + public boolean isNamed() { + return Type.NAMED.equals(_type); + } + + + /** + * Affirms if this receiver contains positional parameter keys. + * + * @return false also denotes that the parameter key type is not yet known. + * Map that are constructed with unspecified key type becomes known at + * first insertion. + * + * @see #put(Object, Object) + */ + public boolean isPositional() { + return Type.POSITIONAL.equals(_type); + } + + /** + * Gets the enumerated key type allowed in this receiver. + */ + public Type getType() { + return _type; + } + + /** + * Clears this receiver for complete reuse. This includes clearing the + * bound values, their allowed types as well as the type of allowed keys. + */ + public void clear() { + if (_delegate == null) + return; + _delegate = null; + _valueTypes.clear(); + _type = null; + } + + /** + * Clears all the bound keys by nullifying their values. The allowed value + * type for each key and the allowed key type remain. + */ + public void clearBinding() { + if (_delegate == null) + return; + for (Object key : keySet()) + _delegate.put(key, null); + } + + /** + * Affirms if this receiver contains the given key. + */ + public boolean containsKey(Object key) { + return _delegate == null ? false : _delegate.containsKey(key); + } + + /** + * Affirms if this receiver contains the given value. + */ + public boolean containsValue(Object value) { + return _delegate == null ? null : _delegate.containsValue(value); + } + + /** + * Gets the keys known to this receiver. + */ + public Set entrySet() { + return _delegate == null ? Collections.EMPTY_SET : _delegate.entrySet(); + } + + /** + * Gets the value for the given key. + * + * @return null if the key does not exist or if the key exists with null + * value. + */ + public Object get(Object key) { + return _delegate == null ? null : _delegate.get(key); + } + + /** + * Affirms if this receiver has no key. + * + */ + public boolean isEmpty() { + return _delegate == null || _delegate.isEmpty(); + } + + /** + * Puts the given key-value pair. If this is the first key inserted and the + * key type is unspecified during construction, then the type of the given + * key determines whether this receiver will hold named or positional + * parameters. + * + * @param key must be either String or Integer and must match the allowed + * key type of this receiver unless this is a first key insertion and the + * allowed key type is unspecified at construction. + * + * @param value is validated if an allowed value type for the given key is + * set. + * + */ + public Object put(Object key, Object value) { + if (key == null) + newValidationException("param-null-key", new Object[]{}); + Type type = determineKeyType(key); + if (_type == null) { + setType(type); + } else { + if (!_type.equals(type)) + newValidationException("param-mismatch-key-type", key, + key.getClass(), _type); + + if (isPositional() && ((Integer)key).intValue() < _offset) + newValidationException("param-bad-key-index", key, _offset); + } + + assertCompatiableValue(key, value); + return _delegate.put(key, value); + } + + public void putAll(Map t) { + _delegate.putAll(t); + } + + public Object remove(Object key) { + return (_delegate == null) ? null : _delegate.remove(key); + } + + public int size() { + return (_delegate == null) ? 0 : _delegate.size(); + } + + /** + * Sets the type of value that the given key can be bound to. If a value + * exists for the key, then the value is validated against the given type. + * + * @param key the key may or may not have been bound to a value. + * @param type the type of the value that the given key can be bound to. + */ + public void setValueType(Object key, Class expectedType) { + _valueTypes.put(key, expectedType); + if (containsKey(key)) { + Object value = get(key); + assertCompatiableValue(key, value); + } + } + + /** + * Gets the type of value the given key can bind to. + * + * @return null denotes the value type for the given key is either not set + * or set to null explicitly. + * + */ + public Class getValueType(Object key) { + return _valueTypes.get(key); + } + + /** + * Gets the set of keys. The returned set has deterministic iteration order. + * For named parameter type, the resultant order is the order in which + * keys were inserted. + * For positional parameter type, the resultant order is the natural order + * of the key indices. + */ + public Set keySet() { + return (_delegate == null) ? Collections.EMPTY_SET : _delegate.keySet(); + } + + /** + * Gets the values. The returned collection has deterministic iteration + * order. + * For named parameter type, the resultant order is the order in which + * key-value pairs were inserted. + * For positional parameter type, the resultant order is the natural order + * of the key indices. + * + */ + public Collection values() { + return (_delegate == null) ? Collections.EMPTY_SET : _delegate.values(); + } + + /** + * Get the unmodifable map of key-value in deterministic iteration order. + * For named parameter type, the resultant order is the order in which + * key-value pairs were inserted. + * For positional parameter type, the resultant order is the natural order + * of the key indices. + */ + public Map getMap() { + return isEmpty() ? Collections.EMPTY_MAP : + Collections.unmodifiableMap(_delegate); + } + + /** + * Create a positional map as a copy of this receiver. + * If this receiver is a named map, then the new positional map will have + * integer keys corresponding to insertion order of the original keys. + * + */ + public ParameterMap toPositional() { + ParameterMap positional = new ParameterMap(Type.POSITIONAL, _offset); + Set keys = keySet(); + int i = _offset; + for (Object key : keys) { + Object newKey = (isNamed()) ? new Integer(i++) : key; + positional.put(newKey, get(key)); + Class expectedType = getValueType(key); + if (_valueTypes.containsKey(key)) + setValueType(newKey, expectedType); + } + return positional; + } + + /** + * Validate the parameters against a set of expected parameter types. + * If strict then also checks that each given expected key exists in + * this receiver. + */ + public boolean validate(LinkedMap expected, boolean strict) { + if (expected.size() != size()) + newValidationException("param-invalid-size", + expected.size(), expected, size(), getMap()); + if (!strict) return true; + for (Object key : expected.keySet()) { + key = isNamed() ? key.toString() : Integer.parseInt(key.toString()); + if (!containsKey(key)) + newValidationException("param-missing", key, expected, getMap()); + } + return true; + } + + void assertCompatiableValue(Object key, Object value) { + Class expected = _valueTypes.get(key); + if (expected == null) + return; + if (value == null) { + if (expected.isPrimitive()) + newValidationException("param-null-primitive", key, expected); + return; + } + if (expected.isPrimitive()) { + if (unwrap(value.getClass()) != expected) + newValidationException("param-mismatch-value-type", + key, value, value.getClass(), expected); + } else if (!expected.isAssignableFrom(value.getClass())) { + newValidationException("param-mismatch-value-type", + key, value, value.getClass(), expected); + } + } + + private Type determineKeyType(Object key) { + if (key instanceof Integer) + return Type.POSITIONAL; + else if (key instanceof String) + return Type.NAMED; + else + newValidationException("param-bad-key-type", key, key.getClass()); + return null;//unreachable + } + + + Class unwrap(Class c) { + if (c == null) + return c; + if (c == Boolean.class) return boolean.class; + if (c == Byte.class) return byte.class; + if (c == Character.class) return char.class; + if (c == Double.class) return double.class; + if (c == Float.class) return float.class; + if (c == Integer.class) return int.class; + if (c == Long.class) return long.class; + if (c == Short.class) return short.class; + return c; + } + + public String toString() { + return _type + " values " + _delegate + " types " + _valueTypes; + } + + void newValidationException(String msgKey, Object... args) { + throw new IllegalArgumentException(_loc.get(msgKey, args).toString()); + } +} Modified: openjpa/branches/sql-cache/openjpa-kernel/src/main/resources/org/apache/openjpa/util/localizer.properties URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-kernel/src/main/resources/org/apache/openjpa/util/localizer.properties?rev=693341&r1=693340&r2=693341&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-kernel/src/main/resources/org/apache/openjpa/util/localizer.properties (original) +++ openjpa/branches/sql-cache/openjpa-kernel/src/main/resources/org/apache/openjpa/util/localizer.properties Mon Sep 8 19:03:37 2008 @@ -73,3 +73,17 @@ no-store-exts: No store-specific facade found matching "{0}". Using default. objectid-abstract: Cannot create new application identity instance for \ abstract class "{0}". +param-null-key: Null parameter keys are not allowed. +param-bad-key-type: Parameter key "{0}" of "{1}" is not allowed. Parameter key \ + can be either String or integer. +param-mismatch-key-type: Parameter key "{0}" of "{1}" does not match with \ + its expected "{2}". +param-bad-key-index: Parameter key "{0}" less than "{1}" is not allowed. +param-null-primitive: Parameter "{0}" is of primitive type "{1}". Its value \ + can not be null. +param-mismatch-value-type: Parameter "{0}" can not be set to "{1}" of "{2}" \ + as the expected value type is "{3}". +param-invalid_size: Expected {0} parameter(s) of type "{1}" is different in \ + number than available {2} parameter(s) of type "{3}". +param-missing: Parameter "{0}" is missing in expected parameter(s) of type \ + "{1}". Available parameters are "{2}". \ No newline at end of file Added: openjpa/branches/sql-cache/openjpa-kernel/src/test/java/org/apache/openjpa/kernel/TestParameterMap.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-kernel/src/test/java/org/apache/openjpa/kernel/TestParameterMap.java?rev=693341&view=auto ============================================================================== --- openjpa/branches/sql-cache/openjpa-kernel/src/test/java/org/apache/openjpa/kernel/TestParameterMap.java (added) +++ openjpa/branches/sql-cache/openjpa-kernel/src/test/java/org/apache/openjpa/kernel/TestParameterMap.java Mon Sep 8 19:03:37 2008 @@ -0,0 +1,286 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.kernel; + +import java.util.Iterator; +import java.util.Map; + +import org.apache.openjpa.util.ParameterMap; + +import junit.framework.TestCase; + +/** + * Test the properties of ParameterMap. + * + * @author Pinaki Poddar + * + */ +public class TestParameterMap extends TestCase { + protected void setUp() throws Exception { + super.setUp(); + } + + protected void tearDown() throws Exception { + super.tearDown(); + } + + public void testTypeIsDeterminedOnFirstInsertion() { + ParameterMap m1 = new ParameterMap(); + assertFalse(m1.isNamed()); + assertFalse(m1.isPositional()); + m1.put("key", "value"); + assertTrue(m1.isNamed()); + assertFalse(m1.isPositional()); + + ParameterMap m2 = new ParameterMap(); + assertFalse(m2.isNamed()); + assertFalse(m2.isPositional()); + m2.put(1, "value"); + assertFalse(m2.isNamed()); + assertTrue(m2.isPositional()); + } + + public void testTypeIsDeterminedOnConstruction() { + assertTrue(new ParameterMap(ParameterMap.Type.NAMED).isNamed()); + assertTrue(new ParameterMap(ParameterMap.Type.POSITIONAL).isPositional()); + + } + + public void testConvertNamedToPositional() { + ParameterMap m = new ParameterMap(); + m.put("key1", "value1"); + m.put("key2", "value2"); + + ParameterMap positional = m.toPositional(); + assertTrue(positional.isPositional()); + assertEquals("value1", positional.get(1)); + assertEquals("value2", positional.get(2)); + } + + public void testConvertPositionalToPositional() { + ParameterMap m = new ParameterMap(); + m.put(2, "value2"); + m.put(1, "value1"); + + ParameterMap positional = m.toPositional(); + assertTrue(positional.isPositional()); + assertEquals("value1", positional.get(1)); + assertEquals("value2", positional.get(2)); + } + + public void testNamedKeysAreInInsertionOrder() { + ParameterMap m = new ParameterMap(); + m.put("key1", "value1"); + m.put("key2", "value2"); + + Iterator keys = m.keySet().iterator(); + assertEquals("key1", keys.next()); + assertEquals("key2", keys.next()); + + // Update an old key and insert a new one + m.put("key1", "new value in old key"); + m.put("key3", "new value"); + keys = m.keySet().iterator(); + assertEquals("key1", keys.next()); + assertEquals("key2", keys.next()); + assertEquals("key3", keys.next()); + + } + + public void testNamedValuesInInsertionOrder() { + ParameterMap map = new ParameterMap(); + map.put("key1", "value1"); + map.put("key2", "value2"); + Iterator values = map.values().iterator(); + assertEquals("value1", values.next()); + assertEquals("value2", values.next()); + + // Update an old key and insert a new one + map.put("key1", "new value in old key"); + map.put("key3", "new value"); + values = map.values().iterator(); + assertEquals("new value in old key", values.next()); + assertEquals("value2", values.next()); + assertEquals("new value", values.next()); + } + + public void testNamedMapInInsertionOrder() { + ParameterMap map = new ParameterMap(); + map.setValueType("key1", int.class); + map.setValueType("key2", String.class); + + map.put("key1", 5); + map.put("key2", "value2"); + + Iterator entries = map.getMap().entrySet().iterator(); + for (int i = 0; i < 2; i++) { + Map.Entry entry = (Map.Entry)entries.next(); + if (i == 0) assertTrue("key1".equals(entry.getKey()) && entry.getValue().equals(5)); + if (i == 1) assertTrue("key2".equals(entry.getKey()) && entry.getValue().equals("value2")); + } + + map.put("key1", 10); + map.put("key3", "value3"); + entries = map.getMap().entrySet().iterator(); + for (int i = 0; i < 3; i++) { + Map.Entry entry = (Map.Entry)entries.next(); + if (i == 0) assertTrue("key1".equals(entry.getKey()) && entry.getValue().equals(10)); + if (i == 1) assertTrue("key2".equals(entry.getKey()) && entry.getValue().equals("value2")); + if (i == 2) assertTrue("key3".equals(entry.getKey()) && entry.getValue().equals("value3")); + } + } + + public void testNamedParameterWithWrongTypeBefore() { + ParameterMap map = new ParameterMap(); + map.setValueType("key1", int.class); + map.setValueType("key2", String.class); + map.setValueType("key3", Integer.class); + map.setValueType("key4", Integer.class); + + map.put("key1", 5); + try { + map.put("key2", 7); + fail(); + } catch (IllegalArgumentException ex) { + // good + } + map.put("key3", new Integer(7)); + map.put("key4", 8); + map.put("key1", new Integer(9)); + } + + public void testNamedParameterWithWrongTypeAfter() { + ParameterMap map = new ParameterMap(); + map.put("key1", 5); + map.put("key2", 7); + map.setValueType("key1", int.class); + + try { + map.setValueType("key2", String.class); + fail(); + } catch (IllegalArgumentException ex) { + + } + + map.put("key3", new Integer(7)); + map.put("key4", 8); + map.setValueType("key3", Integer.class); + map.setValueType("key4", Integer.class); + } + + public void testPositionalParameterWithoutSpecificType() { + ParameterMap map = new ParameterMap(); + map.put(1, "value1"); + map.put(2, "value2"); + assertFalse(map.isNamed()); + assertEquals(2, map.size()); + Iterator values = map.values().iterator(); + assertEquals("value1", values.next()); + assertEquals("value2", values.next()); + + map.put(1, "new value in old key"); + values = map.values().iterator(); + assertEquals("new value in old key", values.next()); + assertEquals("value2", values.next()); + } + + public void testPositionalParameterWithSpecificType() { + ParameterMap map = new ParameterMap(); + map.setValueType(1, int.class); + map.setValueType(2, String.class); + + map.put(1, 5); + map.put(2, "value2"); + assertFalse(map.isNamed()); + assertEquals(2, map.size()); + Iterator values = map.values().iterator(); + assertEquals(5, values.next()); + assertEquals("value2", values.next()); + + map.put(1, 10); + values = map.values().iterator(); + assertEquals(10, values.next()); + assertEquals("value2", values.next()); + } + + public void testPositionalParameterWithWrongTypeBefore() { + ParameterMap map = new ParameterMap(); + map.setValueType(1, int.class); + map.setValueType(2, String.class); + map.setValueType(3, Integer.class); + map.setValueType(4, Integer.class); + + map.put(1, 5); + try { + map.put(2, 7); + fail(); + } catch (IllegalArgumentException ex) { + + } + map.put(3, new Integer(7)); + map.put(4, 8); + map.put(1, new Integer(9)); + } + + public void testPositionalParameterWithWrongTypeAfter() { + ParameterMap map = new ParameterMap(); + map.put(1, 5); + map.put(2, 7); + map.setValueType(1, int.class); + + try { + map.setValueType(2, String.class); + fail(); + } catch (IllegalArgumentException ex) { + + } + + map.put(3, new Integer(7)); + map.put(4, 8); + map.setValueType(3, Integer.class); + map.setValueType(4, Integer.class); + } + + public void testPositionalParameterInsertedInRandomOrder() { + ParameterMap map = new ParameterMap(); + map.put(3, 30); + map.put(1, 10); + map.put(2, 20); + map.put(5, 50); + map.put(4, 40); + Iterator values = map.values().iterator(); + assertEquals(10, values.next()); + assertEquals(20, values.next()); + assertEquals(30, values.next()); + assertEquals(40, values.next()); + assertEquals(50, values.next()); + } + + public void testPositionalParameterInsertedWithGap() { + ParameterMap map = new ParameterMap(); + map.put(3, 30); + map.put(2, 20); + map.put(5, 50); + Iterator values = map.values().iterator(); + assertEquals(20, values.next()); + assertEquals(30, values.next()); + assertEquals(50, values.next()); + } + +} Modified: openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestNativeQueryParameterBinding.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestNativeQueryParameterBinding.java?rev=693341&r1=693340&r2=693341&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestNativeQueryParameterBinding.java (original) +++ openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/query/TestNativeQueryParameterBinding.java Mon Sep 8 19:03:37 2008 @@ -21,8 +21,6 @@ import javax.persistence.EntityManager; import javax.persistence.Query; -import org.apache.openjpa.persistence.jdbc.query.domain.Applicant; -import org.apache.openjpa.persistence.jdbc.query.domain.Application; import org.apache.openjpa.persistence.test.SingleEMFTestCase; /** Added: openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/Address.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/Address.java?rev=693341&view=auto ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/Address.java (added) +++ openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/Address.java Mon Sep 8 19:03:37 2008 @@ -0,0 +1,86 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.persistence.jdbc.sqlcache; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; + +@Entity +public class Address { + @Id + @GeneratedValue + private long id; + + private String street; + + private String city; + + private String state; + + private int zip; + + public Address() { + + } + + public Address(String street, String city, String state, int zip) { + super(); + this.street = street; + this.city = city; + this.state = state; + this.zip = zip; + } + + public String getStreet() { + return street; + } + + public void setStreet(String street) { + this.street = street; + } + + public String getCity() { + return city; + } + + public void setCity(String city) { + this.city = city; + } + + public String getState() { + return state; + } + + public void setState(String state) { + this.state = state; + } + + public int getZip() { + return zip; + } + + public void setZip(int zip) { + this.zip = zip; + } + + public long getId() { + return id; + } +} Added: openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/Company.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/Company.java?rev=693341&view=auto ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/Company.java (added) +++ openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/Company.java Mon Sep 8 19:03:37 2008 @@ -0,0 +1,60 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.persistence.jdbc.sqlcache; + +import java.util.Collection; +import java.util.HashSet; + +import javax.persistence.*; + +@Entity +public class Company { + @Id + @GeneratedValue + private long id; + + private String name; + + @OneToMany(mappedBy="company", cascade=CascadeType.ALL) + private Collection<Department> departments = new HashSet<Department>(); + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Collection<Department> getDepartments() { + return departments; + } + + public void addDepartment(Department dept) { + this.departments.add(dept); + dept.setCompany(this); + } + + public long getId() { + return id; + } + + + +} Added: openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/Department.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/Department.java?rev=693341&view=auto ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/Department.java (added) +++ openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/Department.java Mon Sep 8 19:03:37 2008 @@ -0,0 +1,70 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.persistence.jdbc.sqlcache; + +import java.util.Collection; +import java.util.HashSet; + +import javax.persistence.*; + +@Entity +public class Department { + @Id + @GeneratedValue + private long id; + + private String name; + + @ManyToOne + private Company company; + + @OneToMany + private Collection<Employee> employees = new HashSet<Employee>(); + + public Company getCompany() { + return company; + } + + public void setCompany(Company company) { + this.company = company; + } + + public Collection<Employee> getEmployees() { + return employees; + } + + public void addEmployees(Employee emp) { + this.employees.add(emp); + emp.setDepartment(this); + } + + public long getId() { + return id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + +} Added: openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/Employee.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/Employee.java?rev=693341&view=auto ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/Employee.java (added) +++ openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/Employee.java Mon Sep 8 19:03:37 2008 @@ -0,0 +1,65 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.persistence.jdbc.sqlcache; + +import javax.persistence.*; + +@Entity +public class Employee { + @Id + @GeneratedValue + private long id; + + private String name; + + @ManyToOne + private Department department; + + @OneToOne + private Address address; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Department getDepartment() { + return department; + } + + public void setDepartment(Department department) { + this.department = department; + } + + public Address getAddress() { + return address; + } + + public void setAddress(Address address) { + this.address = address; + } + + public long getId() { + return id; + } + +} Added: openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java?rev=693341&view=auto ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java (added) +++ openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java Mon Sep 8 19:03:37 2008 @@ -0,0 +1,180 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.persistence.jdbc.sqlcache; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +import org.apache.openjpa.conf.OpenJPAConfiguration; +import org.apache.openjpa.persistence.OpenJPAEntityManager; +import org.apache.openjpa.persistence.OpenJPAQuery; +import org.apache.openjpa.persistence.PreparedQuery; +import org.apache.openjpa.persistence.test.SingleEMFTestCase; + +/** + * Performance oriented test to see comparative difference in response time with + * or with SQL caching. + * + * @author Pinaki Poddar + * + */ +public class TestPreparedQueryCache extends SingleEMFTestCase { + public static final int SAMPLE_SIZE = 100; + public static final long NANOS_TO_MILLS = 1000*1000; + public static final boolean QUERY_CACHE = true; + public static final String[] COMPANY_NAMES = { "acme.org" }; + public static final String[] DEPARTMENT_NAMES = { "Marketing", "Sales", + "Engineering" }; + public static final String[] EMPLOYEE_NAMES = { "Tom", "Dick", "Harray" }; + + public void setUp() throws Exception { + super.setUp(Company.class, Department.class, Employee.class, + Address.class, "openjpa.Log", "SQL=WARN"); + } + + public void tearDown() throws Exception { + super.tearDown(); + } + + public void testPreparedQueryCacheIsActiveByDefault() { + OpenJPAConfiguration conf = emf.getConfiguration(); + assertEquals("true", conf.getPreparedQueryCache()); + assertNotNull(conf.getPreparedQueryCacheInstance()); + } + + public void testPreparedQueryCacheCanBeDeactivatedDynamically() { + OpenJPAConfiguration conf = emf.getConfiguration(); + assertNotNull(conf.getPreparedQueryCacheInstance()); + conf.setPreparedQueryCache("false"); + assertNull(conf.getPreparedQueryCacheInstance()); + } + + public void testSimpleQueryCache() { + compare("select p from Company p"); + } + + public void testQueryWithLiteral() { + compare("select p from Company p where p.name = 'PObject'"); + } + + public void testQueryWithParameter() { + compare("select p from Company p where p.name = :param", + "param", "x"); + } + + public void testJoins() { + compare("select e from Employee e " + "where e.name = :emp " + + "and e.department.name = :dept " + + "and e.department.company.name = :company " + + "and e.address.zip = :zip", + + "emp", "John", + "dept", "Engineering", + "company", "acme.org", + "zip", 12345); + } + + /** + * Compare the result of execution of the same query with and without + * Prepared Query Cache. + * + */ + void compare(String jpql, Object... params) { + // run the query once for warming up + run(jpql, params, !QUERY_CACHE, 1); + + // run N times without cache + long without = run(jpql, params, !QUERY_CACHE, SAMPLE_SIZE); + + // run N times with cache + long with = run(jpql, params, QUERY_CACHE, SAMPLE_SIZE); + + long delta = (without == 0) ? 0 : (without - with) * 100 / without; + + String sql = getSQL(jpql); + System.err.println("Execution time in millis for " + SAMPLE_SIZE + + " query execution with and without SQL cache:" + with + " " + + without + " (" + delta + "%)"); + System.err.println("JPQL: " + jpql); + System.err.println("SQL : " + sql); + assertFalse("change in execution time = " + delta + "%", delta < 0); + } + + /** + * Create and run a query N times with the given parameters. The time for + * each query execution is measured in nanosecond precision) and finally + * median time taken in N observation is returned in nanosecond. + * + * returns median time taken for single execution. + */ + long run(String jpql, Object[] params, boolean cache, int N) { + OpenJPAEntityManager em = emf.createEntityManager(); + em.getConfiguration().setPreparedQueryCache("" + cache); + + List<Long> stats = new ArrayList<Long>(); + for (int i = 0; i < N; i++) { + long start = System.nanoTime(); + OpenJPAQuery q = em.createQuery(jpql); + for (int j = 0; params != null && j < params.length - 1; j += 2) { + String key = params[j].toString(); + Object val = params[j + 1]; + if (val instanceof String) + q.setParameter(key, val + "-" + i); + else if (val instanceof Integer) + q.setParameter(key, ((Integer) val).intValue() + i); + else + q.setParameter(key, val); + } + q.getResultList(); + q.closeAll(); + long end = System.nanoTime(); + stats.add(end - start); + } + em.close(); + Collections.sort(stats); + return stats.get(N/2); + } + + public boolean isCached(String jpql) { + Map cache = emf.getConfiguration().getPreparedQueryCacheInstance(); + return cache != null && cache.get(jpql) != null + && cache.get(jpql) != PreparedQuery.NOT_CACHABLE; + } + + String getSQL(String jpql) { + Map cache = emf.getConfiguration().getPreparedQueryCacheInstance(); + return cache == null ? null : ((PreparedQuery)cache.get(jpql)).getSQL(); + } + + + + public static void main(String[] args) throws Exception { + TestPreparedQueryCache _this = new TestPreparedQueryCache(); + _this.setUp(); + String jpql = "select e from Employee e where e.name = :emp and " + + "e.department.name = :dept and " + + "e.department.company.name = :company and e.address.zip = :zip"; + Object[] params = { "emp", "John", "dept", "Engineering", "company", + "acme.org", "zip", 12345 }; + _this.run(jpql, params, true, 100); + } + +} From commits-return-3351-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Tue Sep 09 15:09:54 2008 Return-Path: <commits-return-3351-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 66634 invoked from network); 9 Sep 2008 15:09:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Sep 2008 15:09:54 -0000 Received: (qmail 19725 invoked by uid 500); 9 Sep 2008 15:09:52 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 19705 invoked by uid 500); 9 Sep 2008 15:09:51 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 19696 invoked by uid 99); 9 Sep 2008 15:09:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Sep 2008 08:09:51 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Sep 2008 15:09:01 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 6260E2388986; Tue, 9 Sep 2008 08:09:33 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r693481 - /openjpa/trunk/openjpa-project/pom.xml Date: Tue, 09 Sep 2008 15:09:33 -0000 To: commits@openjpa.apache.org From: mikedd@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080909150933.6260E2388986@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mikedd Date: Tue Sep 9 08:09:32 2008 New Revision: 693481 URL: http://svn.apache.org/viewvc?rev=693481&view=rev Log: OPENJPA-695 making nightly-upload profile more friendly. Modified: openjpa/trunk/openjpa-project/pom.xml Modified: openjpa/trunk/openjpa-project/pom.xml URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/pom.xml?rev=693481&r1=693480&r2=693481&view=diff ============================================================================== --- openjpa/trunk/openjpa-project/pom.xml (original) +++ openjpa/trunk/openjpa-project/pom.xml Tue Sep 9 08:09:32 2008 @@ -79,6 +79,10 @@ <docbook.target>${project.basedir}/target/manual</docbook.target> <docbook.version>1.67.2</docbook.version> <local.repository>${settings.localRepository}</local.repository> + + <!-- authentication for nightly uploads --> + <nightly.user.name>${user.name}</nightly.user.name> + <nightly.password>passw0rd</nightly.password> </properties> <build> @@ -303,6 +307,17 @@ </pluginRepository> </pluginRepositories> </profile> + <!-- + Upload distribution files, javadoc and manual to openjpa.apache.org/builds/latest. + This profile is designed to be run nightly by a continuous build server, but can + also be run manually. + + The nightly.user.name and nightly.password properties need to be set prior to using + this profile, ie : + $ mvn -Dnightly.user.name=mikedd -Dnightly.password=mikesPassword -Pnightly-upload package + or (using a profile defined in $user.home/.m2/settings.xml ) + $ mvn -Pnightly-upload,mikes-nightly-credentials package + --> <profile> <id>nightly-upload</id> <build> @@ -313,7 +328,7 @@ <execution> <phase>package</phase> <configuration> - <tasks> + <tasks> <mkdir dir="target/site/tempDocs"/> <unzip dest="target/site/tempDocs"> <fileset dir="target/site/downloads"> @@ -324,29 +339,23 @@ <include name="**/manual/**"/> </patternset> </unzip> - <chmod perm="g+rw"> - <fileset dir="target/site/downloads"/> - </chmod> - <!-- chmod returns 255 on the javadoc and manual dirs --> - <exec executable="chmod"> - <arg value="-R"/> - <arg value="g+w"/> - <arg value="target/site/tempDocs"/> - </exec> + <move todir="target/site/tempDocs/docs"> + <fileset dir="target/site/tempDocs/apache-openjpa-${pom.version}/docs"/> + </move> + <scp todir="${nightly.user.name}:${nightly.password}@people.apache.org:/www/openjpa.apache.org/builds/latest/downloads"> + <fileset dir="target/site/downloads"/> + </scp> - <!-- From the ant manual if we need to - preserve permissions we should use exec - --> - <exec executable="scp"> - <arg value="-rp"/> - <arg value="target/site/downloads"/> - <arg value="people.apache.org:/www/openjpa.apache.org/builds/latest/"/> - </exec> - <exec executable="scp"> - <arg value="-rp"/> - <arg value="target/site/tempDocs/apache-openjpa-${pom.version}/docs/"/> - <arg value="people.apache.org:/www/openjpa.apache.org/builds/latest/"/> - </exec> + <scp todir="${nightly.user.name}:${nightly.password}@people.apache.org:/www/openjpa.apache.org/builds/latest/docs"> + <fileset dir="target/site/tempDocs/docs"/> + </scp> + <sshexec host="people.apache.org" + username="${nightly.user.name}" + password="${nightly.password}" + command="chmod -R g+w /www/openjpa.apache.org/builds/latest"/> + <delete> + <fileset dir="target/site/tempDocs"/> + </delete> </tasks> </configuration> <goals> @@ -354,6 +363,13 @@ </goals> </execution> </executions> + <dependencies> + <dependency> + <groupId>org.apache.ant</groupId> + <artifactId>ant-jsch</artifactId> + <version>1.7.0</version> + </dependency> + </dependencies> </plugin> </plugins> </build> From commits-return-3352-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Tue Sep 09 22:51:17 2008 Return-Path: <commits-return-3352-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 68908 invoked from network); 9 Sep 2008 22:51:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Sep 2008 22:51:17 -0000 Received: (qmail 71548 invoked by uid 500); 9 Sep 2008 22:51:15 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 71492 invoked by uid 500); 9 Sep 2008 22:51:15 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 71483 invoked by uid 99); 9 Sep 2008 22:51:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Sep 2008 15:51:15 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Sep 2008 22:50:25 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id C39782388989; Tue, 9 Sep 2008 15:50:26 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r693646 - in /openjpa/branches/sql-cache: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ openjpa-persistence/src/main/java/org/apache/openjpa/persistence/ Date: Tue, 09 Sep 2008 22:50:26 -0000 To: commits@openjpa.apache.org From: ppoddar@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080909225026.C39782388989@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ppoddar Date: Tue Sep 9 15:50:25 2008 New Revision: 693646 URL: http://svn.apache.org/viewvc?rev=693646&view=rev Log: Support invalidation and switch SQL parameter marker parsing through hints Modified: openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryHints.java openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java Modified: openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java?rev=693646&r1=693645&r2=693646&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java (original) +++ openjpa/branches/sql-cache/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/SQLStoreQuery.java Tue Sep 9 15:50:25 2008 @@ -44,6 +44,7 @@ import org.apache.openjpa.jdbc.sql.SQLExceptions; import org.apache.openjpa.kernel.AbstractStoreQuery; import org.apache.openjpa.kernel.QueryContext; +import org.apache.openjpa.kernel.QueryHints; import org.apache.openjpa.kernel.StoreQuery; import org.apache.openjpa.lib.rop.RangeResultObjectProvider; import org.apache.openjpa.lib.rop.ResultObjectProvider; @@ -419,7 +420,10 @@ public LinkedMap getParameterTypes(StoreQuery q) { int count = -1; try { - count = countParamMarker(q.getContext().getQueryString()); + boolean simple = q.getContext().getFetchConfiguration() + .getHint(QueryHints.HINT_PARAM_MARKER_IN_QUERY) == null; + count = countParamMarker(q.getContext().getQueryString(), + simple); } catch (IOException e) { } @@ -430,18 +434,38 @@ return map; } - private static int countParamMarker(String sql) throws IOException { + /** + * Parse given SQL for parameter marker <code>?</code>. How to parse + * is controlled by the second boolean argument. The <em>simple</em> + * parse assumes that the given SQL string does not contain any + * <code>?</code> other than the parameter markers, which is usually + * the case and saves considerable computation time as revealed during + * profiling. + * If the user query is using <code>?</code> character within the query + * itself then the user must instruct more complex parsing to be used + * by setting a {@link QueryHints#HINT_PARAM_MARKER_IN_QUERY hint}. + */ + private static int countParamMarker(String sql, boolean simple) + throws IOException { if (sql.indexOf("?") == -1) return 0; - - StreamTokenizer tok = new StreamTokenizer(new StringReader(sql)); - tok.resetSyntax(); - tok.quoteChar('\''); - tok.wordChars('?', '?'); - int count = 0; - for (int ttype; (ttype = tok.nextToken()) != StreamTokenizer.TT_EOF;) { + int count = 0; + if (simple) { + int index = -1; + while ((index = sql.indexOf("?", index + 1)) != -1) + count++; + return count; + } else { + StreamTokenizer tok = new StreamTokenizer( + new StringReader(sql)); + tok.resetSyntax(); + tok.quoteChar('\''); + tok.wordChars('?', '?'); + for (int ttype; (ttype = tok.nextToken()) != + StreamTokenizer.TT_EOF;) { if (ttype == StreamTokenizer.TT_WORD && "?".equals(tok.sval)) count++; + } } return count; } Modified: openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryHints.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryHints.java?rev=693646&r1=693645&r2=693646&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryHints.java (original) +++ openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryHints.java Tue Sep 9 15:50:25 2008 @@ -28,4 +28,29 @@ */ public static final String HINT_RESULT_COUNT = "openjpa.hint.OptimizeResultCount"; + + /** + * Hints to signal that the JPQL/SQL query string contains a parameter + * marker <code>?</code> character. By default, the query string is parsed + * to count number of parameters assuming that all <code>?</code> characters + * designate a bind parameter. This assumption makes the parse faster. + */ + public static final String HINT_PARAM_MARKER_IN_QUERY = + "openjpa.hint.ParameterMarkerInQuery"; + + /** + * A directive to invalidate any prepared SQL that might have been cached + * against a JPQL query. The target SQL corresponding to a JPQL depends on + * several context parameters such as fetch configuration, lock mode etc. + * If a query is executed repeatedly and hence its SQL is cached for faster + * execution then if any of the contextual parameters change across query + * execution then the user must supply this hint to invalidate the cached + * SQL query. + * The alternative to monitor any such change for automatic invalidation + * has a constant performance penalty for the frequent use case where a + * query is repeatedly executed in different persistent context with the + * same fetch plan or locking. + */ + public static final String HINT_INVALIDATE_PREPARED_QUERY = + "openjpa.hint.InvalidatePreparedQuery"; } Modified: openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java?rev=693646&r1=693645&r2=693646&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java (original) +++ openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java Tue Sep 9 15:50:25 2008 @@ -28,7 +28,6 @@ import java.util.Date; import java.util.List; import java.util.Map; -import java.util.Set; import javax.persistence.FlushModeType; import javax.persistence.Query; @@ -39,6 +38,7 @@ import org.apache.openjpa.kernel.DelegatingQuery; import org.apache.openjpa.kernel.DelegatingResultList; import org.apache.openjpa.kernel.Filters; +import org.apache.openjpa.kernel.QueryHints; import org.apache.openjpa.kernel.QueryLanguages; import org.apache.openjpa.kernel.QueryOperations; import org.apache.openjpa.kernel.exps.AggregateListener; @@ -327,8 +327,6 @@ if (value instanceof String) value = Boolean.valueOf((String) value); setSubclasses(((Boolean) value).booleanValue()); - } else if ("InvalidateCache".equals(k)) { - invalidate(); } else if ("FilterListener".equals(k)) addFilterListener(Filters.hintToFilterListener(value, _query .getBroker().getClassLoader())); @@ -361,8 +359,10 @@ throw new ArgumentException(_loc.get( "bad-query-hint-value", key, value), null, null, false); - } - _query.getFetchConfiguration().setHint(key, value); + } else if (QueryHints.HINT_INVALIDATE_PREPARED_QUERY.equals(key)) { + invalidatePreparedQueryCache(); + } else + _query.getFetchConfiguration().setHint(key, value); } else throw new ArgumentException(_loc.get("bad-query-hint", key), null, null, false); @@ -588,7 +588,10 @@ return cached; } - public boolean invalidate() { + /** + * Remove this query from PreparedQueryCache. + */ + public boolean invalidatePreparedQueryCache() { Map cache = _em.getConfiguration().getPreparedQueryCacheInstance(); return cache != null && cache.remove(_id) != null; } From commits-return-3353-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Tue Sep 09 23:04:35 2008 Return-Path: <commits-return-3353-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 79319 invoked from network); 9 Sep 2008 23:04:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Sep 2008 23:04:35 -0000 Received: (qmail 79432 invoked by uid 500); 9 Sep 2008 23:04:33 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 79419 invoked by uid 500); 9 Sep 2008 23:04:33 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 79410 invoked by uid 99); 9 Sep 2008 23:04:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Sep 2008 16:04:33 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Sep 2008 23:03:43 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 125672388986; Tue, 9 Sep 2008 16:03:45 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r693652 - /openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQuery.java Date: Tue, 09 Sep 2008 23:03:44 -0000 To: commits@openjpa.apache.org From: ppoddar@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080909230345.125672388986@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ppoddar Date: Tue Sep 9 16:03:44 2008 New Revision: 693652 URL: http://svn.apache.org/viewvc?rev=693652&view=rev Log: Add @since tag Modified: openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQuery.java Modified: openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQuery.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQuery.java?rev=693652&r1=693651&r2=693652&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQuery.java (original) +++ openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQuery.java Tue Sep 9 16:03:44 2008 @@ -19,6 +19,7 @@ package org.apache.openjpa.persistence; import org.apache.openjpa.kernel.Query; +import org.apache.openjpa.kernel.QueryHints; /** * A prepared query binds a compiled query to its target SQL. @@ -29,8 +30,18 @@ * the post-compilation state of the original query is captured in this receiver * to be transferred to the executable query instance. * + * The target SQL depends on context of query execution such as fetch plan or + * lock group. No attempt is made to monitor and automatically invalidate a + * prepared SQL when the same query is executed with different context + * parameters. + * + * The user must set a {@link QueryHints#HINT_INVALIDATE_PREPARED_QUERY hint} to + * invalidate. + * * @author Pinaki Poddar * + * @since 1.3.0 + * @nojavadoc */ public class PreparedQuery { public static final PreparedQuery NOT_CACHABLE = new PreparedQuery(); @@ -42,6 +53,9 @@ boolean _subclasses = true; boolean _isProjection = false; + /** + * Private constructor to designate a null marker. + */ private PreparedQuery() { _sql = null; _id = null; @@ -78,10 +92,9 @@ // q.setIgnoreChanges(last.getIgnoreChanges()); // q.setRange(last.getStartRange(), last.getEndRange()); // q.setReadOnly(last.isReadOnly()); -// q.setResultMapping(last.getResultMappingScope(), last.getResultMappingName()); +// q.setResultMapping(last.getResultMappingScope(), +// last.getResultMappingName()); // q.setResultType(last.getResultType()); // q.setUnique(last.isUnique()); } - - } From commits-return-3354-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Wed Sep 10 00:17:31 2008 Return-Path: <commits-return-3354-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 34842 invoked from network); 10 Sep 2008 00:17:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Sep 2008 00:17:31 -0000 Received: (qmail 68664 invoked by uid 500); 10 Sep 2008 00:17:28 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 68648 invoked by uid 500); 10 Sep 2008 00:17:28 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 68639 invoked by uid 99); 10 Sep 2008 00:17:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 09 Sep 2008 17:17:28 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Sep 2008 00:16:38 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 83327238896E; Tue, 9 Sep 2008 17:17:10 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r693664 - /openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java Date: Wed, 10 Sep 2008 00:17:10 -0000 To: commits@openjpa.apache.org From: ssegu@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080910001710.83327238896E@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ssegu Date: Tue Sep 9 17:17:10 2008 New Revision: 693664 URL: http://svn.apache.org/viewvc?rev=693664&view=rev Log: OPENJPA-657 Removing DOM 3 level methods in parsing XML Modified: openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java Modified: openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java URL: http://svn.apache.org/viewvc/openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java?rev=693664&r1=693663&r2=693664&view=diff ============================================================================== --- openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java (original) +++ openjpa/branches/0.9.7-r547073/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SQLErrorCodeReader.java Tue Sep 9 17:17:10 2008 @@ -139,8 +139,9 @@ short nodeType = child.getNodeType(); if (nodeType == Node.ELEMENT_NODE) { String errorType = child.getNodeName(); - if (storeErrorTypes.containsKey(errorType)) { - String errorCodes = child.getTextContent(); + Node textNode = child.getFirstChild(); + if (storeErrorTypes.containsKey(errorType) && textNode != null){ + String errorCodes = textNode.getNodeValue(); if (!StringUtils.isEmpty(errorCodes)) { String[] codes = errorCodes.split(ERROR_CODE_DELIMITER); for (int k = 0; k < codes.length; k++ ) { From commits-return-3355-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Wed Sep 10 16:38:03 2008 Return-Path: <commits-return-3355-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 58292 invoked from network); 10 Sep 2008 16:38:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Sep 2008 16:38:03 -0000 Received: (qmail 66124 invoked by uid 500); 10 Sep 2008 16:38:00 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 66108 invoked by uid 500); 10 Sep 2008 16:38:00 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 66099 invoked by uid 99); 10 Sep 2008 16:38:00 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Sep 2008 09:38:00 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Sep 2008 16:37:10 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 83CDB2388A05; Wed, 10 Sep 2008 09:37:42 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r693888 - /openjpa/trunk/openjpa-project/pom.xml Date: Wed, 10 Sep 2008 16:37:41 -0000 To: commits@openjpa.apache.org From: mikedd@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080910163742.83CDB2388A05@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mikedd Date: Wed Sep 10 09:37:41 2008 New Revision: 693888 URL: http://svn.apache.org/viewvc?rev=693888&view=rev Log: OPENJPA-695 making nightly-upload profile more friendly. Modified: openjpa/trunk/openjpa-project/pom.xml Modified: openjpa/trunk/openjpa-project/pom.xml URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/pom.xml?rev=693888&r1=693887&r2=693888&view=diff ============================================================================== --- openjpa/trunk/openjpa-project/pom.xml (original) +++ openjpa/trunk/openjpa-project/pom.xml Wed Sep 10 09:37:41 2008 @@ -342,17 +342,20 @@ <move todir="target/site/tempDocs/docs"> <fileset dir="target/site/tempDocs/apache-openjpa-${pom.version}/docs"/> </move> - <scp todir="${nightly.user.name}:${nightly.password}@people.apache.org:/www/openjpa.apache.org/builds/latest/downloads"> + <scp todir="${nightly.user.name}:${nightly.password}@people.apache.org:/www/openjpa.apache.org/builds/latest/downloads" + trust="true"> <fileset dir="target/site/downloads"/> </scp> - <scp todir="${nightly.user.name}:${nightly.password}@people.apache.org:/www/openjpa.apache.org/builds/latest/docs"> + <scp todir="${nightly.user.name}:${nightly.password}@people.apache.org:/www/openjpa.apache.org/builds/latest/docs" + trust="true"> <fileset dir="target/site/tempDocs/docs"/> </scp> <sshexec host="people.apache.org" username="${nightly.user.name}" password="${nightly.password}" - command="chmod -R g+w /www/openjpa.apache.org/builds/latest"/> + command="chmod -R g+w /www/openjpa.apache.org/builds/latest" + trust="true"/> <delete> <fileset dir="target/site/tempDocs"/> </delete> From commits-return-3356-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Wed Sep 10 23:07:27 2008 Return-Path: <commits-return-3356-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 39233 invoked from network); 10 Sep 2008 23:07:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 10 Sep 2008 23:07:27 -0000 Received: (qmail 77839 invoked by uid 500); 10 Sep 2008 23:07:24 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 77823 invoked by uid 500); 10 Sep 2008 23:07:24 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 77813 invoked by uid 99); 10 Sep 2008 23:07:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Sep 2008 16:07:24 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Sep 2008 23:06:34 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 94251238896D; Wed, 10 Sep 2008 16:06:36 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r694057 - in /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta: ClassMappingInfo.java VersionMappingInfo.java Date: Wed, 10 Sep 2008 23:06:36 -0000 To: commits@openjpa.apache.org From: fancy@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080910230636.94251238896D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: fancy Date: Wed Sep 10 16:06:36 2008 New Revision: 694057 URL: http://svn.apache.org/viewvc?rev=694057&view=rev Log: OPENJPA-720 The pushdown sql for version columns in primary and secondary tables has unpredictable ordering in the select and from clause Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ClassMappingInfo.java openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/VersionMappingInfo.java Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ClassMappingInfo.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ClassMappingInfo.java?rev=694057&r1=694056&r2=694057&view=diff ============================================================================== --- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ClassMappingInfo.java (original) +++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/ClassMappingInfo.java Wed Sep 10 16:06:36 2008 @@ -24,6 +24,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.Iterator; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -229,7 +230,7 @@ if (cols == null) cols = Collections.EMPTY_LIST; if (_seconds == null) - _seconds = new HashMap(); + _seconds = new LinkedHashMap(); _seconds.put(tableName, cols); } Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/VersionMappingInfo.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/VersionMappingInfo.java?rev=694057&r1=694056&r2=694057&view=diff ============================================================================== --- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/VersionMappingInfo.java (original) +++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/VersionMappingInfo.java Wed Sep 10 16:06:36 2008 @@ -20,8 +20,8 @@ import java.util.ArrayList; import java.util.Arrays; -import java.util.HashMap; import java.util.HashSet; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Set; @@ -71,7 +71,7 @@ Table primaryTable = vers.getClassMapping().getTable(); List<String> secondaryTableNames = Arrays.asList(vers .getClassMapping().getMappingInfo().getSecondaryTableNames()); - Map<Table, List<Column>> assign = new HashMap<Table, List<Column>>(); + Map<Table, List<Column>> assign = new LinkedHashMap<Table, List<Column>>(); for (Column col : templates) { String tableName = col.getTableName(); Table table; From commits-return-3357-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Thu Sep 11 04:38:58 2008 Return-Path: <commits-return-3357-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 95377 invoked from network); 11 Sep 2008 04:38:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Sep 2008 04:38:58 -0000 Received: (qmail 58139 invoked by uid 500); 11 Sep 2008 04:38:55 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 58082 invoked by uid 500); 11 Sep 2008 04:38:55 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 58058 invoked by uid 99); 11 Sep 2008 04:38:55 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Sep 2008 21:38:55 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Sep 2008 04:37:54 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id B0FC1238899C; Wed, 10 Sep 2008 21:38:26 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r694111 - in /openjpa/branches/sql-cache: openjpa-kernel/src/main/java/org/apache/openjpa/conf/ openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/ ope... Date: Thu, 11 Sep 2008 04:38:25 -0000 To: commits@openjpa.apache.org From: ppoddar@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080911043826.B0FC1238899C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ppoddar Date: Wed Sep 10 21:38:24 2008 New Revision: 694111 URL: http://svn.apache.org/viewvc?rev=694111&view=rev Log: Define PreparedQueryCache and capability to invalidate and ignore PreparedQuery via Query hints when context changes Modified: openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfiguration.java openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/PreparedQueryCacheValue.java openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Broker.java openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DelegatingBroker.java openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryHints.java openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQuery.java openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java Modified: openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfiguration.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfiguration.java?rev=694111&r1=694110&r2=694111&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfiguration.java (original) +++ openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfiguration.java Wed Sep 10 21:38:24 2008 @@ -46,6 +46,7 @@ import org.apache.openjpa.lib.conf.Configuration; import org.apache.openjpa.meta.MetaDataFactory; import org.apache.openjpa.meta.MetaDataRepository; +import org.apache.openjpa.persistence.PreparedQueryCache; import org.apache.openjpa.util.ClassResolver; import org.apache.openjpa.util.ProxyManager; import org.apache.openjpa.util.StoreFacadeTypeRegistry; @@ -1528,22 +1529,22 @@ public void setInitializeEagerly(boolean flag); /** - * Configuration settings for the Prepared Query Cache to use. - * @see PreparedQueryCacheValue + * Affirms if Prepared Query Cache is activated. + * * @since 1.3.0 */ - public String getPreparedQueryCache(); + public boolean getPreparedQueryCache(); /** - * Configuration settings for the Prepared Query Cache to use. - * @see PreparedQueryCacheValue + * Sets whether Prepared Query Cache is activated. + * * @since 1.3.0 */ - public void setPreparedQueryCache(String cache); + public void setPreparedQueryCache(boolean flag); /** - * Gets the modifable map of the cached prepared query indexed by query + * Gets the modifable view of the cached prepared query indexed by query * String. */ - public Map getPreparedQueryCacheInstance(); + public PreparedQueryCache getPreparedQueryCacheInstance(); } Modified: openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java?rev=694111&r1=694110&r2=694111&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java (original) +++ openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java Wed Sep 10 21:38:24 2008 @@ -49,6 +49,7 @@ import org.apache.openjpa.lib.util.Localizer; import org.apache.openjpa.meta.MetaDataFactory; import org.apache.openjpa.meta.MetaDataRepository; +import org.apache.openjpa.persistence.PreparedQueryCache; import org.apache.openjpa.util.ClassResolver; import org.apache.openjpa.util.ImplHelper; import org.apache.openjpa.util.ProxyManager; @@ -1403,18 +1404,19 @@ return (Map) queryCompilationCachePlugin.get(); } - public String getPreparedQueryCache() { - return preparedQueryCachePlugin.getString(); + public boolean getPreparedQueryCache() { + String str = preparedQueryCachePlugin.getString(); + return str != null && str.toLowerCase().startsWith("true"); } - public void setPreparedQueryCache(String queryCompilationCache) { - preparedQueryCachePlugin.setString(queryCompilationCache); + public void setPreparedQueryCache(boolean flag) { + preparedQueryCachePlugin.setString(""+flag); } - public Map getPreparedQueryCacheInstance() { + public PreparedQueryCache getPreparedQueryCacheInstance() { if (preparedQueryCachePlugin.get() == null) - preparedQueryCachePlugin.instantiate(Map.class, this); - return (Map) preparedQueryCachePlugin.get(); + preparedQueryCachePlugin.instantiate(PreparedQueryCache.class, this); + return (PreparedQueryCache) preparedQueryCachePlugin.get(); } public StoreFacadeTypeRegistry getStoreFacadeTypeRegistry() { Modified: openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/PreparedQueryCacheValue.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/PreparedQueryCacheValue.java?rev=694111&r1=694110&r2=694111&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/PreparedQueryCacheValue.java (original) +++ openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/PreparedQueryCacheValue.java Wed Sep 10 21:38:24 2008 @@ -18,15 +18,8 @@ */ package org.apache.openjpa.conf; -import java.util.Collections; -import java.util.Hashtable; -import java.util.Map; - -import org.apache.openjpa.lib.conf.Configuration; import org.apache.openjpa.lib.conf.PluginValue; -import java.util.concurrent.ConcurrentHashMap; -import org.apache.openjpa.lib.util.ParseException; -import org.apache.openjpa.util.CacheMap; +import org.apache.openjpa.persistence.PreparedQueryCache; /** * A cache of prepared queries indexed by an identifier. @@ -39,40 +32,19 @@ extends PluginValue { public static final String[] ALIASES = { - "true", CacheMap.class.getName(), - "all", ConcurrentHashMap.class.getName(), - "false", null, + "true", PreparedQueryCache.class.getName(), + "false", null, }; - + public PreparedQueryCacheValue(String prop) { super(prop, true); setAliases(ALIASES); setDefault(ALIASES[0]); setClassName(ALIASES[1]); } - - public Object newInstance(String clsName, Class type, - Configuration conf, boolean fatal) { - // make sure map handles concurrency - Map map; - - try { - map = (Map) super.newInstance(clsName, type, conf, fatal); - } catch (ParseException pe) { - // For comment on special classloading see QueryCompilationCacheValue - map = (Map) super.newInstance(clsName, - PreparedQueryCacheValue.class, conf, fatal); - } catch (IllegalArgumentException iae) { - map = (Map) super.newInstance(clsName, - PreparedQueryCacheValue.class, conf, fatal); - } - - if (map != null && !(map instanceof Hashtable) - && !(map instanceof CacheMap) - && !(map instanceof - org.apache.openjpa.lib.util.concurrent.ConcurrentMap) - && !(map instanceof java.util.concurrent.ConcurrentMap)) - map = Collections.synchronizedMap(map); - return map; - } + + @Override + public boolean isAliasListComprehensive() { + return true; + } } Modified: openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Broker.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Broker.java?rev=694111&r1=694110&r2=694111&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Broker.java (original) +++ openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/Broker.java Wed Sep 10 21:38:24 2008 @@ -52,6 +52,14 @@ */ public void setImplicitBehavior(OpCallbacks call, RuntimeExceptionTranslator ex); + + /** + * Gets the translator for runtime exceptions. + * + * @see #setImplicitBehavior(OpCallbacks, RuntimeExceptionTranslator) + * @since 1.3.0 + */ + public RuntimeExceptionTranslator getInstanceExceptionTranslator(); /** * Return the factory that produced this broker. Modified: openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java?rev=694111&r1=694110&r2=694111&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java (original) +++ openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java Wed Sep 10 21:38:24 2008 @@ -370,7 +370,7 @@ _extrans = ex; } - RuntimeExceptionTranslator getInstanceExceptionTranslator() { + public RuntimeExceptionTranslator getInstanceExceptionTranslator() { return (_operationCount == 0) ? _extrans : null; } Modified: openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DelegatingBroker.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DelegatingBroker.java?rev=694111&r1=694110&r2=694111&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DelegatingBroker.java (original) +++ openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DelegatingBroker.java Wed Sep 10 21:38:24 2008 @@ -495,6 +495,15 @@ throw translate(re); } } + + public RuntimeExceptionTranslator getInstanceExceptionTranslator() { + try { + return _broker.getInstanceExceptionTranslator(); + } catch (RuntimeException re) { + throw translate(re); + } + } + public BrokerFactory getBrokerFactory() { try { Modified: openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java?rev=694111&r1=694110&r2=694111&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java (original) +++ openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java Wed Sep 10 21:38:24 2008 @@ -158,11 +158,24 @@ addFetchGroups(fetch.getFetchGroups()); clearFields(); addFields(fetch.getFields()); - + copyHints(fetch); // don't use setters because require active transaction _state.readLockLevel = fetch.getReadLockLevel(); _state.writeLockLevel = fetch.getWriteLockLevel(); } + + void copyHints(FetchConfiguration fetch) { + if (fetch instanceof FetchConfigurationImpl == false) + return; + FetchConfigurationImpl from = (FetchConfigurationImpl)fetch; + if (from._state == null || from._state.hints == null) + return; + if (this._state == null) + return; + if (this._state.hints == null) + this._state.hints = new HashMap(); + this._state.hints.putAll(from._state.hints); + } public int getFetchBatchSize() { return _state.fetchBatchSize; Modified: openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryHints.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryHints.java?rev=694111&r1=694110&r2=694111&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryHints.java (original) +++ openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryHints.java Wed Sep 10 21:38:24 2008 @@ -50,7 +50,29 @@ * has a constant performance penalty for the frequent use case where a * query is repeatedly executed in different persistent context with the * same fetch plan or locking. + * + * @see #HINT_IGNORE_PREPARED_QUERY */ public static final String HINT_INVALIDATE_PREPARED_QUERY = "openjpa.hint.InvalidatePreparedQuery"; + + /** + * A directive to ignore any prepared SQL that might have been cached + * against a JPQL query. The target SQL corresponding to a JPQL depends on + * several context parameters such as fetch configuration, lock mode etc. + * If a query is executed repeatedly and hence its SQL is cached for faster + * execution then if any of the contextual parameters change across query + * execution then the user must supply this hint to ignore the cached + * SQL query for the current execution. + * This is in contrast with invalidation hint that removes the cached + * version from cache altogether. + * + * The cached SQL is retained and subsequent execution of the same query + * string without this hint will reuse the cached SQL. + * + * @see #HINT_INVALIDATE_PREPARED_QUERY + */ + public static final String HINT_IGNORE_PREPARED_QUERY = + "openjpa.hint.IgnorePreparedQuery"; + } Modified: openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java?rev=694111&r1=694110&r2=694111&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java (original) +++ openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java Wed Sep 10 21:38:24 2008 @@ -23,10 +23,16 @@ import java.util.List; import java.util.Map; +import javax.persistence.EntityManager; + import org.apache.openjpa.conf.OpenJPAConfiguration; +import org.apache.openjpa.kernel.QueryHints; +import org.apache.openjpa.kernel.QueryLanguages; +import org.apache.openjpa.kernel.jpql.JPQLParser; import org.apache.openjpa.persistence.OpenJPAEntityManager; import org.apache.openjpa.persistence.OpenJPAQuery; import org.apache.openjpa.persistence.PreparedQuery; +import org.apache.openjpa.persistence.PreparedQueryCache; import org.apache.openjpa.persistence.test.SingleEMFTestCase; /** @@ -44,30 +50,176 @@ public static final String[] DEPARTMENT_NAMES = { "Marketing", "Sales", "Engineering" }; public static final String[] EMPLOYEE_NAMES = { "Tom", "Dick", "Harray" }; - + public static final String EXCLUDED_QUERY_1 = "select count(p) from Company p"; + public static final String EXCLUDED_QUERY_2 = "select count(p) from Department p"; + public static final String INCLUDED_QUERY = "select count(p) from Address p"; + public void setUp() throws Exception { super.setUp(Company.class, Department.class, Employee.class, - Address.class, "openjpa.Log", "SQL=WARN"); + Address.class, + "openjpa.Log", "SQL=WARN", + "openjpa.PreparedQueryCache", + "true(excludes='select count(p) from Company p;select count(p) from Department p')"); } public void tearDown() throws Exception { super.tearDown(); } + + PreparedQueryCache getCache() { + return emf.getConfiguration().getPreparedQueryCacheInstance(); + } public void testPreparedQueryCacheIsActiveByDefault() { OpenJPAConfiguration conf = emf.getConfiguration(); - assertEquals("true", conf.getPreparedQueryCache()); - assertNotNull(conf.getPreparedQueryCacheInstance()); + assertEquals(true, conf.getPreparedQueryCache()); + assertNotNull(getCache()); } public void testPreparedQueryCacheCanBeDeactivatedDynamically() { OpenJPAConfiguration conf = emf.getConfiguration(); - assertNotNull(conf.getPreparedQueryCacheInstance()); - conf.setPreparedQueryCache("false"); - assertNull(conf.getPreparedQueryCacheInstance()); + assertNotNull(getCache()); + conf.setPreparedQueryCache(false); + assertNull(getCache()); + } + + public void testPreparedQueryCacheIsPerUnitSingleton() { + PreparedQueryCache c1 = getCache(); + PreparedQueryCache c2 = getCache(); + assertSame(c1, c2); + } + + public void testExclusionPattern() { + List<String> patterns = getCache().getExcludes(); + OpenJPAEntityManager em = emf.createEntityManager(); + OpenJPAQuery q1 = em.createQuery(EXCLUDED_QUERY_1); + q1.getResultList(); + assertNotCached(EXCLUDED_QUERY_1); + + OpenJPAQuery q2 = em.createQuery(EXCLUDED_QUERY_2); + q2.getResultList(); + assertNotCached(EXCLUDED_QUERY_2); + + OpenJPAQuery q3 = em.createQuery(INCLUDED_QUERY); + q3.getResultList(); + assertCached(INCLUDED_QUERY); } + + void assertLanguage(OpenJPAQuery q, String lang) { + assertEquals(lang, q.getLanguage()); + } + + void assertCached(String id) { + PreparedQuery cached = getCache().get(id); + assertNotNull(getCache() + ": " + getCache().getMapView() + + " does not contain " + id, cached); + } + + void assertNotCached(String id) { + PreparedQueryCache cache = getCache(); + if (cache != null) { + assertNull(cache.get(id)); + } + } + + public void testPreparedQueryIsCachedOnExecution() { + String jpql = "select p from Company p"; + OpenJPAEntityManager em = emf.createEntityManager(); + OpenJPAQuery q1 = em.createQuery(jpql); + assertNotCached(jpql); + assertLanguage(q1, JPQLParser.LANG_JPQL); + + List result = q1.getResultList(); + assertCached(jpql); + assertLanguage(q1, JPQLParser.LANG_JPQL); + + PreparedQuery cached = getCache().get(jpql); + assertEquals(jpql, cached.getIdentifier()); + assertNotEquals(jpql, cached.getSQL()); + } + + public void testPreparedQueryIsCachedAcrossExecution() { + String jpql = "select p from Company p"; + OpenJPAEntityManager em = emf.createEntityManager(); + OpenJPAQuery q1 = em.createQuery(jpql); + assertNotCached(jpql); + assertLanguage(q1, JPQLParser.LANG_JPQL); + + + List result = q1.getResultList(); + assertCached(jpql); + assertLanguage(q1, JPQLParser.LANG_JPQL); + + // Create a new query with the same JPQL + // This is not only cached, its language is different too + OpenJPAQuery q2 = em.createQuery(jpql); + assertCached(jpql); + assertLanguage(q2, QueryLanguages.LANG_PREPARED_SQL); + } + + public void testInvalidatePreparedQueryWithHint() { + String jpql = "select p from Company p"; + OpenJPAEntityManager em = emf.createEntityManager(); + OpenJPAQuery q1 = em.createQuery(jpql); + assertNotCached(jpql); + List result = q1.getResultList(); + assertCached(jpql); + assertLanguage(q1, JPQLParser.LANG_JPQL); + + // Create a new query with the same JPQL + // This is cached on creation, its language is Prepared SQL + OpenJPAQuery q2 = em.createQuery(jpql); + assertCached(jpql); + assertLanguage(q2, QueryLanguages.LANG_PREPARED_SQL); + q2.getResultList(); + + // Now execute with hints to invalidate. + q2.setHint(QueryHints.HINT_INVALIDATE_PREPARED_QUERY, true); + // Immediately it should be removed from the cache + assertNotCached(jpql); + assertEquals(JPQLParser.LANG_JPQL, q2.getLanguage()); + q2.getResultList(); + + // Create a new query with the same JPQL + // This is not cached on creation, its language is JPQL + OpenJPAQuery q3 = em.createQuery(jpql); + assertNotCached(jpql); + assertLanguage(q3, JPQLParser.LANG_JPQL); + } + + public void testIgnorePreparedQueryWithHint() { + String jpql = "select p from Company p"; + OpenJPAEntityManager em = emf.createEntityManager(); + OpenJPAQuery q1 = em.createQuery(jpql); + assertNotCached(jpql); + List result = q1.getResultList(); + assertCached(jpql); + assertLanguage(q1, JPQLParser.LANG_JPQL); + + // Create a new query with the same JPQL + // This is cached on creation, its language is PREPARED SQL + OpenJPAQuery q2 = em.createQuery(jpql); + assertCached(jpql); + assertLanguage(q2, QueryLanguages.LANG_PREPARED_SQL); + q2.getResultList(); + + // Now execute with hints to ignore. + q2.setHint(QueryHints.HINT_IGNORE_PREPARED_QUERY, true); + // It should remain in the cache + assertCached(jpql); + // But its language should be JPQL and not PREPARED SQL + assertEquals(JPQLParser.LANG_JPQL, q2.getLanguage()); + q2.getResultList(); + + // Create a new query with the same JPQL + // This is cached on creation, its language is PREPARED SQL + OpenJPAQuery q3 = em.createQuery(jpql); + assertCached(jpql); + assertLanguage(q3, QueryLanguages.LANG_PREPARED_SQL); + } + - public void testSimpleQueryCache() { + public void testQueryWithNoParameter() { compare("select p from Company p"); } @@ -80,7 +232,7 @@ "param", "x"); } - public void testJoins() { + public void testQueryWithJoinsAndParameters() { compare("select e from Employee e " + "where e.name = :emp " + "and e.department.name = :dept " + "and e.department.company.name = :company " + @@ -98,19 +250,22 @@ * */ void compare(String jpql, Object... params) { +// if (true) return; // run the query once for warming up run(jpql, params, !QUERY_CACHE, 1); // run N times without cache long without = run(jpql, params, !QUERY_CACHE, SAMPLE_SIZE); + assertNotCached(jpql); // run N times with cache long with = run(jpql, params, QUERY_CACHE, SAMPLE_SIZE); + assertCached(jpql); long delta = (without == 0) ? 0 : (without - with) * 100 / without; String sql = getSQL(jpql); - System.err.println("Execution time in millis for " + SAMPLE_SIZE + System.err.println("Execution time in nanos for " + SAMPLE_SIZE + " query execution with and without SQL cache:" + with + " " + without + " (" + delta + "%)"); System.err.println("JPQL: " + jpql); @@ -120,14 +275,14 @@ /** * Create and run a query N times with the given parameters. The time for - * each query execution is measured in nanosecond precision) and finally - * median time taken in N observation is returned in nanosecond. + * each query execution is measured in nanosecond precision and + * median time taken in N observation is returned. * * returns median time taken for single execution. */ long run(String jpql, Object[] params, boolean cache, int N) { OpenJPAEntityManager em = emf.createEntityManager(); - em.getConfiguration().setPreparedQueryCache("" + cache); + em.getConfiguration().setPreparedQueryCache(cache); List<Long> stats = new ArrayList<Long>(); for (int i = 0; i < N; i++) { @@ -153,15 +308,13 @@ return stats.get(N/2); } - public boolean isCached(String jpql) { - Map cache = emf.getConfiguration().getPreparedQueryCacheInstance(); - return cache != null && cache.get(jpql) != null - && cache.get(jpql) != PreparedQuery.NOT_CACHABLE; - } - String getSQL(String jpql) { - Map cache = emf.getConfiguration().getPreparedQueryCacheInstance(); - return cache == null ? null : ((PreparedQuery)cache.get(jpql)).getSQL(); + PreparedQueryCache cache = emf.getConfiguration().getPreparedQueryCacheInstance(); + if (cache == null) + return "null"; + if (cache.get(jpql) != null) + return cache.get(jpql).getSQL(); + return "null"; } @@ -174,7 +327,13 @@ + "e.department.company.name = :company and e.address.zip = :zip"; Object[] params = { "emp", "John", "dept", "Engineering", "company", "acme.org", "zip", 12345 }; + System.err.println("Executing 100 times [" + jpql + "]"); + System.err.println("Press return to continue..."); +// System.in.read(); + long start = System.nanoTime(); _this.run(jpql, params, true, 100); + long end = System.nanoTime(); + System.err.println("Time taken " + (end-start) + "ns"); } } Modified: openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java?rev=694111&r1=694110&r2=694111&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java (original) +++ openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java Wed Sep 10 21:38:24 2008 @@ -32,7 +32,6 @@ import java.util.Collection; import java.util.EnumSet; import java.util.Map; -import java.util.HashMap; import java.util.IdentityHashMap; import javax.persistence.EntityManager; import javax.persistence.FlushModeType; @@ -64,7 +63,6 @@ import org.apache.openjpa.meta.SequenceMetaData; import org.apache.openjpa.util.Exceptions; import org.apache.openjpa.util.ImplHelper; -import org.apache.openjpa.util.ParameterMap; import org.apache.openjpa.util.RuntimeExceptionTranslator; import org.apache.openjpa.util.UserException; @@ -947,14 +945,15 @@ throw new ArgumentException(_loc.get("no-sql"), null, null, false); } - private PreparedQuery getPreparedQuery(String id) { - Map cache = getConfiguration().getPreparedQueryCacheInstance(); - if (cache == null) - return null; - Object val = cache.get(id); - if (val == PreparedQuery.NOT_CACHABLE) - return null; - return (PreparedQuery)val; + /** + * Gets the prepared query cached by the given key. + * + * @return the cached PreparedQuery or null if none exists. + */ + PreparedQuery getPreparedQuery(String id) { + PreparedQueryCache cache = getConfiguration() + .getPreparedQueryCacheInstance(); + return (cache == null) ? null : cache.get(id); } public void setFlushMode(FlushModeType flushMode) { Modified: openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQuery.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQuery.java?rev=694111&r1=694110&r2=694111&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQuery.java (original) +++ openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQuery.java Wed Sep 10 21:38:24 2008 @@ -44,7 +44,6 @@ * @nojavadoc */ public class PreparedQuery { - public static final PreparedQuery NOT_CACHABLE = new PreparedQuery(); private final String _sql; private final String _id; @@ -53,14 +52,6 @@ boolean _subclasses = true; boolean _isProjection = false; - /** - * Private constructor to designate a null marker. - */ - private PreparedQuery() { - _sql = null; - _id = null; - } - public PreparedQuery(String id, String sql, Query compiled) { this._id = id; this._sql = sql; Modified: openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java?rev=694111&r1=694110&r2=694111&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java (original) +++ openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java Wed Sep 10 21:38:24 2008 @@ -35,6 +35,7 @@ import org.apache.commons.collections.map.LinkedMap; import org.apache.openjpa.enhance.Reflection; +import org.apache.openjpa.kernel.Broker; import org.apache.openjpa.kernel.DelegatingQuery; import org.apache.openjpa.kernel.DelegatingResultList; import org.apache.openjpa.kernel.Filters; @@ -43,6 +44,7 @@ import org.apache.openjpa.kernel.QueryOperations; import org.apache.openjpa.kernel.exps.AggregateListener; import org.apache.openjpa.kernel.exps.FilterListener; +import org.apache.openjpa.kernel.jpql.JPQLParser; import org.apache.openjpa.lib.rop.ResultList; import org.apache.openjpa.lib.util.Localizer; import org.apache.openjpa.util.ImplHelper; @@ -64,7 +66,7 @@ private static final Localizer _loc = Localizer.forPackage(QueryImpl.class); - private final DelegatingQuery _query; + private DelegatingQuery _query; private transient EntityManagerImpl _em; private transient FetchPlan _fetch; private ParameterMap _params; @@ -359,10 +361,15 @@ throw new ArgumentException(_loc.get( "bad-query-hint-value", key, value), null, null, false); - } else if (QueryHints.HINT_INVALIDATE_PREPARED_QUERY.equals(key)) { - invalidatePreparedQueryCache(); - } else + } else if (QueryHints.HINT_INVALIDATE_PREPARED_QUERY.equals + (key)) { _query.getFetchConfiguration().setHint(key, value); + invalidatePreparedQuery(); + } else if (QueryHints.HINT_IGNORE_PREPARED_QUERY.equals(key)) { + _query.getFetchConfiguration().setHint(key, (Boolean)value); + ignorePreparedQuery(); + } else + _query.getFetchConfiguration().setHint(key, (Boolean)value); } else throw new ArgumentException(_loc.get("bad-query-hint", key), null, null, false); @@ -559,41 +566,74 @@ } /** - * Cache this query with its identifier as key and SQL as value if this - * query is amenable to caching and has not already been cached. + * Cache this query if this query is amenable to caching and has not + * already been cached. If the query can not be cached, then mark it as such + * to avoid computing for the same key again. * * @return non-null if this query has already been cached. null if it can - * not be cached or cached in this call. + * not be cached or cached in this call or hint is set to ignore the cached + * version. */ PreparedQuery cache() { - if (_id == null) + if (_id == null + || !_em.getConfiguration().getPreparedQueryCache() + || isHinted(QueryHints.HINT_IGNORE_PREPARED_QUERY) + || isHinted(QueryHints.HINT_INVALIDATE_PREPARED_QUERY)) return null; - Map cache = _em.getConfiguration().getPreparedQueryCacheInstance(); - if (cache == null) - return null; - PreparedQuery cached = (PreparedQuery)cache.get(_id); - if (cached == PreparedQuery.NOT_CACHABLE) + PreparedQueryCache cache = _em.getConfiguration() + .getPreparedQueryCacheInstance(); + if (cache.isCachable(_id) == Boolean.FALSE) return null; + PreparedQuery cached = cache.get(_id); if (cached == null) { String[] sqls = _query.getDataStoreActions(getParameterMap(true)); - boolean cacheable = sqls.length == 1; + boolean cacheable = (sqls.length == 1); if (!cacheable) { - cache.put(_id, PreparedQuery.NOT_CACHABLE); + cache.markUncachable(_id); return null; } cached = new PreparedQuery(_id, sqls[0], _query); - cache.put(_id, cached); - return null; + // Attempt to cache may fail if query matches exclusion pattern + if (!cache.cache(cached)) { + cached = null; + } } return cached; } + boolean isHinted(String hint) { + Object result = _query.getFetchConfiguration().getHint(hint); + return result != null && "true".equalsIgnoreCase(result.toString()); + } + /** * Remove this query from PreparedQueryCache. */ - public boolean invalidatePreparedQueryCache() { - Map cache = _em.getConfiguration().getPreparedQueryCacheInstance(); - return cache != null && cache.remove(_id) != null; + private boolean invalidatePreparedQuery() { + if (!_em.getConfiguration().getPreparedQueryCache()) + return false; + ignorePreparedQuery(); + PreparedQueryCache cache = _em.getConfiguration() + .getPreparedQueryCacheInstance(); + return cache.invalidate(_id); + } + + /** + * Ignores this query from PreparedQueryCache by recreating the original + * query if it has been cached. + */ + private void ignorePreparedQuery() { + PreparedQuery cached = _em.getPreparedQuery(_id); + if (cached == null) + return; + Broker broker = _em.getBroker(); + String JPQL = JPQLParser.LANG_JPQL; + String jpql = _id; + org.apache.openjpa.kernel.Query newQuery = broker.newQuery(JPQL, jpql); + newQuery.getFetchConfiguration().copy(_query.getFetchConfiguration()); + newQuery.compile(); + _query = new DelegatingQuery(newQuery, + broker.getInstanceExceptionTranslator()); } public int hashCode() { From commits-return-3358-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Thu Sep 11 04:45:59 2008 Return-Path: <commits-return-3358-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 345 invoked from network); 11 Sep 2008 04:45:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Sep 2008 04:45:59 -0000 Received: (qmail 64205 invoked by uid 500); 11 Sep 2008 04:45:56 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 64186 invoked by uid 500); 11 Sep 2008 04:45:56 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 64177 invoked by uid 99); 11 Sep 2008 04:45:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Sep 2008 21:45:56 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Sep 2008 04:45:06 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 236A62388A05; Wed, 10 Sep 2008 21:45:38 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r694115 - in /openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence: PreparedQueryCache.java QueryImpl.java Date: Thu, 11 Sep 2008 04:45:37 -0000 To: commits@openjpa.apache.org From: ppoddar@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080911044538.236A62388A05@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ppoddar Date: Wed Sep 10 21:45:37 2008 New Revision: 694115 URL: http://svn.apache.org/viewvc?rev=694115&view=rev Log: Adding new PreparedQueryCache Added: openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQueryCache.java Modified: openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java Added: openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQueryCache.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQueryCache.java?rev=694115&view=auto ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQueryCache.java (added) +++ openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQueryCache.java Wed Sep 10 21:45:37 2008 @@ -0,0 +1,231 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.persistence; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; +import java.util.TreeMap; +import java.util.concurrent.locks.ReentrantLock; + +import org.apache.commons.lang.StringUtils; +import org.apache.openjpa.kernel.QueryHints; +import org.apache.openjpa.lib.conf.Configurable; +import org.apache.openjpa.lib.conf.Configuration; + +/** + * A cache to maintain {@link PreparedQuery prepared queries}. + * + * The target SQL depends on context of query execution such as fetch plan or + * lock group. No attempt is made to monitor and automatically invalidate a + * prepared SQL when the same query is executed with different context + * parameters. + * + * The user must set a {@link QueryHints#HINT_INVALIDATE_PREPARED_QUERY hint} to + * invalidate. + * + * @author Pinaki Poddar + * + * @since 1.3.0 + * @nojavadoc + */ +public class PreparedQueryCache implements Configurable { + private static final String PATTERN_SEPARATOR = "\\;"; + + private final Map<String, PreparedQuery> _delegate; + private final Set<String> _uncachables; + private List<String> _excludes; + private ReentrantLock _lock = new ReentrantLock(); + + public PreparedQueryCache() { + _delegate = new HashMap<String, PreparedQuery>(); + _uncachables = new HashSet<String>(); + } + + /** + * Get a map view of the cached SQL indexed by query identifier. + */ + public Map<String,String> getMapView() { + lock(); + try { + Map<String, String> view = new TreeMap<String, String>(); + for (Map.Entry<String, PreparedQuery> entry : _delegate.entrySet()) + view.put(entry.getKey(), entry.getValue().getSQL()); + return view; + } finally { + unlock(); + } + } + + /** + * Cache the given PreparedQuery. + * The key is the identifier of the given PreparedQuery itself. + */ + public boolean cache(PreparedQuery q) { + lock(); + try { + if (isExcluded(q.getIdentifier())) { + markUncachable(q.getIdentifier()); + return false; + } + _delegate.put(q.getIdentifier(), q); + return true; + } finally { + unlock(); + } + } + + /** + * Remove the PreparedQuery with the given identifier. + */ + public boolean invalidate(String id) { + lock(); + try { + return _delegate.remove(id) != null; + } finally { + unlock(); + } + } + + /** + * Get the PreparedQuery with the given identifier if it exists. null + * otherwise. + */ + public PreparedQuery get(String id) { + lock(); + try { + return _delegate.get(id); + } finally { + unlock(); + } + } + + /** + * Affirms if a PreparedQuery can be cached against the given key. + * + * @return Boolean.FALSE if the given key is explicitly marked before as not + * be cached or matches any of the exclusion pattern. + * Boolean.TRUE if the given key has been in the cache. + * Otherwise, return null implying this receiver can not determine whether + * this key can be cached on not. + */ + public Boolean isCachable(String id) { + lock(); + try { + if (_uncachables.contains(id)) + return Boolean.FALSE; + if (_delegate.containsKey(id)) + return Boolean.TRUE; + return null; + } finally { + unlock(); + } + } + + /** + * Marks the given key as not amenable to caching. + * Marking helps to avoid repeated computational cost of determining whether + * a query can be cached or not. + * @return The value for the given key if it had been cached before. null + * otherwise. + */ + public PreparedQuery markUncachable(String id) { + lock(); + try { + _uncachables.add(id); + return _delegate.remove(id); + } finally { + unlock(); + } + } + + public boolean isExcluded(String id) { + lock(); + try { + if (_excludes == null || _excludes.isEmpty()) + return false; + for (String exclude : _excludes) + if (exclude.equalsIgnoreCase(id) || exclude.matches(id)) + return true; + return false; + } finally { + unlock(); + } + } + + void lock() { + if (_lock != null) + _lock.lock(); + } + + void unlock() { + if (_lock != null && _lock.isLocked()) + _lock.unlock(); + } + + //------------------------------------------------------- + // Configurable implementation + //------------------------------------------------------- + /** + * Invoked prior to setting bean properties. + */ + public void setConfiguration(Configuration conf) { + } + + /** + * Invoked before bean property configuration is begun on this object. + */ + public void startConfiguration() { + + } + + /** + * Invoked upon completion of bean property configuration for this object. + */ + public void endConfiguration() { + + } + + /** + * Sets one or more exclusion patterns separated by semicolon. + */ + public void setExcludes(String excludes) { + lock(); + try { + if (StringUtils.isEmpty(excludes)) + return; + if (_excludes == null) + _excludes = new ArrayList<String>(); + String[] patterns = excludes.split(PATTERN_SEPARATOR); + _excludes.addAll(Arrays.asList(patterns)); + } finally { + unlock(); + } + } + + public List<String> getExcludes() { + return _excludes == null ? Collections.EMPTY_LIST : + Collections.unmodifiableList(_excludes); + } +} Modified: openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java?rev=694115&r1=694114&r2=694115&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java (original) +++ openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java Wed Sep 10 21:45:37 2008 @@ -363,7 +363,7 @@ null, false); } else if (QueryHints.HINT_INVALIDATE_PREPARED_QUERY.equals (key)) { - _query.getFetchConfiguration().setHint(key, value); + _query.getFetchConfiguration().setHint(key, (Boolean)value); invalidatePreparedQuery(); } else if (QueryHints.HINT_IGNORE_PREPARED_QUERY.equals(key)) { _query.getFetchConfiguration().setHint(key, (Boolean)value); From commits-return-3359-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Thu Sep 11 04:54:43 2008 Return-Path: <commits-return-3359-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 5681 invoked from network); 11 Sep 2008 04:54:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Sep 2008 04:54:43 -0000 Received: (qmail 79054 invoked by uid 500); 11 Sep 2008 04:54:40 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 79046 invoked by uid 500); 11 Sep 2008 04:54:40 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 79037 invoked by uid 99); 11 Sep 2008 04:54:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Sep 2008 21:54:40 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Sep 2008 04:53:48 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 6F9AB238896C; Wed, 10 Sep 2008 21:53:50 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r694116 - /openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/CacheStatistics.java Date: Thu, 11 Sep 2008 04:53:50 -0000 To: commits@openjpa.apache.org From: ppoddar@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080911045350.6F9AB238896C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ppoddar Date: Wed Sep 10 21:53:49 2008 New Revision: 694116 URL: http://svn.apache.org/viewvc?rev=694116&view=rev Log: Fix wrong index in data cache statisitics Modified: openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/CacheStatistics.java Modified: openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/CacheStatistics.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/CacheStatistics.java?rev=694116&r1=694115&r2=694116&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/CacheStatistics.java (original) +++ openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/CacheStatistics.java Wed Sep 10 21:53:49 2008 @@ -184,7 +184,7 @@ private long getCount(Map<Class, long[]> target, Class c, int index) { long[] row = target.get(c); - return (row == null) ? 0 : row[WRITE]; + return (row == null) ? 0 : row[index]; } public Date since() { From commits-return-3360-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Thu Sep 11 04:55:10 2008 Return-Path: <commits-return-3360-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 5979 invoked from network); 11 Sep 2008 04:55:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Sep 2008 04:55:10 -0000 Received: (qmail 79196 invoked by uid 500); 11 Sep 2008 04:55:07 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 79175 invoked by uid 500); 11 Sep 2008 04:55:07 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 79166 invoked by uid 99); 11 Sep 2008 04:55:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Sep 2008 21:55:07 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Sep 2008 04:54:18 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 189DA238899C; Wed, 10 Sep 2008 21:54:50 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r694117 - /openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/CacheStatistics.java Date: Thu, 11 Sep 2008 04:54:49 -0000 To: commits@openjpa.apache.org From: ppoddar@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080911045450.189DA238899C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ppoddar Date: Wed Sep 10 21:54:49 2008 New Revision: 694117 URL: http://svn.apache.org/viewvc?rev=694117&view=rev Log: Fix wrong index in data cache statisitics Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/CacheStatistics.java Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/CacheStatistics.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/CacheStatistics.java?rev=694117&r1=694116&r2=694117&view=diff ============================================================================== --- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/CacheStatistics.java (original) +++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/datacache/CacheStatistics.java Wed Sep 10 21:54:49 2008 @@ -184,7 +184,7 @@ private long getCount(Map<Class, long[]> target, Class c, int index) { long[] row = target.get(c); - return (row == null) ? 0 : row[WRITE]; + return (row == null) ? 0 : row[index]; } public Date since() { From commits-return-3361-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Thu Sep 11 05:17:55 2008 Return-Path: <commits-return-3361-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 15008 invoked from network); 11 Sep 2008 05:17:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Sep 2008 05:17:55 -0000 Received: (qmail 91169 invoked by uid 500); 11 Sep 2008 05:17:52 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 91107 invoked by uid 500); 11 Sep 2008 05:17:52 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 91086 invoked by uid 99); 11 Sep 2008 05:17:52 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Sep 2008 22:17:52 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Sep 2008 05:17:02 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 69794238896C; Wed, 10 Sep 2008 22:17:04 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r694135 - in /openjpa/branches/sql-cache: openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/ openjpa-persistence/src/main/java/org/apache/openjpa/persistence/ Date: Thu, 11 Sep 2008 05:17:03 -0000 To: commits@openjpa.apache.org From: ppoddar@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080911051704.69794238896C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ppoddar Date: Wed Sep 10 22:17:03 2008 New Revision: 694135 URL: http://svn.apache.org/viewvc?rev=694135&view=rev Log: Add query execution statistics Added: openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryStatistics.java Modified: openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQueryCache.java openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java Modified: openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java?rev=694135&r1=694134&r2=694135&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java (original) +++ openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java Wed Sep 10 22:17:03 2008 @@ -218,6 +218,23 @@ assertLanguage(q3, QueryLanguages.LANG_PREPARED_SQL); } + public void testQueryStatistics() { + String jpql1 = "select p from Company p"; + String jpql2 = "select p from Company p where p.name = 'PObject'"; + OpenJPAEntityManager em = emf.createEntityManager(); + OpenJPAQuery q1 = em.createQuery(jpql1); + OpenJPAQuery q2 = em.createQuery(jpql2); + int N1 = 5; + int N2 = 8; + for (int i = 0; i < N1; i++) + em.createQuery(q1).getResultList(); + for (int i = 0; i < N2; i++) + em.createQuery(q2).getResultList(); + + assertEquals(N1, getCache().getStatistics().getExecutionCount(jpql1)); + assertEquals(N2, getCache().getStatistics().getExecutionCount(jpql2)); + assertEquals(N1+N2, getCache().getStatistics().getExecutionCount()); + } public void testQueryWithNoParameter() { compare("select p from Company p"); Modified: openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQueryCache.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQueryCache.java?rev=694135&r1=694134&r2=694135&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQueryCache.java (original) +++ openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQueryCache.java Wed Sep 10 22:17:03 2008 @@ -55,12 +55,14 @@ private final Map<String, PreparedQuery> _delegate; private final Set<String> _uncachables; + private final QueryStatistics _stats; private List<String> _excludes; private ReentrantLock _lock = new ReentrantLock(); public PreparedQueryCache() { _delegate = new HashMap<String, PreparedQuery>(); _uncachables = new HashSet<String>(); + _stats = new QueryStatistics.Default(); } /** @@ -174,6 +176,10 @@ } } + public QueryStatistics getStatistics() { + return _stats; + } + void lock() { if (_lock != null) _lock.lock(); Modified: openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java?rev=694135&r1=694134&r2=694135&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java (original) +++ openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java Wed Sep 10 22:17:03 2008 @@ -248,6 +248,8 @@ PreparedQuery cachedQuery = cache(); boolean usingCachedQuery = (cachedQuery != null); validate(_query.getParameterTypes(), !usingCachedQuery); + recordStatistics(usingCachedQuery ? cachedQuery.getIdentifier() + : _query.getQueryString()); Object result = _query.execute(getParameterMap(usingCachedQuery)); return result; } @@ -635,6 +637,14 @@ _query = new DelegatingQuery(newQuery, broker.getInstanceExceptionTranslator()); } + + private void recordStatistics(String query) { + PreparedQueryCache cache = _em.getConfiguration() + .getPreparedQueryCacheInstance(); + if (cache == null) + return; + cache.getStatistics().recordExecution(query); + } public int hashCode() { return _query.hashCode(); Added: openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryStatistics.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryStatistics.java?rev=694135&view=auto ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryStatistics.java (added) +++ openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryStatistics.java Wed Sep 10 22:17:03 2008 @@ -0,0 +1,145 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.persistence; + +import java.io.Serializable; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +/** + * Records query execution statistics. + * + * @since 1.3.0 + * + * @author Pinaki Poddar + * + */ +public interface QueryStatistics extends Serializable { + + /** + * Record that the given query has been executed. + */ + void recordExecution(String query); + + /** + * Gets number of total query execution since last reset. + */ + public long getExecutionCount(); + + /** + * Gets number of total query execution since start. + */ + public long getTotalExecutionCount(); + + /** + * Gets number of executions for the given query since last reset. + */ + public long getExecutionCount(String query); + + /** + * Gets number of executions for the given query since start. + */ + public long getTotalExecutionCount(String query); + + /** + * Gets the time of last reset. + */ + public Date since(); + + /** + * Gets the time of start. + */ + public Date start(); + + /** + * Clears all accumulated statistics. + */ + public void reset(); + + /** + * A default implementation. + * + */ + public static class Default implements QueryStatistics { + private long[] astat = new long[1]; + private long[] stat = new long[1]; + private Map<String, long[]> stats = new HashMap<String, long[]>(); + private Map<String, long[]> astats = new HashMap<String, long[]>(); + private Date start = new Date(); + private Date since = new Date(); + + private static final int READ = 0; + + public long getExecutionCount() { + return stat[READ]; + } + + public long getTotalExecutionCount() { + return astat[READ]; + } + + public long getExecutionCount(String query) { + return getCount(stats, query, READ); + } + + public long getTotalExecutionCount(String query) { + return getCount(astats, query, READ); + } + + private long getCount(Map<String, long[]> target, String query, int index) { + long[] row = target.get(query); + return (row == null) ? 0 : row[index]; + } + + public Date since() { + return since; + } + + public Date start() { + return start; + } + + public void reset() { + stat = new long[1]; + stats.clear(); + since = new Date(); + } + + private void addSample(String query, int index) { + stat[index]++; + astat[index]++; + addSample(stats, query, index); + addSample(astats, query, index); + } + + private void addSample(Map<String, long[]> target, String query, int index) { + long[] row = target.get(query); + if (row == null) { + row = new long[1]; + } + row[index]++; + target.put(query, row); + } + + public void recordExecution(String query) { + addSample(query, READ); + } + } +} From commits-return-3362-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Thu Sep 11 17:59:00 2008 Return-Path: <commits-return-3362-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 58026 invoked from network); 11 Sep 2008 17:59:00 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Sep 2008 17:59:00 -0000 Received: (qmail 46842 invoked by uid 500); 11 Sep 2008 17:58:57 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 46828 invoked by uid 500); 11 Sep 2008 17:58:57 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 46819 invoked by uid 99); 11 Sep 2008 17:58:57 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Sep 2008 10:58:57 -0700 X-ASF-Spam-Status: No, hits=-1996.3 required=10.0 tests=ALL_TRUSTED,HTML_MESSAGE,MIME_HTML_ONLY X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Sep 2008 17:57:59 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 08C6F234C1D7 for <commits@openjpa.apache.org>; Thu, 11 Sep 2008 10:58:00 -0700 (PDT) Message-ID: <1132505933.1221155880026.JavaMail.www-data@brutus> Date: Thu, 11 Sep 2008 10:58:00 -0700 (PDT) From: confluence@apache.org To: commits@openjpa.apache.org Subject: [CONF] OpenJPA: Documentation (page edited) MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org <html> <head> <base href="http://cwiki.apache.org/confluence" /> <style type="text/css"> <!-- body, p, td, table, tr, .bodytext, .stepfield { font-family: Verdana, arial, sans-serif; font-size: 11px; line-height: 16px; color: #000000; font-weight: normal; } #PageContent { text-align: left; background-color: #fff; padding: 0px; margin: 0px; padding-bottom:20px; } /* ** when this stylesheet is used for the Tiny MCE Wysiwyg editor's edit area, we can't ** use an id=PageContent or class=wiki-content, so we must ** set the body style to that used for PageContent, and p to that used for wiki-content. */ body { margin: 0px; padding: 0px; text-align: center; background-color: #f0f0f0; } @media print { body { background-color: #fff; } } .monospaceInput { font:12px monospace } .wiki-content p, .commentblock p { margin: 16px 0px 16px 0px; padding: 0px; } .wiki-content-preview { padding: 5px; border-left: 1px solid #3c78b5; border-right: 1px solid #3c78b5; } ul, ol { margin-top: 2px; margin-bottom: 2px; padding-top: 0px; padding-bottom: 0px; } pre { padding: 0px; margin-top: 5px; margin-left: 15px; margin-bottom: 5px; margin-right: 5px; text-align: left; } .helpheading { font-weight: bold; background-color: #D0D9BD; border-bottom: 1px solid #3c78b5; padding: 4px 4px 4px 4px; margin: 0px; margin-top: 10px; } .helpcontent { padding: 4px 4px 20px 4px; background-color: #f5f7f1; } .code { border: 1px dashed #3c78b5; font-size: 11px; font-family: Courier; margin: 10px; line-height: 13px; } .focusedComment { background: #ffffce; } .commentBox, .focusedComment { padding: 10px; margin: 5px 0 5px 0; border: 1px #bbb solid; } .codeHeader { background-color: #f0f0f0; border-bottom: 1px dashed #3c78b5; padding: 3px; text-align: center; } .codeContent { text-align: left; background-color: #f0f0f0; padding: 3px; } .preformatted { border: 1px dashed #3c78b5; font-size: 11px; font-family: Courier; margin: 10px; line-height: 13px; } .preformattedHeader { background-color: #f0f0f0; border-bottom: 1px dashed #3c78b5; padding: 3px; text-align: center; } .preformattedContent { background-color: #f0f0f0; padding: 3px; } .panel { border: 1px dashed #3c78b5; margin: 10px; margin-top: 0px; } .panelHeader { background-color: #f0f0f0; border-bottom: 1px dashed #3c78b5; padding: 3px; text-align: center; } .panelContent { background-color: #f0f0f0; padding: 5px; } .anonymousAlert { background-color: #f0f0f0; border: 1px dashed red; font-size: 11px; padding: 10px 5px 10px 5px; margin: 4px; line-height: 13px; } .lockAlert { background-color: #f0f0f0; width: 50%; border: 1px dashed red; font-size: 11px; padding: 10px 5px 10px 5px; margin: 4px; line-height: 13px; } .code-keyword { color: #000091; background-color: inherit; } .code-object { color: #910091; background-color: inherit; } .code-quote { color: #009100; background-color: inherit; } .code-comment { color: #808080; background-color: inherit; } .code-xml .code-keyword { color: inherit; font-weight: bold; } .code-tag { color: #000091; background-color: inherit; } .breadcrumbs { background-color: #f0f0f0; border-color: #3c78b5; border-width: 1px 0px 1px 0px; border-style: solid; font-size: 11px; padding: 3px 0px 3px 0px; } .navmenu { border: 1px solid #ccc; } .menuheading { font-weight: bold; background-color: #f0f0f0; border-bottom: 1px solid #3c78b5; padding: 4px 4px 2px 4px; } .menuitems { padding: 4px 4px 20px 4px; } .rightpanel { border-left: 1px solid #ccc; border-bottom: 1px solid #ccc; } #helpheading { text-align: left; font-weight: bold; background-color: #D0D9BD; border-bottom: 1px solid #3c78b5; padding: 4px 4px 4px 4px; margin: 0px; } #helpcontent { padding: 4px 4px 4px 4px; background-color: #f5f7f1; } .helptab-unselected { font-weight: bold; padding: 5px; background-color: #f5f7f1; } .helptab-selected { font-weight: bold; background-color: #D0D9BD; padding: 5px; } .helptabs { margin: 0px; background-color: #f5f7f1; padding: 5px; } .infopanel-heading { font-weight: bold; padding: 4px 0px 2px 0px; } .pagebody { } .pageheader { padding: 5px 5px 5px 0px; border-bottom: 1px solid #3c78b5; } .pagetitle { font-size: 22px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; } .newpagetitle { color: #ccc !important; } .steptitle { font-size: 18px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; margin-bottom: 7px; } .substeptitle { font-size: 12px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; margin: 2px 4px 4px 4px; padding: 2px 4px 1px 4px; } .stepdesc { font-family: Verdana, arial, sans-serif; font-size: 11px; line-height: 16px; font-weight: normal; color: #666666; margin-top: 7px; margin-bottom: 7px; } .steplabel { font-weight: bold; margin-right: 4px; color: black; float: left; width: 15%; text-align: right; } .stepfield { background: #f0f0f0; padding: 5px; } .submitButtons{ margin-top:5px; text-align:right; } .formtitle { font-size: 12px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; } .sectionbottom { border-bottom: 1px solid #3c78b5; } .topRow { border-top: 2px solid #3c78b5; } .tabletitle { font-size: 14px; font-weight: bold; font-family: Arial, sans-serif; padding: 3px 0px 2px 0px; margin: 8px 4px 2px 0px; color: #003366; border-bottom: 2px solid #3c78b5; } .pagesubheading { color: #666666; font-size: 10px; padding: 0px 0px 5px 0px; } HR { color: 3c78b5; height: 1; } A:link, A:visited, A:active, A:hover { color: #003366; } h1 A:link, h1 A:visited, h1 A:active { text-decoration: none; } h1 A:hover { border-bottom: 1px dotted #003366; } .wiki-content > :first-child, .commentblock > :first-child { margin-top: 3px; } .logocell { padding: 10px; } input { font-family: verdana, geneva, arial, sans-serif; font-size: 11px; color: #000000; } textarea, textarea.editor { font-family: verdana, geneva, arial, sans-serif; font-size: 11px; color: #333333; } /* use logoSpaceLink instead. .spacenametitle { font: 21px/31px Impact, Arial, Helvetica; font-weight: 100; color: #999999; margin: 0px; } .spacenametitle img { margin: 0 0 -4px 0; } .spacenametitle a { text-decoration: none; color: #999999; } .spacenametitle a:visited { text-decoration: none; color: #999999; }*/ .spacenametitle-printable { font: 20px/25px Impact, Arial, Helvetica; font-weight: 100; color: #999999; margin: 0px; } .spacenametitle-printable a { text-decoration: none; color: #999999; } .spacenametitle-printable a:visited { text-decoration: none; color: #999999; } .blogDate { font-weight: bold; text-decoration: none; color: black; } .blogSurtitle { background: #f0f0f0; border: 1px solid #ddd; padding: 3px; margin: 1px 1px 10px 1px; } .blogHeading { font-size: 20px; line-height: normal; font-weight: bold; padding: 0px; margin: 0px; } .blogHeading a { text-decoration: none; color: black; } .endsection { align: right; color: #666666; margin-top: 10px; } .endsectionleftnav { align: right; color: #666666; margin-top: 10px; } h1 { font-size: 24px; line-height: normal; font-weight: bold; background-color: #f0f0f0; color: #003366; border-bottom: 1px solid #3c78b5; padding: 2px; margin: 36px 0px 4px 0px; } h2 { font-size: 18px; line-height: normal; font-weight: bold; background-color: #f0f0f0; border-bottom: 1px solid #3c78b5; padding: 2px; margin: 27px 0px 4px 0px; } h3 { font-size: 14px; line-height: normal; font-weight: bold; background-color: #f0f0f0; padding: 2px; margin: 21px 0px 4px 0px; } h4 { font-size: 12px; line-height: normal; font-weight: bold; background-color: #f0f0f0; padding: 2px; margin: 18px 0px 4px 0px; } h4.search { font-size: 12px; line-height: normal; font-weight: normal; background-color: #f0f0f0; padding: 4px; margin: 18px 0px 4px 0px; } h5 { font-size: 10px; line-height: normal; font-weight: bold; background-color: #f0f0f0; padding: 2px; margin: 14px 0px 4px 0px; } h6 { font-size: 8px; line-height: normal; font-weight: bold; background-color: #f0f0f0; padding: 2px; margin: 14px 0px 4px 0px; } .smallfont { font-size: 10px; } .descfont { font-size: 10px; color: #666666; } .smallerfont { font-size: 9px; } .smalltext { color: #666666; font-size: 10px; } .smalltext a { color: #666666; } .smalltext-blue { color: #3c78b5; font-size: 10px; } .surtitle { margin-left: 1px; margin-bottom: 5px; font-size: 14px; color: #666666; } /* css hack found here: http://www.fo3nix.pwp.blueyonder.co.uk/tutorials/css/hacks/ */ .navItemOver { font-size: 10px; font-weight: bold; color: #ffffff; background-color: #003366; cursor: hand; voice-family: '\'}\''; voice-family:inherit; cursor: pointer;} .navItemOver a { color: #ffffff; background-color:#003366; text-decoration: none; } .navItemOver a:visited { color: #ffffff; background-color:#003366; text-decoration: none; } .navItemOver a:hover { color: #ffffff; background-color:#003366; text-decoration: none; } .navItem { font-size: 10px; font-weight: bold; color: #ffffff; background-color: #3c78b5; } .navItem a { color: #ffffff; text-decoration: none; } .navItem a:hover { color: #ffffff; text-decoration: none; } .navItem a:visited { color: #ffffff; text-decoration: none; } div.padded { padding: 4px; } div.thickPadded { padding: 10px; } h3.macrolibrariestitle { margin: 0px 0px 0px 0px; } div.centered { text-align: center; margin: 10px; } div.centered table {margin: 0px auto; text-align: left; } .tableview table { margin: 0; } .tableview th { text-align: left; color: #003366; font-size: 12px; padding: 5px 0px 0px 5px; border-bottom: 2px solid #3c78b5; } .tableview td { text-align: left; border-color: #ccc; border-width: 0px 0px 1px 0px; border-style: solid; margin: 0; padding: 4px 10px 4px 5px; } .grid { margin: 2px 0px 5px 0px; border-collapse: collapse; } .grid th { border: 1px solid #ccc; padding: 2px 4px 2px 4px; background: #f0f0f0; text-align: center; } .grid td { border: 1px solid #ccc; padding: 3px 4px 3px 4px; } .gridHover { background-color: #f9f9f9; } td.infocell { background-color: #f0f0f0; } .label { font-weight: bold; color: #003366; } label { font-weight: bold; color: #003366; } .error { background-color: #fcc; } .errorBox { background-color: #fcc; border: 1px solid #c00; padding: 5px; margin: 5px; } .errorMessage { color: #c00; } .success { background-color: #dfd; } .successBox { background-color: #dfd; border: 1px solid #090; padding: 5px; margin-top:5px; margin-bottom:5px; } blockquote { padding-left: 10px; padding-right: 10px; margin-left: 5px; margin-right: 0px; border-left: 1px solid #3c78b5; } table.confluenceTable { margin: 5px; border-collapse: collapse; } /* Added as a temporary fix for CONF-4223. The table elements appear to be inheriting the border: none attribute from the sectionMacro class */ table.confluenceTable td.confluenceTd { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; } /* Added as a temporary fix for CONF-4223. The table elements appear to be inheriting the border: none attribute from the sectionMacro class */ table.confluenceTable th.confluenceTh { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; background-color: #f0f0f0; text-align: center; } td.confluenceTd { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; } th.confluenceTh { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; background-color: #f0f0f0; text-align: center; } DIV.small { font-size: 9px; } H1.pagename { margin-top: 0px; } IMG.inline {} .loginform { margin: 5px; border: 1px solid #ccc; } /* The text how the "This is a preview" comment should be shown. */ .previewnote { text-align: center; font-size: 11px; color: red; } /* How the preview content should be shown */ .previewcontent { background: #E0E0E0; } /* How the system messages should be shown (DisplayMessage.jsp) */ .messagecontent { background: #E0E0E0; } /* How the "This page has been modified..." -comment should be shown. */ .conflictnote { } .createlink { color: maroon; } a.createlink { color: maroon; } .templateparameter { font-size: 9px; color: darkblue; } .diffadded { background: #ddffdd; padding: 1px 1px 1px 4px; border-left: 4px solid darkgreen; } .diffdeleted { color: #999; background: #ffdddd; padding: 1px 1px 1px 4px; border-left: 4px solid darkred; } .diffnochange { padding: 1px 1px 1px 4px; border-left: 4px solid lightgrey; } .differror { background: brown; } .diff { font-family: lucida console, courier new, fixed-width; font-size: 12px; line-height: 14px; } .diffaddedchars { background-color:#99ff99; font-weight:bolder; } .diffremovedchars { background-color:#ff9999; text-decoration: line-through; font-weight:bolder; } .greybackground { background: #f0f0f0 } .greybox { border: 1px solid #ddd; padding: 3px; margin: 1px 1px 10px 1px; } .borderedGreyBox { border: 1px solid #cccccc; background-color: #f0f0f0; padding: 10px; } .greyboxfilled { border: 1px solid #ddd; background: #f0f0f0; padding: 3px; margin: 1px 1px 10px 1px; } .navBackgroundBox { padding: 5px 5px 5px 5px; font-size: 22px; font-weight: bold; font-family: Arial, sans-serif; color: white; background: #3c78b5; text-decoration: none; } .previewBoxTop { background-color: #f0f0f0; border-width: 1px 1px 0px 1px; border-style: solid; border-color: #3c78b5; padding: 5px; margin: 5px 0px 0px 0px; text-align: center; } .previewContent { background-color: #fff; border-color: #3c78b5; border-width: 0px 1px 0px 1px; border-style: solid; padding: 10px; margin: 0px; } .previewBoxBottom { background-color: #f0f0f0; border-width: 0px 1px 1px 1px; border-style: solid; border-color: #3c78b5; padding: 5px; margin: 0px 0px 5px 0px; text-align: center; } .functionbox { background-color: #f0f0f0; border: 1px solid #3c78b5; padding: 3px; margin: 1px 1px 10px 1px; } .functionbox-greyborder { background-color: #f0f0f0; border: 1px solid #ddd; padding: 3px; margin: 1px 1px 10px 1px; } .search-highlight { background-color: #ffffcc; } /* normal (white) background */ .rowNormal { background-color: #ffffff; } /* alternate (pale yellow) background */ .rowAlternate { background-color: #f7f7f7; } /* used in the list attachments table */ .rowAlternateNoBottomColor { background-color: #f7f7f7; } .rowAlternateNoBottomNoColor { } .rowAlternateNoBottomColor td { border-bottom: 0px; } .rowAlternateNoBottomNoColor td { border-bottom: 0px; } /* row highlight (grey) background */ .rowHighlight { background-color: #f0f0f0; } TD.greenbar {FONT-SIZE: 2px; BACKGROUND: #00df00; BORDER: 1px solid #9c9c9c; PADDING: 0px; } TD.redbar {FONT-SIZE: 2px; BACKGROUND: #df0000; BORDER: 1px solid #9c9c9c; PADDING: 0px; } TD.darkredbar {FONT-SIZE: 2px; BACKGROUND: #af0000; BORDER: 1px solid #9c9c9c; PADDING: 0px; } TR.testpassed {FONT-SIZE: 2px; BACKGROUND: #ddffdd; PADDING: 0px; } TR.testfailed {FONT-SIZE: 2px; BACKGROUND: #ffdddd; PADDING: 0px; } .toolbar { margin: 0px; border-collapse: collapse; } .toolbar td { border: 1px solid #ccc; padding: 2px 2px 2px 2px; color: #ccc; } td.noformatting { border-width: 0px; border-style: none; text-align: center; padding: 0px; } .commentblock { margin: 12px 0 12px 0; } /* * Divs displaying the license information, if necessary. */ .license-eval, .license-none, .license-nonprofit { border-top: 1px solid #bbbbbb; text-align: center; font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; } .license-eval, .license-none { background-color: #ffcccc; } .license-eval b, .license-none b { color: #990000 } .license-nonprofit { background-color: #ffffff; } /* * The shadow at the bottom of the page between the main content and the * "powered by" section. */ .bottomshadow { height: 12px; background-image: url("$req.contextPath/images/border/border_bottom.gif"); background-repeat: repeat-x; } /* * Styling of the operations box */ .navmenu .operations li, .navmenu .operations ul { list-style: none; margin-left: 0; padding-left: 0; } .navmenu .operations ul { margin-bottom: 9px; } .navmenu .label { font-weight: inherit; } /* * Styling of ops as a toolbar */ .toolbar div { display: none; } .toolbar .label { display: none; } .toolbar .operations { display: block; } .toolbar .operations ul { display: inline; list-style: none; margin-left: 10px; padding-left: 0; } .toolbar .operations li { list-style: none; display: inline; } /* list page navigational tabs */ #foldertab { padding: 3px 0px 3px 8px; margin-left: 0; border-bottom: 1px solid #3c78b5; font: bold 11px Verdana, sans-serif; } #foldertab li { list-style: none; margin: 0; display: inline; } #foldertab li a { padding: 3px 0.5em; margin-left: 3px; border: 1px solid #3c78b5; border-bottom: none; background: #3c78b5; text-decoration: none; } #foldertab li a:link { color: #ffffff; } #foldertab li a:visited { color: #ffffff; } #foldertab li a:hover { color: #ffffff; background: #003366; border-color: #003366; } #foldertab li a.current { background: white; border-bottom: 1px solid white; color: black; } #foldertab li a.current:link { color: black; } #foldertab li a.current:visited { color: black; } #foldertab li a.current:hover { background: white; border-bottom: 1px solid white; color: black; } /* alphabet list */ ul#squaretab { margin-left: 0; padding-left: 0; white-space: nowrap; font: bold 8px Verdana, sans-serif; } #squaretab li { display: inline; list-style-type: none; } #squaretab a { padding: 2px 6px; border: 1px solid #3c78b5; } #squaretab a:link, #squaretab a:visited { color: #fff; background-color: #3c78b5; text-decoration: none; } #squaretab a:hover { color: #ffffff; background-color: #003366; border-color: #003366; text-decoration: none; } #squaretab li a#current { background: white; color: black; } .blogcalendar * { font-family:verdana, arial, sans-serif; font-size:x-small; font-weight:normal; line-height:140%; padding:2px; } table.blogcalendar { border: 1px solid #3c78b5; } .blogcalendar th.calendarhead, a.calendarhead { font-size:x-small; font-weight:bold; padding:2px; text-transform:uppercase; background-color: #3c78b5; color: #ffffff; letter-spacing: .3em; text-transform: uppercase; } .calendarhead:visited {color: white;} .calendarhead:active {color: white;} .calendarhead:hover {color: white;} .blogcalendar th { font-size:x-small; font-weight:bold; padding:2px; background-color:#f0f0f0; } .blogcalendar td { font-size:x-small; font-weight:normal; } .searchGroup { padding: 0 0 10px 0; background: #f0f0f0; } .searchGroupHeading { font-size: 10px; font-weight: bold; color: #ffffff; background-color: #3c78b5; padding: 2px 4px 1px 4px; } .searchItem { padding: 1px 4px 1px 4px; } .searchItemSelected { padding: 1px 4px 1px 4px; font-weight: bold; background: #ddd; } /* permissions page styles */ .permissionHeading { border-bottom: #bbb; border-width: 0 0 1px 0; border-style: solid; font-size: 16px; text-align: left; } .permissionTab { border-width: 0 0 0 1px; border-style: solid; background: #3c78b5; color: #ffffff; font-size: 10px; } .permissionSuperTab { border-width: 0 0 0 1px; border-style: solid; background: #003366; color: #ffffff; } .permissionCell { border-left: #bbb; border-width: 0 0 0 1px; border-style: solid; } /* warning panel */ .warningPanel { background: #FFFFCE; border:#F0C000 1px solid; padding: 8px; margin: 10px; } /* alert panel */ .alertPanel { background: #FFCCCC; border:#C00 1px solid; padding: 8px; margin: 10px; } /* info panel */ .infoPanel { background: #D8E4F1; border:#3c78b5 1px solid; padding: 8px; margin: 10px; } /* side menu highlighting (e.g. space content screen) */ .optionPadded { padding: 2px; } .optionSelected { background-color: #ffffcc; padding: 2px; border: 1px solid #ddd; margin: -1px; } .optionSelected a { font-weight: bold; text-decoration: none; color: black; } /* information macros */ .noteMacro { border-style: solid; border-width: 1px; border-color: #F0C000; background-color: #FFFFCE; text-align:left; margin-top: 5px; margin-bottom: 5px} .warningMacro { border-style: solid; border-width: 1px; border-color: #c00; background-color: #fcc; text-align:left; margin-top: 5px; margin-bottom: 5px} .infoMacro { border-style: solid; border-width: 1px; border-color: #3c78b5; background-color: #D8E4F1; text-align:left; margin-top: 5px; margin-bottom: 5px} .tipMacro { border-style: solid; border-width: 1px; border-color: #090; background-color: #dfd; text-align:left; margin-top: 5px; margin-bottom: 5px} .informationMacroPadding { padding: 5px 0 0 5px; } table.infoMacro td, table.warningMacro td, table.tipMacro td, table.noteMacro td, table.sectionMacro td { border: none; } table.sectionMacroWithBorder td.columnMacro { border-style: dashed; border-width: 1px; border-color: #cccccc;} .pagecontent { padding: 10px; text-align: left; } /* styles for links in the top bar */ .topBarDiv a:link {color: #ffffff;} .topBarDiv a:visited {color: #ffffff;} .topBarDiv a:active {color: #ffffff;} .topBarDiv a:hover {color: #ffffff;} .topBarDiv {color: #ffffff;} .topBar { background-color: #003366; } /* styles for extended operations */ .greyLinks a:link {color: #666666; text-decoration:underline;} .greyLinks a:visited {color: #666666; text-decoration:underline;} .greyLinks a:active {color: #666666; text-decoration:underline;} .greyLinks a:hover {color: #666666; text-decoration:underline;} .greyLinks {color: #666666; display:block; padding: 10px} .logoSpaceLink {color: #999999; text-decoration: none} .logoSpaceLink a:link {color: #999999; text-decoration: none} .logoSpaceLink a:visited {color: #999999; text-decoration: none} .logoSpaceLink a:active {color: #999999; text-decoration: none} .logoSpaceLink a:hover {color: #003366; text-decoration: none} /* basic panel (basicpanel.vmd) style */ .basicPanelContainer {border: 1px solid #3c78b5; margin-top: 2px; margin-bottom: 8px; width: 100%} .basicPanelTitle {padding: 5px; margin: 0px; background-color: #f0f0f0; color: black; font-weight: bold;} .basicPanelBody {padding: 5px; margin: 0px} .separatorLinks a:link {color: white} .separatorLinks a:visited {color: white} .separatorLinks a:active {color: white} .greynavbar {background-color: #f0f0f0; border-top: 1px solid #3c78b5; margin-top: 2px} div.headerField { float: left; width: auto; height: 100%; } .headerFloat { margin-left: auto; width: 50%; } .headerFloatLeft { float: left; margin-right: 20px; margin-bottom: 10px; } #headerRow { padding: 10px; } div.license-personal { background-color: #003366; color: #ffffff; } div.license-personal a { color: #ffffff; } .greyFormBox { border: 1px solid #cccccc; padding: 5px; } /* IE automatically adds a margin before and after form tags. Use this style to remove that */ .marginlessForm { margin: 0px; } .openPageHighlight { background-color: #ffffcc; padding: 2px; border: 1px solid #ddd; } .editPageInsertLinks, .editPageInsertLinks a { color: #666666; font-weight: bold; font-size: 10px; } /* Style for label heatmap. */ .top10 a { font-weight: bold; font-size: 2em; color: #003366; } .top25 a { font-weight: bold; font-size: 1.6em; color: #003366; } .top50 a { font-size: 1.4em; color: #003366; } .top100 a { font-size: 1.2em; color: #003366; } .heatmap { list-style:none; width: 95%; margin: 0px auto; } .heatmap a { text-decoration:none; } .heatmap a:hover { text-decoration:underline; } .heatmap li { display: inline; } .minitab { padding: 3px 0px 3px 8px; margin-left: 0; margin-top: 1px; margin-bottom: 0px; border-bottom: 1px solid #3c78b5; font: bold 9px Verdana, sans-serif; text-decoration: none; float:none; } .selectedminitab { padding: 3px 0.5em; margin-left: 3px; margin-top: 1px; border: 1px solid #3c78b5; background: white; border-bottom: 1px solid white; color: #000000; text-decoration: none; } .unselectedminitab { padding: 3px 0.5em; margin-left: 3px; margin-top: 1px; border: 1px solid #3c78b5; border-bottom: none; background: #3c78b5; color: #ffffff; text-decoration: none; } a.unselectedminitab:hover { color: #ffffff; background: #003366; border-color: #003366; } a.unselectedminitab:link { color: white; } a.unselectedminitab:visited { color: white; } a.selectedminitab:link { color: black; } a.selectedminitab:visited { color: black; } .linkerror { background-color: #fcc;} a.labelOperationLink:link {text-decoration: underline} a.labelOperationLink:active {text-decoration: underline} a.labelOperationLink:visited {text-decoration: underline} a.labelOperationLink:hover {text-decoration: underline} a.newLabel:link {background-color: #ddffdd} a.newLabel:active {background-color: #ddffdd} a.newLabel:visited {background-color: #ddffdd} a.newLabel:hover {background-color: #ddffdd} ul.square {list-style-type: square} .inline-control-link { background: #ffc; font-size: 9px; color: #666; padding: 2px; text-transform: uppercase; text-decoration: none; } .inline-control-link a:link {text-decoration: none} .inline-control-link a:active {text-decoration: none} .inline-control-link a:visited {text-decoration: none} .inline-control-link a:hover {text-decoration: none} .inline-control-link { background: #ffc; font-size: 9px; color: #666; padding: 2px; text-transform: uppercase; text-decoration: none; cursor: pointer; } div.auto_complete { width: 350px; background: #fff; } div.auto_complete ul { border: 1px solid #888; margin: 0; padding: 0; width: 100%; list-style-type: none; } div.auto_complete ul li { margin: 0; padding: 3px; } div.auto_complete ul li.selected { background-color: #ffb; } div.auto_complete ul strong.highlight { color: #800; margin: 0; padding: 0; } /******* Edit Page Styles *******/ .toogleFormDiv{ border:1px solid #A7A6AA; background-color:white; padding:5px; margin-top: 5px; } .toogleInfoDiv{ border:1px solid #A7A6AA; background-color:white; display:none; padding:5px; margin-top: 10px; } .inputSection{ margin-bottom:20px; } #editBox{ border:1px solid lightgray; background-color:#F0F0F0; } /******* Left Navigation Theme Styles ********/ .leftnav li a { text-decoration:none; color:white; margin:0px; display:block; padding:2px; padding-left:5px; background-color: #3c78b5; border-top:1px solid #3c78b5; } .leftnav li a:active {color:white;} .leftnav li a:visited {color:white;} .leftnav li a:hover {background-color: #003366; color:white;} /* Added by Shaun during i18n */ .replaced { background-color: #33CC66; } .topPadding { margin-top: 20px; } /* new form style */ .form-block { padding: 6px; } .form-error-block { padding: 6px; background: #fcc; border-top: #f0f0f0 1px solid; border-bottom: #f0f0f0 1px solid; margin-bottom: 6px; padding: 0 12px 0 12px; } .form-element-large { font-size: 16px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; } .form-element-small { font-size: 12px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; } .form-header { background: lightyellow; border-top: #f0f0f0 1px solid; border-bottom: #f0f0f0 1px solid; margin-bottom: 6px; padding: 0 12px 0 12px; } .form-header p, .form-block p, .form-error-block p { line-height: normal; margin: 12px 0 12px 0; } .form-example { color: #888; font-size: 11px; } .form-divider { border-bottom: #ccc 1px solid; margin-bottom: 6px; } .form-buttons { margin-top: 6px; border-top: #ccc 1px solid; border-bottom: #ccc 1px solid; background: #f0f0f0; padding: 10px; text-align: center; } .form-buttons input { width: 100px; } .form-block .error { padding: 6px; margin-bottom: 6px; } --> </style> </head> <body> <div id="PageContent"> <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%"><tr> <td valign="top" class="pagebody"> <div class="pageheader"> <span class="pagetitle"> Page Edited : <a href="http://cwiki.apache.org/confluence/display/openjpa">openjpa</a> : <a href="http://cwiki.apache.org/confluence/display/openjpa/Documentation">Documentation</a> </span> </div> <p> <a href="http://cwiki.apache.org/confluence/display/openjpa/Documentation">Documentation</a> has been edited by <a href="http://cwiki.apache.org/confluence/display/~michael.d.dick@gmail.com">Michael Dick</a> <span class="smallfont">(Sep 11, 2008)</span>. </p> <p> <a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=23626&originalVersion=17&revisedVersion=18">(View changes)</a> </p> <span class="label">Content:</span><br/> <div class="greybox wiki-content"> <h1><a name="Documentation-OpenJPADocumentation"></a>OpenJPA Documentation</h1> <p>The online OpenJPA documentation can be found here.</p> <h2><a name="Documentation-Latest"></a>Latest</h2> <table class='confluenceTable'><tbody> <tr> <th class='confluenceTh'> Version </th> <th class='confluenceTh'> HTML Manual </th> <th class='confluenceTh'> HTML Manual (Single Page) </th> <th class='confluenceTh'> PDF Manual </th> <th class='confluenceTh'> Javadocs </th> </tr> <tr> <td class='confluenceTd'> Latest OpenJPA Version </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/builds/latest/docs/manual/index.html" title="Visit page outside Confluence" rel="nofollow">manual<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/builds/latest/docs/manual/manual.html" title="Visit page outside Confluence" rel="nofollow">manual<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/builds/latest/docs/manual/manual.pdf" title="Visit page outside Confluence" rel="nofollow">manual<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/builds/latest/docs/javadoc/index.html" title="Visit page outside Confluence" rel="nofollow">javadoc<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> </tr> </tbody></table> <h2><a name="Documentation-OpenJPA1.2.0releases"></a>OpenJPA 1.2.0 releases</h2> <table class='confluenceTable'><tbody> <tr> <th class='confluenceTh'> Version </th> <th class='confluenceTh'> HTML Manual </th> <th class='confluenceTh'> HTML Manual (Single Page) </th> <th class='confluenceTh'> PDF Manual </th> <th class='confluenceTh'> Javadocs </th> </tr> <tr> <td class='confluenceTd'> OpenJPA 1.2.0 </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/builds/1.2.0/apache-openjpa-1.2.0/docs/manual/index.html" title="Visit page outside Confluence" rel="nofollow">manual<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/builds/1.2.0/apache-openjpa-1.2.0/docs/manual/manual.html" title="Visit page outside Confluence" rel="nofollow">manual<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/builds/1.2.0/apache-openjpa-1.2.0/docs/manual/manual.pdf" title="Visit page outside Confluence" rel="nofollow">manual<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/builds/1.2.0/apache-openjpa-1.2.0/docs/javadoc/index.html" title="Visit page outside Confluence" rel="nofollow">javadoc<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> </tr> </tbody></table> <h2><a name="Documentation-OpenJPA1.1.xreleases"></a>OpenJPA 1.1.x releases</h2> <table class='confluenceTable'><tbody> <tr> <th class='confluenceTh'> Version </th> <th class='confluenceTh'> HTML Manual </th> <th class='confluenceTh'> HTML Manual (Single Page) </th> <th class='confluenceTh'> PDF Manual </th> <th class='confluenceTh'> Javadocs </th> </tr> <tr> <td class='confluenceTd'> OpenJPA 1.1.0 </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/builds/1.1.0/apache-openjpa-1.1.0/docs/manual/index.html" title="Visit page outside Confluence" rel="nofollow">manual<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/builds/1.1.0/apache-openjpa-1.1.0/docs/manual/manual.html" title="Visit page outside Confluence" rel="nofollow">manual<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/builds/1.1.0/apache-openjpa-1.1.0/docs/manual/manual.pdf" title="Visit page outside Confluence" rel="nofollow">manual<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/builds/1.1.0/apache-openjpa-1.1.0/docs/javadoc/index.html" title="Visit page outside Confluence" rel="nofollow">javadoc<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> </tr> </tbody></table> <h2><a name="Documentation-OpenJPA1.0.xreleases"></a>OpenJPA 1.0.x releases</h2> <table class='confluenceTable'><tbody> <tr> <th class='confluenceTh'> Version </th> <th class='confluenceTh'> HTML Manual </th> <th class='confluenceTh'> HTML Manual (Single Page) </th> <th class='confluenceTh'> PDF Manual </th> <th class='confluenceTh'> Javadocs </th> </tr> <tr> <td class='confluenceTd'> OpenJPA 1.0.3 </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/builds/1.0.3/apache-openjpa-1.0.3/docs/manual/index.html" title="Visit page outside Confluence" rel="nofollow">manual<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/builds/1.0.3/apache-openjpa-1.0.3/docs/manual/manual.html" title="Visit page outside Confluence" rel="nofollow">manual<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/builds/1.0.3/apache-openjpa-1.0.3/docs/manual/manual.pdf" title="Visit page outside Confluence" rel="nofollow">manual<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/builds/1.0.3/apache-openjpa-1.0.3/docs/javadoc/index.html" title="Visit page outside Confluence" rel="nofollow">javadoc<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> </tr> <tr> <td class='confluenceTd'> OpenJPA 1.0.2 </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/builds/1.0.2/apache-openjpa-1.0.2/docs/manual/index.html" title="Visit page outside Confluence" rel="nofollow">manual<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/builds/1.0.2/apache-openjpa-1.0.2/docs/manual/manual.html" title="Visit page outside Confluence" rel="nofollow">manual<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/builds/1.0.2/apache-openjpa-1.0.2/docs/manual/manual.pdf" title="Visit page outside Confluence" rel="nofollow">manual<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/builds/1.0.2/apache-openjpa-1.0.2/docs/javadoc/index.html" title="Visit page outside Confluence" rel="nofollow">javadoc<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> </tr> <tr> <td class='confluenceTd'> OpenJPA 1.0.1 </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/builds/1.0.1/apache-openjpa-1.0.1/docs/manual/index.html" title="Visit page outside Confluence" rel="nofollow">manual<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/builds/1.0.1/apache-openjpa-1.0.1/docs/manual/manual.html" title="Visit page outside Confluence" rel="nofollow">manual<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/builds/1.0.1/apache-openjpa-1.0.1/docs/manual/manual.pdf" title="Visit page outside Confluence" rel="nofollow">manual<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/builds/1.0.1/apache-openjpa-1.0.1/docs/javadoc/index.html" title="Visit page outside Confluence" rel="nofollow">javadoc<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> </tr> <tr> <td class='confluenceTd'> OpenJPA 1.0.0 </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/builds/1.0.0/apache-openjpa-1.0.0/docs/manual/index.html" title="Visit page outside Confluence" rel="nofollow">manual<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/builds/1.0.0/apache-openjpa-1.0.0/docs/manual/manual.html" title="Visit page outside Confluence" rel="nofollow">manual<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/builds/1.0.0/apache-openjpa-1.0.0/docs/manual/manual.pdf" title="Visit page outside Confluence" rel="nofollow">manual<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/builds/1.0.0/apache-openjpa-1.0.0/docs/javadoc/index.html" title="Visit page outside Confluence" rel="nofollow">javadoc<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> </tr> </tbody></table> <h2><a name="Documentation-Incubatingreleases"></a>Incubating releases</h2> <table class='confluenceTable'><tbody> <tr> <th class='confluenceTh'> Version </th> <th class='confluenceTh'> HTML Manual </th> <th class='confluenceTh'> HTML Manual (Single Page) </th> <th class='confluenceTh'> PDF Manual </th> <th class='confluenceTh'> Javadocs </th> </tr> <tr> <td class='confluenceTd'> OpenJPA 0.9.7 </td> <td class='confluenceTd'> </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/docs/openjpa-0.9.7-incubating/manual/manual.html" title="Visit page outside Confluence" rel="nofollow">manual<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> <td class='confluenceTd'> </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/docs/openjpa-0.9.7-incubating/javadoc/index.html" title="Visit page outside Confluence" rel="nofollow">javadoc<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> </tr> <tr> <td class='confluenceTd'> OpenJPA 0.9.6 </td> <td class='confluenceTd'> </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/docs/openjpa-0.9.6-incubating/manual/manual.html" title="Visit page outside Confluence" rel="nofollow">manual <sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> <td class='confluenceTd'> </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/docs/openjpa-0.9.6-incubating/javadoc/index.html" title="Visit page outside Confluence" rel="nofollow">javadoc<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> </tr> <tr> <td class='confluenceTd'> OpenJPA 0.9.0 </td> <td class='confluenceTd'> </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/docs/openjpa-0.9.0-incubating/manual/manual.html" title="Visit page outside Confluence" rel="nofollow">manual <sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> <td class='confluenceTd'> </td> <td class='confluenceTd'> <span class="nobr"><a href="http://openjpa.apache.org/docs/openjpa-0.9.0-incubating/javadoc/index.html" title="Visit page outside Confluence" rel="nofollow">javadoc<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> </tr> </tbody></table></div> </td></tr></table></div> <p> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td height="12" background="http://cwiki.apache.org/confluence/images/border/border_bottom.gif"><img src="http://cwiki.apache.org/confluence/images/border/spacer.gif" width="1" height="1" border="0"/></td> </tr> </table> <div class="smalltext"> Powered by <a href="http://www.atlassian.com/software/confluence/default.jsp?clicked=footer" class="smalltext">Atlassian Confluence</a> (Version: 2.2.9 Build:#527 Sep 07, 2006) - <a href="http://jira.atlassian.com/secure/BrowseProject.jspa?id=10470" class="smalltext">Bug/feature request</a><br/> <br> <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action">Unsubscribe or edit your notifications preferences</a> </div> </body> </html> From commits-return-3363-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Thu Sep 11 18:09:33 2008 Return-Path: <commits-return-3363-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 67397 invoked from network); 11 Sep 2008 18:09:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Sep 2008 18:09:33 -0000 Received: (qmail 67073 invoked by uid 500); 11 Sep 2008 18:09:30 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 67058 invoked by uid 500); 11 Sep 2008 18:09:30 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 67049 invoked by uid 99); 11 Sep 2008 18:09:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Sep 2008 11:09:30 -0700 X-ASF-Spam-Status: No, hits=-1996.3 required=10.0 tests=ALL_TRUSTED,HTML_MESSAGE,MIME_HTML_ONLY X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Sep 2008 18:08:29 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 0EB6D234C1D7 for <commits@openjpa.apache.org>; Thu, 11 Sep 2008 11:09:00 -0700 (PDT) Message-ID: <1339025927.1221156540022.JavaMail.www-data@brutus> Date: Thu, 11 Sep 2008 11:09:00 -0700 (PDT) From: confluence@apache.org To: commits@openjpa.apache.org Subject: [CONF] OpenJPA: Downloads (page edited) MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org <html> <head> <base href=3D"http://cwiki.apache.org/confluence" /> <style type=3D"text/css"> <!-- body, p, td, table, tr, .bodytext, .stepfield { =09font-family: Verdana, arial, sans-serif; =09font-size: 11px; =09line-height: 16px; =09color: #000000; =09font-weight: normal; } #PageContent { =09text-align: left; =09background-color: #fff; =09padding: 0px; =09margin: 0px; padding-bottom:20px; } /* ** when this stylesheet is used for the Tiny MCE Wysiwyg editor's edit area= , we can't ** use an id=3DPageContent or class=3Dwiki-content, so we must ** set the body style to that used for PageContent, and p to that used for = wiki-content. */ body { =09margin: 0px; =09padding: 0px; =09text-align: center; background-color: #f0f0f0; } @media print { body { background-color: #fff; } } .monospaceInput { font:12px monospace } .wiki-content p, .commentblock p { margin: 16px 0px 16px 0px; padding: 0px; } .wiki-content-preview { padding: 5px; border-left: 1px solid #3c78b5; border-right: 1px solid #3c78b5; } ul, ol { margin-top: 2px; margin-bottom: 2px; padding-top: 0px; padding-bottom: 0px; } pre { padding: 0px; margin-top: 5px; margin-left: 15px; margin-bottom: 5px; margin-right: 5px; text-align: left; } .helpheading { font-weight: bold; background-color: #D0D9BD; border-bottom: 1px solid #3c78b5; padding: 4px 4px 4px 4px; margin: 0px; margin-top: 10px; } .helpcontent { padding: 4px 4px 20px 4px; background-color: #f5f7f1; } .code { =09border: 1px dashed #3c78b5; font-size: 11px; =09font-family: Courier; margin: 10px; =09line-height: 13px; } .focusedComment { background: #ffffce; } .commentBox, .focusedComment { padding: 10px; margin: 5px 0 5px 0; border: 1px #bbb solid; } .codeHeader { background-color: #f0f0f0; =09border-bottom: 1px dashed #3c78b5; padding: 3px; =09text-align: center; } .codeContent { text-align: left; background-color: #f0f0f0; padding: 3px; } .preformatted { =09border: 1px dashed #3c78b5; font-size: 11px; =09font-family: Courier; margin: 10px; =09line-height: 13px; } .preformattedHeader { background-color: #f0f0f0; =09border-bottom: 1px dashed #3c78b5; padding: 3px; =09text-align: center; } .preformattedContent { background-color: #f0f0f0; padding: 3px; } .panel { =09border: 1px dashed #3c78b5; margin: 10px; margin-top: 0px; } .panelHeader { background-color: #f0f0f0; =09border-bottom: 1px dashed #3c78b5; padding: 3px; =09text-align: center; } .panelContent { background-color: #f0f0f0; padding: 5px; } .anonymousAlert { background-color: #f0f0f0; =09border: 1px dashed red; font-size: 11px; padding: 10px 5px 10px 5px; margin: 4px; =09line-height: 13px; } .lockAlert { background-color: #f0f0f0; width: 50%; =09border: 1px dashed red; font-size: 11px; padding: 10px 5px 10px 5px; margin: 4px; =09line-height: 13px; } .code-keyword { color: #000091; background-color: inherit; } .code-object { color: #910091; background-color: inherit; } .code-quote { color: #009100; background-color: inherit; } .code-comment { color: #808080; background-color: inherit; } .code-xml .code-keyword { color: inherit; font-weight: bold; } .code-tag { color: #000091; background-color: inherit; } .breadcrumbs { background-color: #f0f0f0; =09border-color: #3c78b5; =09border-width: 1px 0px 1px 0px; =09border-style: solid; font-size: 11px; padding: 3px 0px 3px 0px; } .navmenu { border: 1px solid #ccc; } .menuheading { font-weight: bold; background-color: #f0f0f0; =09border-bottom: 1px solid #3c78b5; =09padding: 4px 4px 2px 4px; } .menuitems { =09padding: 4px 4px 20px 4px; } .rightpanel { border-left: 1px solid #ccc; border-bottom: 1px solid #ccc; } #helpheading { text-align: left; font-weight: bold; background-color: #D0D9BD; =09border-bottom: 1px solid #3c78b5; =09padding: 4px 4px 4px 4px; =09margin: 0px; } #helpcontent { =09padding: 4px 4px 4px 4px; background-color: #f5f7f1; } .helptab-unselected { font-weight: bold; =09padding: 5px; background-color: #f5f7f1; } .helptab-selected { font-weight: bold; background-color: #D0D9BD; =09padding: 5px; } .helptabs { margin: 0px; background-color: #f5f7f1; =09padding: 5px; } .infopanel-heading { font-weight: bold; =09padding: 4px 0px 2px 0px; } .pagebody { } .pageheader { =09padding: 5px 5px 5px 0px; =09border-bottom: 1px solid #3c78b5; } .pagetitle { =09font-size: 22px; =09font-weight: bold; =09font-family: Arial, sans-serif; =09color: #003366; } .newpagetitle { color: #ccc !important; } .steptitle { =09font-size: 18px; =09font-weight: bold; =09font-family: Arial, sans-serif; =09color: #003366; =09margin-bottom: 7px; } .substeptitle { font-size: 12px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; margin: 2px 4px 4px 4px; padding: 2px 4px 1px 4px; } .stepdesc { font-family: Verdana, arial, sans-serif; =09font-size: 11px; =09line-height: 16px; =09font-weight: normal; color: #666666; margin-top: 7px; margin-bottom: 7px; } .steplabel { font-weight: bold; margin-right: 4px; color: black; float: left; width: 15%; text-align: right; } .stepfield { background: #f0f0f0; padding: 5px; } .submitButtons{ margin-top:5px; text-align:right; } .formtitle { =09font-size: 12px; =09font-weight: bold; =09font-family: Arial, sans-serif; =09color: #003366; } .sectionbottom { border-bottom: 1px solid #3c78b5; } .topRow { border-top: 2px solid #3c78b5; } .tabletitle { =09font-size: 14px; =09font-weight: bold; =09font-family: Arial, sans-serif; padding: 3px 0px 2px 0px; margin: 8px 4px 2px 0px; =09color: #003366; =09border-bottom: 2px solid #3c78b5; } .pagesubheading { color: #666666; font-size: 10px; padding: 0px 0px 5px 0px; } HR { =09color: 3c78b5; =09height: 1; } A:link, A:visited, A:active, A:hover { =09color: #003366; } h1 A:link, h1 A:visited, h1 A:active { =09text-decoration: none; } h1 A:hover { border-bottom: 1px dotted #003366; } .wiki-content > :first-child, .commentblock > :first-child { margin-top: 3px; } .logocell { padding: 10px; } input { =09font-family: verdana, geneva, arial, sans-serif; =09font-size: 11px; =09color: #000000; } textarea, textarea.editor { =09font-family: verdana, geneva, arial, sans-serif; =09font-size: 11px; =09color: #333333; } /* use logoSpaceLink instead. .spacenametitle { =09font: 21px/31px Impact, Arial, Helvetica; font-weight: 100; color: #999999; =09margin: 0px; } .spacenametitle img { margin: 0 0 -4px 0; } .spacenametitle a { text-decoration: none; color: #999999; } .spacenametitle a:visited { text-decoration: none; color: #999999; }*/ .spacenametitle-printable { =09font: 20px/25px Impact, Arial, Helvetica; font-weight: 100; color: #999999; =09margin: 0px; } .spacenametitle-printable a { text-decoration: none; color: #999999; } .spacenametitle-printable a:visited { text-decoration: none; color: #999999; } .blogDate { =09font-weight: bold; =09text-decoration: none; =09color: black; } .blogSurtitle { background: #f0f0f0; =09border: 1px solid #ddd; =09padding: 3px; =09margin: 1px 1px 10px 1px; } .blogHeading { font-size: 20px; line-height: normal; font-weight: bold; padding: 0px; margin: 0px; } .blogHeading a { text-decoration: none; color: black; } .endsection { =09align: right; =09color: #666666; =09margin-top: 10px; } .endsectionleftnav { =09align: right; =09color: #666666; =09margin-top: 10px; } h1 { =09font-size: 24px; =09line-height: normal; =09font-weight: bold; =09background-color: #f0f0f0; =09color: #003366; =09border-bottom: 1px solid #3c78b5; =09padding: 2px; =09margin: 36px 0px 4px 0px; } h2 { =09font-size: 18px; =09line-height: normal; =09font-weight: bold; =09background-color: #f0f0f0; =09border-bottom: 1px solid #3c78b5; =09padding: 2px; =09margin: 27px 0px 4px 0px; } h3 { =09font-size: 14px; =09line-height: normal; =09font-weight: bold; =09background-color: #f0f0f0; =09padding: 2px; =09margin: 21px 0px 4px 0px; } h4 { =09font-size: 12px; =09line-height: normal; =09font-weight: bold; =09background-color: #f0f0f0; =09padding: 2px; =09margin: 18px 0px 4px 0px; } h4.search { =09font-size: 12px; =09line-height: normal; =09font-weight: normal; =09background-color: #f0f0f0; =09padding: 4px; =09margin: 18px 0px 4px 0px; } h5 { =09font-size: 10px; =09line-height: normal; =09font-weight: bold; =09background-color: #f0f0f0; =09padding: 2px; =09margin: 14px 0px 4px 0px; } h6 { =09font-size: 8px; =09line-height: normal; =09font-weight: bold; =09background-color: #f0f0f0; =09padding: 2px; =09margin: 14px 0px 4px 0px; } .smallfont { font-size: 10px; } .descfont { font-size: 10px; color: #666666; } .smallerfont { font-size: 9px; } .smalltext { color: #666666; font-size: 10px; } .smalltext a { color: #666666; } .smalltext-blue { color: #3c78b5; font-size: 10px; } .surtitle { margin-left: 1px; margin-bottom: 5px; font-size: 14px; color: #666666; } /* css hack found here: http://www.fo3nix.pwp.blueyonder.co.uk/tutorials/c= ss/hacks/ */ .navItemOver { font-size: 10px; font-weight: bold; color: #ffffff; backgrou= nd-color: #003366; cursor: hand; voice-family: '\'}\''; voice-family:inheri= t; cursor: pointer;} .navItemOver a { color: #ffffff; background-color:#003366; text-decoration:= none; } .navItemOver a:visited { color: #ffffff; background-color:#003366; text-dec= oration: none; } .navItemOver a:hover { color: #ffffff; background-color:#003366; text-decor= ation: none; } .navItem { font-size: 10px; font-weight: bold; color: #ffffff; background-c= olor: #3c78b5; } .navItem a { color: #ffffff; text-decoration: none; } .navItem a:hover { color: #ffffff; text-decoration: none; } .navItem a:visited { color: #ffffff; text-decoration: none; } div.padded { padding: 4px; } div.thickPadded { padding: 10px; } h3.macrolibrariestitle { margin: 0px 0px 0px 0px; } div.centered { text-align: center; margin: 10px; } div.centered table {margin: 0px auto; text-align: left; } .tableview table { margin: 0; } .tableview th { text-align: left; color: #003366; font-size: 12px; padding: 5px 0px 0px 5px; border-bottom: 2px solid #3c78b5; } .tableview td { text-align: left; border-color: #ccc; border-width: 0px 0px 1px 0px; border-style: solid; margin: 0; padding: 4px 10px 4px 5px; } .grid { margin: 2px 0px 5px 0px; border-collapse: collapse; } .grid th { border: 1px solid #ccc; padding: 2px 4px 2px 4px; background: #f0f0f0; text-align: center; } .grid td { border: 1px solid #ccc; padding: 3px 4px 3px 4px; } .gridHover { =09background-color: #f9f9f9; } td.infocell { background-color: #f0f0f0; } .label { =09font-weight: bold; =09color: #003366; } label { =09font-weight: bold; =09color: #003366; } .error { =09background-color: #fcc; } .errorBox { =09background-color: #fcc; border: 1px solid #c00; padding: 5px; margin: 5px; } .errorMessage { =09color: #c00; } .success { =09background-color: #dfd; } .successBox { =09background-color: #dfd; border: 1px solid #090; padding: 5px; margin-top:5px; margin-bottom:5px; } blockquote { =09padding-left: 10px; =09padding-right: 10px; =09margin-left: 5px; =09margin-right: 0px; =09border-left: 1px solid #3c78b5; } table.confluenceTable { margin: 5px; border-collapse: collapse; } /* Added as a temporary fix for CONF-4223. The table elements appear to be = inheriting the border: none attribute from the sectionMacro class */ table.confluenceTable td.confluenceTd { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; } /* Added as a temporary fix for CONF-4223. The table elements appear to be = inheriting the border: none attribute from the sectionMacro class */ table.confluenceTable th.confluenceTh { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; background-color: #f0f0f0; text-align: center; } td.confluenceTd { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; } th.confluenceTh { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; background-color: #f0f0f0; text-align: center; } DIV.small { =09font-size: 9px; } H1.pagename { =09margin-top: 0px; } IMG.inline {} .loginform { margin: 5px; border: 1px solid #ccc; } /* The text how the "This is a preview" comment should be shown. */ .previewnote { text-align: center; font-size: 11px; color: red; } /* How the preview content should be shown */ .previewcontent { background: #E0E0E0; } /* How the system messages should be shown (DisplayMessage.jsp) */ .messagecontent { background: #E0E0E0; } /* How the "This page has been modified..." -comment should be shown. */ .conflictnote { } .createlink { color: maroon; } a.createlink { color: maroon; } .templateparameter { font-size: 9px; color: darkblue; } .diffadded { background: #ddffdd; padding: 1px 1px 1px 4px; =09border-left: 4px solid darkgreen; } .diffdeleted { color: #999; background: #ffdddd; padding: 1px 1px 1px 4px; =09border-left: 4px solid darkred; } .diffnochange { padding: 1px 1px 1px 4px; =09border-left: 4px solid lightgrey; } .differror { background: brown; } .diff { font-family: lucida console, courier new, fixed-width; =09font-size: 12px; =09line-height: 14px; } .diffaddedchars { background-color:#99ff99; font-weight:bolder; } .diffremovedchars { background-color:#ff9999; text-decoration: line-through; font-weight:bolder; } .greybackground { background: #f0f0f0 } .greybox { =09border: 1px solid #ddd; =09padding: 3px; =09margin: 1px 1px 10px 1px; } .borderedGreyBox { border: 1px solid #cccccc; background-color: #f0f0f0; padding: 10px; } .greyboxfilled { =09border: 1px solid #ddd; background: #f0f0f0; padding: 3px; =09margin: 1px 1px 10px 1px; } .navBackgroundBox { padding: 5px 5px 5px 5px; font-size: 22px; =09font-weight: bold; =09font-family: Arial, sans-serif; =09color: white; background: #3c78b5; text-decoration: none; } .previewBoxTop { =09background-color: #f0f0f0; border-width: 1px 1px 0px 1px; border-style: solid; border-color: #3c78b5; padding: 5px; margin: 5px 0px 0px 0px; text-align: center; } .previewContent { background-color: #fff; =09border-color: #3c78b5; =09border-width: 0px 1px 0px 1px; =09border-style: solid; =09padding: 10px; =09margin: 0px; } .previewBoxBottom { =09background-color: #f0f0f0; border-width: 0px 1px 1px 1px; border-style: solid; border-color: #3c78b5; padding: 5px; margin: 0px 0px 5px 0px; text-align: center; } .functionbox { background-color: #f0f0f0; =09border: 1px solid #3c78b5; =09padding: 3px; =09margin: 1px 1px 10px 1px; } .functionbox-greyborder { background-color: #f0f0f0; =09border: 1px solid #ddd; =09padding: 3px; =09margin: 1px 1px 10px 1px; } .search-highlight { background-color: #ffffcc; } /* normal (white) background */ .rowNormal { background-color: #ffffff; } /* alternate (pale yellow) background */ .rowAlternate { background-color: #f7f7f7; } /* used in the list attachments table */ .rowAlternateNoBottomColor { background-color: #f7f7f7; } .rowAlternateNoBottomNoColor { } .rowAlternateNoBottomColor td { border-bottom: 0px; } .rowAlternateNoBottomNoColor td { border-bottom: 0px; } /* row highlight (grey) background */ .rowHighlight { background-color: #f0f0f0; } TD.greenbar {FONT-SIZE: 2px; BACKGROUND: #00df00; BORDER: 1px solid #9c9c9c= ; PADDING: 0px; } TD.redbar {FONT-SIZE: 2px; BACKGROUND: #df0000; BORDER: 1px solid #9c9c9c; = PADDING: 0px; } TD.darkredbar {FONT-SIZE: 2px; BACKGROUND: #af0000; BORDER: 1px solid #9c9c= 9c; PADDING: 0px; } TR.testpassed {FONT-SIZE: 2px; BACKGROUND: #ddffdd; PADDING: 0px; } TR.testfailed {FONT-SIZE: 2px; BACKGROUND: #ffdddd; PADDING: 0px; } .toolbar { margin: 0px; border-collapse: collapse; } .toolbar td { border: 1px solid #ccc; padding: 2px 2px 2px 2px; color: #ccc; } td.noformatting { border-width: 0px; border-style: none; text-align: center; =09padding: 0px; } .commentblock { margin: 12px 0 12px 0; } /* * Divs displaying the license information, if necessary. */ .license-eval, .license-none, .license-nonprofit { border-top: 1px solid #bbbbbb; text-align: center; font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; } .license-eval, .license-none { background-color: #ffcccc; } .license-eval b, .license-none b { color: #990000 } .license-nonprofit { background-color: #ffffff; } /* * The shadow at the bottom of the page between the main content and the * "powered by" section. */ .bottomshadow { height: 12px; background-image: url("$req.contextPath/images/border/border_bottom.gif= "); background-repeat: repeat-x; } /* * Styling of the operations box */ .navmenu .operations li, .navmenu .operations ul { list-style: none; margin-left: 0; padding-left: 0; } .navmenu .operations ul { margin-bottom: 9px; } .navmenu .label { font-weight: inherit; } /* * Styling of ops as a toolbar */ .toolbar div { display: none; } .toolbar .label { display: none; } .toolbar .operations { display: block; } .toolbar .operations ul { display: inline; list-style: none; margin-left: 10px; padding-left: 0; } .toolbar .operations li { list-style: none; display: inline; } /* list page navigational tabs */ #foldertab { padding: 3px 0px 3px 8px; margin-left: 0; border-bottom: 1px solid #3c78b5; font: bold 11px Verdana, sans-serif; } #foldertab li { list-style: none; margin: 0; display: inline; } #foldertab li a { padding: 3px 0.5em; margin-left: 3px; border: 1px solid #3c78b5; border-bottom: none; background: #3c78b5; text-decoration: none; } #foldertab li a:link { color: #ffffff; } #foldertab li a:visited { color: #ffffff; } #foldertab li a:hover { color: #ffffff; background: #003366; border-color: #003366; } #foldertab li a.current { background: white; border-bottom: 1px solid white; color: black; } #foldertab li a.current:link { color: black; } #foldertab li a.current:visited { color: black; } #foldertab li a.current:hover { background: white; border-bottom: 1px solid white; color: black; } /* alphabet list */ ul#squaretab { margin-left: 0; padding-left: 0; white-space: nowrap; font: bold 8px Verdana, sans-serif; } #squaretab li { display: inline; list-style-type: none; } #squaretab a { padding: 2px 6px; border: 1px solid #3c78b5; } #squaretab a:link, #squaretab a:visited { color: #fff; background-color: #3c78b5; text-decoration: none; } #squaretab a:hover { color: #ffffff; background-color: #003366; border-color: #003366; text-decoration: none; } #squaretab li a#current { background: white; color: black; } .blogcalendar * { font-family:verdana, arial, sans-serif; font-size:x-small; font-weight:normal; line-height:140%; padding:2px; } table.blogcalendar { border: 1px solid #3c78b5; } .blogcalendar th.calendarhead, a.calendarhead { font-size:x-small; font-weight:bold; padding:2px; text-transform:uppercase; background-color: #3c78b5; color: #ffffff; letter-spacing: .3em; text-transform: uppercase; } .calendarhead:visited {color: white;} .calendarhead:active {color: white;} .calendarhead:hover {color: white;} .blogcalendar th { font-size:x-small; font-weight:bold; padding:2px; background-color:#f0f0f0; } .blogcalendar td { font-size:x-small; font-weight:normal; } .searchGroup { padding: 0 0 10px 0; background: #f0f0f0; } .searchGroupHeading { font-size: 10px; font-weight: bold; color: #ffffff; b= ackground-color: #3c78b5; padding: 2px 4px 1px 4px; } .searchItem { padding: 1px 4px 1px 4px; } .searchItemSelected { padding: 1px 4px 1px 4px; font-weight: bold; backgrou= nd: #ddd; } /* permissions page styles */ .permissionHeading { border-bottom: #bbb; border-width: 0 0 1px 0; border-style: solid; font= -size: 16px; text-align: left; } .permissionTab { border-width: 0 0 0 1px; border-style: solid; background: #3c78b5; colo= r: #ffffff; font-size: 10px; } .permissionSuperTab { border-width: 0 0 0 1px; border-style: solid; background: #003366; colo= r: #ffffff; } .permissionCell { border-left: #bbb; border-width: 0 0 0 1px; border-style: solid; } /* warning panel */ .warningPanel { background: #FFFFCE; border:#F0C000 1px solid; padding: 8px= ; margin: 10px; } /* alert panel */ .alertPanel { background: #FFCCCC; border:#C00 1px solid; padding: 8px; mar= gin: 10px; } /* info panel */ .infoPanel { background: #D8E4F1; border:#3c78b5 1px solid; padding: 8px; m= argin: 10px; } /* side menu highlighting (e.g. space content screen) */ .optionPadded { padding: 2px; } .optionSelected { background-color: #ffffcc; padding: 2px; border: 1px soli= d #ddd; margin: -1px; } .optionSelected a { font-weight: bold; text-decoration: none; color: black;= } /* information macros */ .noteMacro { border-style: solid; border-width: 1px; border-color: #F0C000;= background-color: #FFFFCE; text-align:left; margin-top: 5px; margin-bottom= : 5px} .warningMacro { border-style: solid; border-width: 1px; border-color: #c00;= background-color: #fcc; text-align:left; margin-top: 5px; margin-bottom: 5= px} .infoMacro { border-style: solid; border-width: 1px; border-color: #3c78b5;= background-color: #D8E4F1; text-align:left; margin-top: 5px; margin-bottom= : 5px} .tipMacro { border-style: solid; border-width: 1px; border-color: #090; bac= kground-color: #dfd; text-align:left; margin-top: 5px; margin-bottom: 5px} .informationMacroPadding { padding: 5px 0 0 5px; } table.infoMacro td, table.warningMacro td, table.tipMacro td, table.noteMac= ro td, table.sectionMacro td { border: none; } table.sectionMacroWithBorder td.columnMacro { border-style: dashed; border-= width: 1px; border-color: #cccccc;} .pagecontent { padding: 10px; text-align: left; } /* styles for links in the top bar */ .topBarDiv a:link {color: #ffffff;} .topBarDiv a:visited {color: #ffffff;} .topBarDiv a:active {color: #ffffff;} .topBarDiv a:hover {color: #ffffff;} .topBarDiv {color: #ffffff;} .topBar { background-color: #003366; } /* styles for extended operations */ .greyLinks a:link {color: #666666; text-decoration:underline;} .greyLinks a:visited {color: #666666; text-decoration:underline;} .greyLinks a:active {color: #666666; text-decoration:underline;} .greyLinks a:hover {color: #666666; text-decoration:underline;} .greyLinks {color: #666666; display:block; padding: 10px} .logoSpaceLink {color: #999999; text-decoration: none} .logoSpaceLink a:link {color: #999999; text-decoration: none} .logoSpaceLink a:visited {color: #999999; text-decoration: none} .logoSpaceLink a:active {color: #999999; text-decoration: none} .logoSpaceLink a:hover {color: #003366; text-decoration: none} /* basic panel (basicpanel.vmd) style */ .basicPanelContainer {border: 1px solid #3c78b5; margin-top: 2px; margin-bo= ttom: 8px; width: 100%} .basicPanelTitle {padding: 5px; margin: 0px; background-color: #f0f0f0; col= or: black; font-weight: bold;} .basicPanelBody {padding: 5px; margin: 0px} .separatorLinks a:link {color: white} .separatorLinks a:visited {color: white} .separatorLinks a:active {color: white} .greynavbar {background-color: #f0f0f0; border-top: 1px solid #3c78b5; marg= in-top: 2px} div.headerField { float: left; width: auto; height: 100%; } .headerFloat { margin-left: auto; width: 50%; } .headerFloatLeft { float: left; margin-right: 20px; margin-bottom: 10px; } #headerRow { padding: 10px; } div.license-personal { background-color: #003366; color: #ffffff; } div.license-personal a { color: #ffffff; } .greyFormBox { border: 1px solid #cccccc; padding: 5px; } /* IE automatically adds a margin before and after form tags. Use this styl= e to remove that */ .marginlessForm { margin: 0px; } .openPageHighlight { background-color: #ffffcc; padding: 2px; border: 1px solid #ddd; } .editPageInsertLinks, .editPageInsertLinks a { color: #666666; font-weight: bold; font-size: 10px; } /* Style for label heatmap. */ .top10 a { font-weight: bold; font-size: 2em; color: #003366; } .top25 a { font-weight: bold; font-size: 1.6em; color: #003366; } .top50 a { font-size: 1.4em; color: #003366; } .top100 a { font-size: 1.2em; color: #003366; } .heatmap { list-style:none; width: 95%; margin: 0px auto; } .heatmap a { text-decoration:none; } .heatmap a:hover { text-decoration:underline; } .heatmap li { display: inline; } .minitab { padding: 3px 0px 3px 8px; margin-left: 0; margin-top: 1px; margin-bottom: 0px; border-bottom: 1px solid #3c78b5; font: bold 9px Verdana, sans-serif; text-decoration: none; float:none; } .selectedminitab { padding: 3px 0.5em; margin-left: 3px; margin-top: 1px; border: 1px solid #3c78b5; background: white; border-bottom: 1px solid white; color: #000000; text-decoration: none; } .unselectedminitab { padding: 3px 0.5em; margin-left: 3px; margin-top: 1px; border: 1px solid #3c78b5; border-bottom: none; background: #3c78b5; color: #ffffff; text-decoration: none; } a.unselectedminitab:hover { color: #ffffff; background: #003366; border-color: #003366; } a.unselectedminitab:link { color: white; } a.unselectedminitab:visited { color: white; } a.selectedminitab:link { color: black; } a.selectedminitab:visited { color: black; } .linkerror { background-color: #fcc;} a.labelOperationLink:link {text-decoration: underline} a.labelOperationLink:active {text-decoration: underline} a.labelOperationLink:visited {text-decoration: underline} a.labelOperationLink:hover {text-decoration: underline} a.newLabel:link {background-color: #ddffdd} a.newLabel:active {background-color: #ddffdd} a.newLabel:visited {background-color: #ddffdd} a.newLabel:hover {background-color: #ddffdd} ul.square {list-style-type: square} .inline-control-link { background: #ffc; font-size: 9px; color: #666; padding: 2px; text-transform: uppercase; text-decoration: none; } .inline-control-link a:link {text-decoration: none} .inline-control-link a:active {text-decoration: none} .inline-control-link a:visited {text-decoration: none} .inline-control-link a:hover {text-decoration: none} .inline-control-link { background: #ffc; font-size: 9px; color: #666; padding: 2px; text-transform: uppercase; text-decoration: none; cursor: pointer; } div.auto_complete { width: 350px; background: #fff; } div.auto_complete ul { border: 1px solid #888; margin: 0; padding: 0; width: 100%; list-style-type: none; } div.auto_complete ul li { margin: 0; padding: 3px; } div.auto_complete ul li.selected { background-color: #ffb; } div.auto_complete ul strong.highlight { color: #800; margin: 0; padding: 0; } /******* Edit Page Styles *******/ .toogleFormDiv{ border:1px solid #A7A6AA; background-color:white; padding:5px; margin-top: 5px; } .toogleInfoDiv{ border:1px solid #A7A6AA; background-color:white; display:none; padding:5px; margin-top: 10px; } .inputSection{ margin-bottom:20px; } #editBox{ border:1px solid lightgray; background-color:#F0F0F0; } /******* Left Navigation Theme Styles ********/ .leftnav li a { text-decoration:none; color:white; margin:0px; display:block; padding:2px; padding-left:5px; background-color: #3c78b5; border-top:1px solid #3c78b5; } .leftnav li a:active {color:white;} .leftnav li a:visited {color:white;} .leftnav li a:hover {background-color: #003366; color:white;} /* Added by Shaun during i18n */ .replaced { background-color: #33CC66; } .topPadding { margin-top: 20px; } /* new form style */ .form-block { padding: 6px; } .form-error-block { padding: 6px; background: #fcc; border-top: #f0f0f0 1px solid; border-bottom: #f0f0f0 1px solid; margin-bottom: 6px; padding: 0 12px 0 12px; } .form-element-large { font-size: 16px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; } .form-element-small { font-size: 12px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; } .form-header { background: lightyellow; border-top: #f0f0f0 1px solid; border-bottom: #f0f0f0 1px solid; margin-bottom: 6px; padding: 0 12px 0 12px; } .form-header p, .form-block p, .form-error-block p { line-height: normal; margin: 12px 0 12px 0; } .form-example { color: #888; font-size: 11px; } .form-divider { border-bottom: #ccc 1px solid; margin-bottom: 6px; } .form-buttons { margin-top: 6px; border-top: #ccc 1px solid; border-bottom: #ccc 1px solid; background: #f0f0f0; padding: 10px; text-align: center; } .form-buttons input { width: 100px; } .form-block .error { padding: 6px; margin-bottom: 6px; } --> </style> </head> <body> <div id=3D"PageContent"> <table class=3D"pagecontent" border=3D"0" cellpadding=3D"0" cellspacing=3D"= 0" width=3D"100%"><tr> <td valign=3D"top" class=3D"pagebody"> <div class=3D"pageheader"> <span class=3D"pagetitle"> Page Edited : <a href=3D"http://cwiki.apache.org/confluence/display/openjpa">= openjpa</a> : <a href=3D"http://cwiki.apache.org/confluence/display/openjpa/D= ownloads">Downloads</a> </span> </div> <p> <a href=3D"http://cwiki.apache.org/confluence/display/openjpa/Downl= oads">Downloads</a> has been edited by <a href=3D"http://cwiki.apache.org/c= onfluence/display/~michael.d.dick@gmail.com">Michael Dick</a> <span class=3D"smallfont">(Sep 11, 2008)</span>. </p> <p> Change summary: <div class=3D"greybox wiki-content"><p>Added link to nightly builds</= p></div> </p> <p> <a href=3D"http://cwiki.apache.org/confluence/pages/diffpa= gesbyversion.action?pageId=3D23613&originalVersion=3D41&revisedVersion=3D42= ">(View changes)</a> </p> <span class=3D"label">Content:</span><br/> <div class=3D"greybox wiki-content"> <h1><a name=3D"Downloads-OpenJPADownloads"></a>OpenJPA Downloads</h1> <p>Use the links below to download a distribution of Apache OpenJPA. It is = good practice to <a href=3D"#Downloads-VerifyingReleases" title=3D"Verifyin= g Releases on Downloads">verify the integrity</a> of the distribution files= .</p> <p>For information on obtaining OpenJPA binaries, see the <a href=3D"/confl= uence/display/openjpa/Obtaining" title=3D"Obtaining">Obtaining</a> page. Fo= r information on building OpenJPA from source, see the <a href=3D"/confluen= ce/display/openjpa/Building+OpenJPA" title=3D"Building OpenJPA">Building Op= enJPA</a> page.</p> <h2><a name=3D"Downloads-OfficialReleases"></a>Official Releases</h2> <h3><a name=3D"Downloads-1.2.xReleases"></a>1.2.x Releases</h3> <table class=3D'confluenceTable'><tbody> <tr> <th class=3D'confluenceTh'> </th> <th class=3D'confluenceTh'> Download </th> <th class=3D'confluenceTh'> Release Date </th> <th class=3D'confluenceTh'> Signatures </th> <th class=3D'confluenceTh'> Release Notes </th> </tr> <tr> <td class=3D'confluenceTd'> OpenJPA 1.2.0 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dyn/closer.cgi/openjpa/1.2.0/apache-openjpa-1.2.0-binary.zip" title= =3D"Visit page outside Confluence" rel=3D"nofollow">apache-openjpa-1.2.0-bi= nary.zip<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/link= ext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0= "/></sup></a></span> </td> <td class=3D'confluenceTd'> 14 Aug 2008 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dist/openjpa/1.2.0/apache-openjpa-1.2.0-binary.zip.asc" title=3D"Vis= it page outside Confluence" rel=3D"nofollow">PGP<sup><img class=3D"renderic= on" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"7" = align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://openjpa.= apache.org/builds/1.2.0/apache-openjpa-1.2.0/RELEASE-NOTES.html" title=3D"V= isit page outside Confluence" rel=3D"nofollow">Release Notes<sup><img class= =3D"rendericon" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" = width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </= td> </tr> <tr> <td class=3D'confluenceTd'> OpenJPA 1.2.0 Source Code </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dyn/closer.cgi/openjpa/1.2.0/apache-openjpa-1.2.0-source.zip" title= =3D"Visit page outside Confluence" rel=3D"nofollow">apache-openjpa-1.2.0-so= urce.zip<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/link= ext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0= "/></sup></a></span> </td> <td class=3D'confluenceTd'> 14 Aug 2008 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dist/openjpa/1.2.0/apache-openjpa-1.2.0-source.zip.asc" title=3D"Vis= it page outside Confluence" rel=3D"nofollow">PGP<sup><img class=3D"renderic= on" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"7" = align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> </td> </tr> </tbody></table> <h3><a name=3D"Downloads-1.1.xReleases"></a>1.1.x Releases</h3> <table class=3D'confluenceTable'><tbody> <tr> <th class=3D'confluenceTh'> </th> <th class=3D'confluenceTh'> Download </th> <th class=3D'confluenceTh'> Release Date </th> <th class=3D'confluenceTh'> Signatures </th> <th class=3D'confluenceTh'> Release Notes </th> </tr> <tr> <td class=3D'confluenceTd'> OpenJPA 1.1.0 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dyn/closer.cgi/openjpa/1.1.0/apache-openjpa-1.1.0-binary.zip" title= =3D"Visit page outside Confluence" rel=3D"nofollow">apache-openjpa-1.1.0-bi= nary.zip<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/link= ext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0= "/></sup></a></span> </td> <td class=3D'confluenceTd'> 22 May 2008 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dist/openjpa/1.1.0/apache-openjpa-1.1.0-binary.zip.asc" title=3D"Vis= it page outside Confluence" rel=3D"nofollow">PGP<sup><img class=3D"renderic= on" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"7" = align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://openjpa.= apache.org/builds/1.1.0/apache-openjpa-1.1.0/RELEASE-NOTES.html" title=3D"V= isit page outside Confluence" rel=3D"nofollow">Release Notes<sup><img class= =3D"rendericon" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" = width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </= td> </tr> <tr> <td class=3D'confluenceTd'> OpenJPA 1.1.0 Source Code </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dyn/closer.cgi/openjpa/1.1.0/apache-openjpa-1.1.0-source.zip" title= =3D"Visit page outside Confluence" rel=3D"nofollow">apache-openjpa-1.1.0-so= urce.zip<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/link= ext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0= "/></sup></a></span> </td> <td class=3D'confluenceTd'> 22 May 2008 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dist/openjpa/1.1.0/apache-openjpa-1.1.0-source.zip.asc" title=3D"Vis= it page outside Confluence" rel=3D"nofollow">PGP<sup><img class=3D"renderic= on" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"7" = align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> </td> </tr> </tbody></table> <h3><a name=3D"Downloads-1.0.xReleases"></a>1.0.x Releases</h3> <table class=3D'confluenceTable'><tbody> <tr> <th class=3D'confluenceTh'> </th> <th class=3D'confluenceTh'> Download </th> <th class=3D'confluenceTh'> Release Date </th> <th class=3D'confluenceTh'> Signatures </th> <th class=3D'confluenceTh'> Release Notes </th> </tr> <tr> <td class=3D'confluenceTd'> OpenJPA 1.0.3 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dyn/closer.cgi/openjpa/1.0.3/apache-openjpa-1.0.3-binary.zip" title= =3D"Visit page outside Confluence" rel=3D"nofollow">apache-openjpa-1.0.3-bi= nary.zip<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/link= ext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0= "/></sup></a></span> </td> <td class=3D'confluenceTd'> 25 Jul 2008 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dist/openjpa/1.0.3/apache-openjpa-1.0.3-binary.zip.asc" title=3D"Vis= it page outside Confluence" rel=3D"nofollow">PGP<sup><img class=3D"renderic= on" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"7" = align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://openjpa.= apache.org/builds/1.0.3/apache-openjpa-1.0.3/RELEASE-NOTES.html" title=3D"V= isit page outside Confluence" rel=3D"nofollow">Release Notes<sup><img class= =3D"rendericon" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" = width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </= td> </tr> <tr> <td class=3D'confluenceTd'> OpenJPA 1.0.3 Source Code </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dyn/closer.cgi/openjpa/1.0.3/apache-openjpa-1.0.3-source.zip" title= =3D"Visit page outside Confluence" rel=3D"nofollow">apache-openjpa-1.0.3-so= urce.zip<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/link= ext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0= "/></sup></a></span> </td> <td class=3D'confluenceTd'> 25 Jul 2008 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dist/openjpa/1.0.3/apache-openjpa-1.0.3-source.zip.asc" title=3D"Vis= it page outside Confluence" rel=3D"nofollow">PGP<sup><img class=3D"renderic= on" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"7" = align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> </td> </tr> <tr> <td class=3D'confluenceTd'> OpenJPA 1.0.2 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dyn/closer.cgi/openjpa/1.0.2/apache-openjpa-1.0.2-binary.zip" title= =3D"Visit page outside Confluence" rel=3D"nofollow">apache-openjpa-1.0.2-bi= nary.zip<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/link= ext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0= "/></sup></a></span> </td> <td class=3D'confluenceTd'> 18 Feb 2008 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dist/openjpa/1.0.2/apache-openjpa-1.0.2-binary.zip.asc" title=3D"Vis= it page outside Confluence" rel=3D"nofollow">PGP<sup><img class=3D"renderic= on" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"7" = align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://openjpa.= apache.org/builds/1.0.2/apache-openjpa-1.0.2/RELEASE-NOTES.html" title=3D"V= isit page outside Confluence" rel=3D"nofollow">Release Notes<sup><img class= =3D"rendericon" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" = width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </= td> </tr> <tr> <td class=3D'confluenceTd'> OpenJPA 1.0.2 Source Code </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dyn/closer.cgi/openjpa/1.0.2/apache-openjpa-1.0.2-source.zip" title= =3D"Visit page outside Confluence" rel=3D"nofollow">apache-openjpa-1.0.2-so= urce.zip<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/link= ext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0= "/></sup></a></span> </td> <td class=3D'confluenceTd'> 18 Feb 2008 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dist/openjpa/1.0.2/apache-openjpa-1.0.2-source.zip.asc" title=3D"Vis= it page outside Confluence" rel=3D"nofollow">PGP<sup><img class=3D"renderic= on" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"7" = align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> </td> </tr> <tr> <td class=3D'confluenceTd'> OpenJPA 1.0.1 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dyn/closer.cgi/openjpa/1.0.1/apache-openjpa-1.0.1-binary.zip" title= =3D"Visit page outside Confluence" rel=3D"nofollow">apache-openjpa-1.0.1-bi= nary.zip<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/link= ext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0= "/></sup></a></span> </td> <td class=3D'confluenceTd'> 9 Nov 2007 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dist/openjpa/1.0.1/apache-openjpa-1.0.1-binary.zip.asc" title=3D"Vis= it page outside Confluence" rel=3D"nofollow">PGP<sup><img class=3D"renderic= on" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"7" = align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://openjpa.= apache.org/builds/1.0.1/apache-openjpa-1.0.1/RELEASE-NOTES.html" title=3D"V= isit page outside Confluence" rel=3D"nofollow">Release Notes<sup><img class= =3D"rendericon" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" = width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </= td> </tr> <tr> <td class=3D'confluenceTd'> OpenJPA 1.0.1 Source Code </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dyn/closer.cgi/openjpa/1.0.1/apache-openjpa-1.0.1-source.zip" title= =3D"Visit page outside Confluence" rel=3D"nofollow">apache-openjpa-1.0.1-so= urce.zip<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/link= ext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0= "/></sup></a></span> </td> <td class=3D'confluenceTd'> 9 Nov 2007 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dist/openjpa/1.0.1/apache-openjpa-1.0.1-source.zip.asc" title=3D"Vis= it page outside Confluence" rel=3D"nofollow">PGP<sup><img class=3D"renderic= on" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"7" = align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> </td> </tr> <tr> <td class=3D'confluenceTd'> OpenJPA 1.0.0 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dyn/closer.cgi/openjpa/1.0.0/apache-openjpa-1.0.0-binary.zip" title= =3D"Visit page outside Confluence" rel=3D"nofollow">apache-openjpa-1.0.0-bi= nary.zip<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/link= ext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0= "/></sup></a></span> </td> <td class=3D'confluenceTd'> 28 Aug 2007 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dist/openjpa/1.0.0/apache-openjpa-1.0.0-binary.zip.asc" title=3D"Vis= it page outside Confluence" rel=3D"nofollow">PGP<sup><img class=3D"renderic= on" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"7" = align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://openjpa.= apache.org/builds/1.0.0/apache-openjpa-1.0.0/RELEASE-NOTES.html" title=3D"V= isit page outside Confluence" rel=3D"nofollow">Release Notes<sup><img class= =3D"rendericon" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" = width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </= td> </tr> <tr> <td class=3D'confluenceTd'> OpenJPA 1.0.0 Source Code </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dyn/closer.cgi/openjpa/1.0.0/apache-openjpa-1.0.0-source.zip" title= =3D"Visit page outside Confluence" rel=3D"nofollow">apache-openjpa-1.0.0-so= urce.zip<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/link= ext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0= "/></sup></a></span> </td> <td class=3D'confluenceTd'> 28 Au 2007 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dist/openjpa/1.0.0/apache-openjpa-1.0.0-source.zip.asc" title=3D"Vis= it page outside Confluence" rel=3D"nofollow">PGP<sup><img class=3D"renderic= on" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"7" = align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> </td> </tr> </tbody></table> <h2><a name=3D"Downloads-OlderincubatingReleases"></a>Older incubating Rele= ases</h2> <table class=3D'confluenceTable'><tbody> <tr> <th class=3D'confluenceTh'> </th> <th class=3D'confluenceTh'> Download </th> <th class=3D'confluenceTh'> Release Date </th> <th class=3D'confluenceTh'> Signatures </th> </tr> <tr> <td class=3D'confluenceTd'> OpenJPA 0.9.7 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://people.a= pache.org/repo/m2-incubating-repository/org/apache/openjpa/openjpa-project/= 0.9.7-incubating/openjpa-project-0.9.7-incubating-binary.zip" title=3D"Visi= t page outside Confluence" rel=3D"nofollow">openjpa-project-0.9.7-incubatin= g-binary.zip<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/= linkext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border= =3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> 27 April 2007 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://people.a= pache.org/repo/m2-incubating-repository/org/apache/openjpa/openjpa-project/= 0.9.7-incubating/openjpa-project-0.9.7-incubating-binary.zip.md5" title=3D"= Visit page outside Confluence" rel=3D"nofollow">MD5<sup><img class=3D"rende= ricon" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"= 7" align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> <span class= =3D"nobr"><a href=3D"http://people.apache.org/repo/m2-incubating-repository= /org/apache/openjpa/openjpa-project/0.9.7-incubating/openjpa-project-0.9.7-= incubating-binary.zip.asc" title=3D"Visit page outside Confluence" rel=3D"n= ofollow">PGP<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/= linkext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border= =3D"0"/></sup></a></span> </td> </tr> <tr> <td class=3D'confluenceTd'> OpenJPA 0.9.7 Source Code </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://people.a= pache.org/repo/m2-incubating-repository/org/apache/openjpa/openjpa-project/= 0.9.7-incubating/openjpa-project-0.9.7-incubating-source.zip" title=3D"Visi= t page outside Confluence" rel=3D"nofollow">openjpa-project-0.9.7-incubatin= g-source.zip<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/= linkext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border= =3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> 27 April 2007 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://people.a= pache.org/repo/m2-incubating-repository/org/apache/openjpa/openjpa-project/= 0.9.7-incubating/openjpa-project-0.9.7-incubating-source.zip.md5" title=3D"= Visit page outside Confluence" rel=3D"nofollow">MD5<sup><img class=3D"rende= ricon" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"= 7" align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> <span class= =3D"nobr"><a href=3D"http://people.apache.org/repo/m2-incubating-repository= /org/apache/openjpa/openjpa-project/0.9.7-incubating/openjpa-project-0.9.7-= incubating-source.zip.asc" title=3D"Visit page outside Confluence" rel=3D"n= ofollow">PGP<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/= linkext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border= =3D"0"/></sup></a></span> </td> </tr> <tr> <td class=3D'confluenceTd'> OpenJPA 0.9.6 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://people.a= pache.org/repo/m2-incubating-repository/org/apache/openjpa/openjpa-project/= 0.9.6-incubating/openjpa-project-0.9.6-incubating-binary.zip" title=3D"Visi= t page outside Confluence" rel=3D"nofollow">openjpa-project-0.9.6-incubatin= g-binary.zip <sup><img class=3D"rendericon" src=3D"/confluence/images/icons= /linkext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border= =3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> 29 November 2006 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://people.a= pache.org/repo/m2-incubating-repository/org/apache/openjpa/openjpa-project/= 0.9.6-incubating/openjpa-project-0.9.6-incubating-binary.zip.md5" title=3D"= Visit page outside Confluence" rel=3D"nofollow">MD5<sup><img class=3D"rende= ricon" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"= 7" align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> <span class= =3D"nobr"><a href=3D"http://people.apache.org/repo/m2-incubating-repository= /org/apache/openjpa/openjpa-project/0.9.6-incubating/openjpa-project-0.9.6-= incubating-binary.zip.asc" title=3D"Visit page outside Confluence" rel=3D"n= ofollow">PGP<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/= linkext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border= =3D"0"/></sup></a></span> </td> </tr> <tr> <td class=3D'confluenceTd'> OpenJPA 0.9.6 Source Code </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://people.a= pache.org/repo/m2-incubating-repository/org/apache/openjpa/openjpa-project/= 0.9.6-incubating/openjpa-project-0.9.6-incubating-source.zip" title=3D"Visi= t page outside Confluence" rel=3D"nofollow">openjpa-project-0.9.6-incubatin= g-source.zip <sup><img class=3D"rendericon" src=3D"/confluence/images/icons= /linkext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border= =3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> 29 November 2006 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://people.a= pache.org/repo/m2-incubating-repository/org/apache/openjpa/openjpa-project/= 0.9.6-incubating/openjpa-project-0.9.6-incubating-source.zip.md5" title=3D"= Visit page outside Confluence" rel=3D"nofollow">MD5<sup><img class=3D"rende= ricon" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"= 7" align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> <span class= =3D"nobr"><a href=3D"http://people.apache.org/repo/m2-incubating-repository= /org/apache/openjpa/openjpa-project/0.9.6-incubating/openjpa-project-0.9.6-= incubating-source.zip.asc" title=3D"Visit page outside Confluence" rel=3D"n= ofollow">PGP<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/= linkext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border= =3D"0"/></sup></a></span> </td> </tr> </tbody></table> <h2><a name=3D"Downloads-NightlySnapshots"></a>Nightly Snapshots</h2> <p>These distributions are built and deployed nightly, and contain up-to-da= te fixes and improvements. However, their stability cannot be guaranteed. U= se at your own risk.</p> <table class=3D'confluenceTable'><tbody> <tr> <th class=3D'confluenceTh'> </th> <th class=3D'confluenceTh'> Download </th> </tr> <tr> <td class=3D'confluenceTd'> Nightly build<br clear=3D"all" /> </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://openjpa.= apache.org/builds/latest/downloads/apache-openjpa-1.3.0-SNAPSHOT-binary.zip= " title=3D"Visit page outside Confluence" rel=3D"nofollow">apache-openjpa-1= .3.0-SNAPSHOT-binary.zip<sup><img class=3D"rendericon" src=3D"/confluence/i= mages/icons/linkext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt= =3D"" border=3D"0"/></sup></a></span> </td> </tr> <tr> <td class=3D'confluenceTd'> Nightly build Source Code<br clear=3D"all" /> <= /td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://openjpa.= apache.org/builds/latest/downloads/apache-openjpa-1.3.0-SNAPSHOT-source.zip= " title=3D"Visit page outside Confluence" rel=3D"nofollow">apache-openjpa-1= .3.0-SNAPSHOT-source.zip<sup><img class=3D"rendericon" src=3D"/confluence/i= mages/icons/linkext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt= =3D"" border=3D"0"/></sup></a></span> </td> </tr> </tbody></table> <p>OpenJPA jar is self-describing and after downloading a nightly snapshot,= you can find out the latest revision number included in the build by</p> <div class=3D"code"><div class=3D"codeHeader"><b>Determining Revision numbe= r included in a particular build</b></div><div class=3D"codeContent"> <pre class=3D"code-none">% java -jar you/path/to/openjpa.jar | grep revisio= n</pre> </div></div> <p>will print the revision numbers, for example, as</p> <div class=3D"code"><div class=3D"codeContent"> <pre class=3D"code-none">Apache svn revision: 422266:686421</pre> </div></div> <p>which designates that the nightly build includes Apache SVN revision <tt= >686421</tt> as the latest.</p> <h2><a name=3D"Downloads-VerifyingReleases"></a>Verifying Releases</h2> <p>We strongly recommend you verify the integrity of the downloaded files w= ith both PGP and MD5. The PGP signatures can be verified using <span class= =3D"nobr"><a href=3D"http://www.pgpi.org/" title=3D"Visit page outside Conf= luence" rel=3D"nofollow">PGP<sup><img class=3D"rendericon" src=3D"/confluen= ce/images/icons/linkext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" = alt=3D"" border=3D"0"/></sup></a></span> or <span class=3D"nobr"><a href=3D= "http://www.gnupg.org/" title=3D"Visit page outside Confluence" rel=3D"nofo= llow">GPG<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/lin= kext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"= 0"/></sup></a></span>. First download the <span class=3D"nobr"><a href=3D"h= ttp://apache.org/dist/openjpa/KEYS" title=3D"Visit page outside Confluence"= rel=3D"nofollow">KEYS<sup><img class=3D"rendericon" src=3D"/confluence/ima= ges/icons/linkext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D= "" border=3D"0"/></sup></a></span> as well as the <tt>*.asc</tt> signat= ure file for the particular distribution. Make sure you get these files fro= m the main distribution directory, rather than from a mirror. Then verify t= he signatures using one of the following sets of commands:</p> <div class=3D"code"><div class=3D"codeHeader"><b>Verifying Release Files us= ing the pgpk Utility</b></div><div class=3D"codeContent"> <pre class=3D"code-none">% pgpk -a KEYS % pgpv openjpa-*.zip.asc</pre> </div></div> <div class=3D"code"><div class=3D"codeHeader"><b>Verifying Release Files us= ing the pgp Utility</b></div><div class=3D"codeContent"> <pre class=3D"code-none">% pgp -ka KEYS % pgp openjpa-*.zip.asc</pre> </div></div> <div class=3D"code"><div class=3D"codeHeader"><b>Verifying Release Files us= ing the gpg Utility</b></div><div class=3D"codeContent"> <pre class=3D"code-none">% gpg --import KEYS % gpg --verify openjpa-*.zip.asc</pre> </div></div> <p>Alternatively, you can verify the checksums on the files. Unix programs = called <b>md5</b>/<b>sha1</b> or <b>md5sum</b>/<b>sha1sum</b> are included = in many unix distributions. *sum is also available as part of <span cla= ss=3D"nobr"><a href=3D"http://www.gnu.org/software/textutils/textutils.html= " title=3D"Visit page outside Confluence" rel=3D"nofollow">GNU Textutils<su= p><img class=3D"rendericon" src=3D"/confluence/images/icons/linkext7.gif" h= eight=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></= a></span>. Windows users can get binary md5 programs from <span class=3D"no= br"><a href=3D"http://www.fourmilab.ch/md5/" title=3D"Visit page outside Co= nfluence" rel=3D"nofollow">here<sup><img class=3D"rendericon" src=3D"/confl= uence/images/icons/linkext7.gif" height=3D"7" width=3D"7" align=3D"absmiddl= e" alt=3D"" border=3D"0"/></sup></a></span> or <span class=3D"nobr"><a href= =3D"http://www.pc-tools.net/win32/freeware/console/" title=3D"Visit page ou= tside Confluence" rel=3D"nofollow">here<sup><img class=3D"rendericon" src= =3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"7" align= =3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span>. <span class=3D"nob= r"><a href=3D"http://www.slavasoft.com/fsum/" title=3D"Visit page outside C= onfluence" rel=3D"nofollow">fsum<sup><img class=3D"rendericon" src=3D"/conf= luence/images/icons/linkext7.gif" height=3D"7" width=3D"7" align=3D"absmidd= le" alt=3D"" border=3D"0"/></sup></a></span> supports MD5 and SHA1.</p></di= v> </td></tr></table></div> <p> <table border=3D"0" cellpadding=3D"0" cellspacing=3D"0" width=3D"100%"> <tr> <td height=3D"12" background=3D"http://cwiki.apache.org/confluence/= images/border/border_bottom.gif"><img src=3D"http://cwiki.apache.org/conflu= ence/images/border/spacer.gif" width=3D"1" height=3D"1" border=3D"0"/></td> </tr> </table> <div class=3D"smalltext"> Powered by <a href=3D"http://www.atlassian.com/software/confluence/default.jsp?cli= cked=3Dfooter" class=3D"smalltext">Atlassian Confluence</a> (Version: 2.2.9 Build:#527 Sep 07, 2006) - <a href=3D"http://jira.atlassian.com/secure/BrowseProject.jspa?id=3D104= 70" class=3D"smalltext">Bug/feature request</a><br/> <br> <a href=3D"http://cwiki.apache.org/confluence/users/viewnotifications.a= ction">Unsubscribe or edit your notifications preferences</a> </div> </body> </html> From commits-return-3364-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Thu Sep 11 18:13:59 2008 Return-Path: <commits-return-3364-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 69209 invoked from network); 11 Sep 2008 18:13:59 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Sep 2008 18:13:59 -0000 Received: (qmail 74449 invoked by uid 500); 11 Sep 2008 18:13:56 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 74435 invoked by uid 500); 11 Sep 2008 18:13:56 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 74426 invoked by uid 99); 11 Sep 2008 18:13:56 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Sep 2008 11:13:56 -0700 X-ASF-Spam-Status: No, hits=-1996.3 required=10.0 tests=ALL_TRUSTED,HTML_MESSAGE,MIME_HTML_ONLY X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Sep 2008 18:12:58 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 07F25234C1D9 for <commits@openjpa.apache.org>; Thu, 11 Sep 2008 11:13:00 -0700 (PDT) Message-ID: <1044373658.1221156780024.JavaMail.www-data@brutus> Date: Thu, 11 Sep 2008 11:13:00 -0700 (PDT) From: confluence@apache.org To: commits@openjpa.apache.org Subject: [CONF] OpenJPA: Nightly builds available again (news created) MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org <html> <head> <base href="http://cwiki.apache.org/confluence" /> <style type="text/css"> <!-- body, p, td, table, tr, .bodytext, .stepfield { font-family: Verdana, arial, sans-serif; font-size: 11px; line-height: 16px; color: #000000; font-weight: normal; } #PageContent { text-align: left; background-color: #fff; padding: 0px; margin: 0px; padding-bottom:20px; } /* ** when this stylesheet is used for the Tiny MCE Wysiwyg editor's edit area, we can't ** use an id=PageContent or class=wiki-content, so we must ** set the body style to that used for PageContent, and p to that used for wiki-content. */ body { margin: 0px; padding: 0px; text-align: center; background-color: #f0f0f0; } @media print { body { background-color: #fff; } } .monospaceInput { font:12px monospace } .wiki-content p, .commentblock p { margin: 16px 0px 16px 0px; padding: 0px; } .wiki-content-preview { padding: 5px; border-left: 1px solid #3c78b5; border-right: 1px solid #3c78b5; } ul, ol { margin-top: 2px; margin-bottom: 2px; padding-top: 0px; padding-bottom: 0px; } pre { padding: 0px; margin-top: 5px; margin-left: 15px; margin-bottom: 5px; margin-right: 5px; text-align: left; } .helpheading { font-weight: bold; background-color: #D0D9BD; border-bottom: 1px solid #3c78b5; padding: 4px 4px 4px 4px; margin: 0px; margin-top: 10px; } .helpcontent { padding: 4px 4px 20px 4px; background-color: #f5f7f1; } .code { border: 1px dashed #3c78b5; font-size: 11px; font-family: Courier; margin: 10px; line-height: 13px; } .focusedComment { background: #ffffce; } .commentBox, .focusedComment { padding: 10px; margin: 5px 0 5px 0; border: 1px #bbb solid; } .codeHeader { background-color: #f0f0f0; border-bottom: 1px dashed #3c78b5; padding: 3px; text-align: center; } .codeContent { text-align: left; background-color: #f0f0f0; padding: 3px; } .preformatted { border: 1px dashed #3c78b5; font-size: 11px; font-family: Courier; margin: 10px; line-height: 13px; } .preformattedHeader { background-color: #f0f0f0; border-bottom: 1px dashed #3c78b5; padding: 3px; text-align: center; } .preformattedContent { background-color: #f0f0f0; padding: 3px; } .panel { border: 1px dashed #3c78b5; margin: 10px; margin-top: 0px; } .panelHeader { background-color: #f0f0f0; border-bottom: 1px dashed #3c78b5; padding: 3px; text-align: center; } .panelContent { background-color: #f0f0f0; padding: 5px; } .anonymousAlert { background-color: #f0f0f0; border: 1px dashed red; font-size: 11px; padding: 10px 5px 10px 5px; margin: 4px; line-height: 13px; } .lockAlert { background-color: #f0f0f0; width: 50%; border: 1px dashed red; font-size: 11px; padding: 10px 5px 10px 5px; margin: 4px; line-height: 13px; } .code-keyword { color: #000091; background-color: inherit; } .code-object { color: #910091; background-color: inherit; } .code-quote { color: #009100; background-color: inherit; } .code-comment { color: #808080; background-color: inherit; } .code-xml .code-keyword { color: inherit; font-weight: bold; } .code-tag { color: #000091; background-color: inherit; } .breadcrumbs { background-color: #f0f0f0; border-color: #3c78b5; border-width: 1px 0px 1px 0px; border-style: solid; font-size: 11px; padding: 3px 0px 3px 0px; } .navmenu { border: 1px solid #ccc; } .menuheading { font-weight: bold; background-color: #f0f0f0; border-bottom: 1px solid #3c78b5; padding: 4px 4px 2px 4px; } .menuitems { padding: 4px 4px 20px 4px; } .rightpanel { border-left: 1px solid #ccc; border-bottom: 1px solid #ccc; } #helpheading { text-align: left; font-weight: bold; background-color: #D0D9BD; border-bottom: 1px solid #3c78b5; padding: 4px 4px 4px 4px; margin: 0px; } #helpcontent { padding: 4px 4px 4px 4px; background-color: #f5f7f1; } .helptab-unselected { font-weight: bold; padding: 5px; background-color: #f5f7f1; } .helptab-selected { font-weight: bold; background-color: #D0D9BD; padding: 5px; } .helptabs { margin: 0px; background-color: #f5f7f1; padding: 5px; } .infopanel-heading { font-weight: bold; padding: 4px 0px 2px 0px; } .pagebody { } .pageheader { padding: 5px 5px 5px 0px; border-bottom: 1px solid #3c78b5; } .pagetitle { font-size: 22px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; } .newpagetitle { color: #ccc !important; } .steptitle { font-size: 18px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; margin-bottom: 7px; } .substeptitle { font-size: 12px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; margin: 2px 4px 4px 4px; padding: 2px 4px 1px 4px; } .stepdesc { font-family: Verdana, arial, sans-serif; font-size: 11px; line-height: 16px; font-weight: normal; color: #666666; margin-top: 7px; margin-bottom: 7px; } .steplabel { font-weight: bold; margin-right: 4px; color: black; float: left; width: 15%; text-align: right; } .stepfield { background: #f0f0f0; padding: 5px; } .submitButtons{ margin-top:5px; text-align:right; } .formtitle { font-size: 12px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; } .sectionbottom { border-bottom: 1px solid #3c78b5; } .topRow { border-top: 2px solid #3c78b5; } .tabletitle { font-size: 14px; font-weight: bold; font-family: Arial, sans-serif; padding: 3px 0px 2px 0px; margin: 8px 4px 2px 0px; color: #003366; border-bottom: 2px solid #3c78b5; } .pagesubheading { color: #666666; font-size: 10px; padding: 0px 0px 5px 0px; } HR { color: 3c78b5; height: 1; } A:link, A:visited, A:active, A:hover { color: #003366; } h1 A:link, h1 A:visited, h1 A:active { text-decoration: none; } h1 A:hover { border-bottom: 1px dotted #003366; } .wiki-content > :first-child, .commentblock > :first-child { margin-top: 3px; } .logocell { padding: 10px; } input { font-family: verdana, geneva, arial, sans-serif; font-size: 11px; color: #000000; } textarea, textarea.editor { font-family: verdana, geneva, arial, sans-serif; font-size: 11px; color: #333333; } /* use logoSpaceLink instead. .spacenametitle { font: 21px/31px Impact, Arial, Helvetica; font-weight: 100; color: #999999; margin: 0px; } .spacenametitle img { margin: 0 0 -4px 0; } .spacenametitle a { text-decoration: none; color: #999999; } .spacenametitle a:visited { text-decoration: none; color: #999999; }*/ .spacenametitle-printable { font: 20px/25px Impact, Arial, Helvetica; font-weight: 100; color: #999999; margin: 0px; } .spacenametitle-printable a { text-decoration: none; color: #999999; } .spacenametitle-printable a:visited { text-decoration: none; color: #999999; } .blogDate { font-weight: bold; text-decoration: none; color: black; } .blogSurtitle { background: #f0f0f0; border: 1px solid #ddd; padding: 3px; margin: 1px 1px 10px 1px; } .blogHeading { font-size: 20px; line-height: normal; font-weight: bold; padding: 0px; margin: 0px; } .blogHeading a { text-decoration: none; color: black; } .endsection { align: right; color: #666666; margin-top: 10px; } .endsectionleftnav { align: right; color: #666666; margin-top: 10px; } h1 { font-size: 24px; line-height: normal; font-weight: bold; background-color: #f0f0f0; color: #003366; border-bottom: 1px solid #3c78b5; padding: 2px; margin: 36px 0px 4px 0px; } h2 { font-size: 18px; line-height: normal; font-weight: bold; background-color: #f0f0f0; border-bottom: 1px solid #3c78b5; padding: 2px; margin: 27px 0px 4px 0px; } h3 { font-size: 14px; line-height: normal; font-weight: bold; background-color: #f0f0f0; padding: 2px; margin: 21px 0px 4px 0px; } h4 { font-size: 12px; line-height: normal; font-weight: bold; background-color: #f0f0f0; padding: 2px; margin: 18px 0px 4px 0px; } h4.search { font-size: 12px; line-height: normal; font-weight: normal; background-color: #f0f0f0; padding: 4px; margin: 18px 0px 4px 0px; } h5 { font-size: 10px; line-height: normal; font-weight: bold; background-color: #f0f0f0; padding: 2px; margin: 14px 0px 4px 0px; } h6 { font-size: 8px; line-height: normal; font-weight: bold; background-color: #f0f0f0; padding: 2px; margin: 14px 0px 4px 0px; } .smallfont { font-size: 10px; } .descfont { font-size: 10px; color: #666666; } .smallerfont { font-size: 9px; } .smalltext { color: #666666; font-size: 10px; } .smalltext a { color: #666666; } .smalltext-blue { color: #3c78b5; font-size: 10px; } .surtitle { margin-left: 1px; margin-bottom: 5px; font-size: 14px; color: #666666; } /* css hack found here: http://www.fo3nix.pwp.blueyonder.co.uk/tutorials/css/hacks/ */ .navItemOver { font-size: 10px; font-weight: bold; color: #ffffff; background-color: #003366; cursor: hand; voice-family: '\'}\''; voice-family:inherit; cursor: pointer;} .navItemOver a { color: #ffffff; background-color:#003366; text-decoration: none; } .navItemOver a:visited { color: #ffffff; background-color:#003366; text-decoration: none; } .navItemOver a:hover { color: #ffffff; background-color:#003366; text-decoration: none; } .navItem { font-size: 10px; font-weight: bold; color: #ffffff; background-color: #3c78b5; } .navItem a { color: #ffffff; text-decoration: none; } .navItem a:hover { color: #ffffff; text-decoration: none; } .navItem a:visited { color: #ffffff; text-decoration: none; } div.padded { padding: 4px; } div.thickPadded { padding: 10px; } h3.macrolibrariestitle { margin: 0px 0px 0px 0px; } div.centered { text-align: center; margin: 10px; } div.centered table {margin: 0px auto; text-align: left; } .tableview table { margin: 0; } .tableview th { text-align: left; color: #003366; font-size: 12px; padding: 5px 0px 0px 5px; border-bottom: 2px solid #3c78b5; } .tableview td { text-align: left; border-color: #ccc; border-width: 0px 0px 1px 0px; border-style: solid; margin: 0; padding: 4px 10px 4px 5px; } .grid { margin: 2px 0px 5px 0px; border-collapse: collapse; } .grid th { border: 1px solid #ccc; padding: 2px 4px 2px 4px; background: #f0f0f0; text-align: center; } .grid td { border: 1px solid #ccc; padding: 3px 4px 3px 4px; } .gridHover { background-color: #f9f9f9; } td.infocell { background-color: #f0f0f0; } .label { font-weight: bold; color: #003366; } label { font-weight: bold; color: #003366; } .error { background-color: #fcc; } .errorBox { background-color: #fcc; border: 1px solid #c00; padding: 5px; margin: 5px; } .errorMessage { color: #c00; } .success { background-color: #dfd; } .successBox { background-color: #dfd; border: 1px solid #090; padding: 5px; margin-top:5px; margin-bottom:5px; } blockquote { padding-left: 10px; padding-right: 10px; margin-left: 5px; margin-right: 0px; border-left: 1px solid #3c78b5; } table.confluenceTable { margin: 5px; border-collapse: collapse; } /* Added as a temporary fix for CONF-4223. The table elements appear to be inheriting the border: none attribute from the sectionMacro class */ table.confluenceTable td.confluenceTd { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; } /* Added as a temporary fix for CONF-4223. The table elements appear to be inheriting the border: none attribute from the sectionMacro class */ table.confluenceTable th.confluenceTh { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; background-color: #f0f0f0; text-align: center; } td.confluenceTd { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; } th.confluenceTh { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; background-color: #f0f0f0; text-align: center; } DIV.small { font-size: 9px; } H1.pagename { margin-top: 0px; } IMG.inline {} .loginform { margin: 5px; border: 1px solid #ccc; } /* The text how the "This is a preview" comment should be shown. */ .previewnote { text-align: center; font-size: 11px; color: red; } /* How the preview content should be shown */ .previewcontent { background: #E0E0E0; } /* How the system messages should be shown (DisplayMessage.jsp) */ .messagecontent { background: #E0E0E0; } /* How the "This page has been modified..." -comment should be shown. */ .conflictnote { } .createlink { color: maroon; } a.createlink { color: maroon; } .templateparameter { font-size: 9px; color: darkblue; } .diffadded { background: #ddffdd; padding: 1px 1px 1px 4px; border-left: 4px solid darkgreen; } .diffdeleted { color: #999; background: #ffdddd; padding: 1px 1px 1px 4px; border-left: 4px solid darkred; } .diffnochange { padding: 1px 1px 1px 4px; border-left: 4px solid lightgrey; } .differror { background: brown; } .diff { font-family: lucida console, courier new, fixed-width; font-size: 12px; line-height: 14px; } .diffaddedchars { background-color:#99ff99; font-weight:bolder; } .diffremovedchars { background-color:#ff9999; text-decoration: line-through; font-weight:bolder; } .greybackground { background: #f0f0f0 } .greybox { border: 1px solid #ddd; padding: 3px; margin: 1px 1px 10px 1px; } .borderedGreyBox { border: 1px solid #cccccc; background-color: #f0f0f0; padding: 10px; } .greyboxfilled { border: 1px solid #ddd; background: #f0f0f0; padding: 3px; margin: 1px 1px 10px 1px; } .navBackgroundBox { padding: 5px 5px 5px 5px; font-size: 22px; font-weight: bold; font-family: Arial, sans-serif; color: white; background: #3c78b5; text-decoration: none; } .previewBoxTop { background-color: #f0f0f0; border-width: 1px 1px 0px 1px; border-style: solid; border-color: #3c78b5; padding: 5px; margin: 5px 0px 0px 0px; text-align: center; } .previewContent { background-color: #fff; border-color: #3c78b5; border-width: 0px 1px 0px 1px; border-style: solid; padding: 10px; margin: 0px; } .previewBoxBottom { background-color: #f0f0f0; border-width: 0px 1px 1px 1px; border-style: solid; border-color: #3c78b5; padding: 5px; margin: 0px 0px 5px 0px; text-align: center; } .functionbox { background-color: #f0f0f0; border: 1px solid #3c78b5; padding: 3px; margin: 1px 1px 10px 1px; } .functionbox-greyborder { background-color: #f0f0f0; border: 1px solid #ddd; padding: 3px; margin: 1px 1px 10px 1px; } .search-highlight { background-color: #ffffcc; } /* normal (white) background */ .rowNormal { background-color: #ffffff; } /* alternate (pale yellow) background */ .rowAlternate { background-color: #f7f7f7; } /* used in the list attachments table */ .rowAlternateNoBottomColor { background-color: #f7f7f7; } .rowAlternateNoBottomNoColor { } .rowAlternateNoBottomColor td { border-bottom: 0px; } .rowAlternateNoBottomNoColor td { border-bottom: 0px; } /* row highlight (grey) background */ .rowHighlight { background-color: #f0f0f0; } TD.greenbar {FONT-SIZE: 2px; BACKGROUND: #00df00; BORDER: 1px solid #9c9c9c; PADDING: 0px; } TD.redbar {FONT-SIZE: 2px; BACKGROUND: #df0000; BORDER: 1px solid #9c9c9c; PADDING: 0px; } TD.darkredbar {FONT-SIZE: 2px; BACKGROUND: #af0000; BORDER: 1px solid #9c9c9c; PADDING: 0px; } TR.testpassed {FONT-SIZE: 2px; BACKGROUND: #ddffdd; PADDING: 0px; } TR.testfailed {FONT-SIZE: 2px; BACKGROUND: #ffdddd; PADDING: 0px; } .toolbar { margin: 0px; border-collapse: collapse; } .toolbar td { border: 1px solid #ccc; padding: 2px 2px 2px 2px; color: #ccc; } td.noformatting { border-width: 0px; border-style: none; text-align: center; padding: 0px; } .commentblock { margin: 12px 0 12px 0; } /* * Divs displaying the license information, if necessary. */ .license-eval, .license-none, .license-nonprofit { border-top: 1px solid #bbbbbb; text-align: center; font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; } .license-eval, .license-none { background-color: #ffcccc; } .license-eval b, .license-none b { color: #990000 } .license-nonprofit { background-color: #ffffff; } /* * The shadow at the bottom of the page between the main content and the * "powered by" section. */ .bottomshadow { height: 12px; background-image: url("$req.contextPath/images/border/border_bottom.gif"); background-repeat: repeat-x; } /* * Styling of the operations box */ .navmenu .operations li, .navmenu .operations ul { list-style: none; margin-left: 0; padding-left: 0; } .navmenu .operations ul { margin-bottom: 9px; } .navmenu .label { font-weight: inherit; } /* * Styling of ops as a toolbar */ .toolbar div { display: none; } .toolbar .label { display: none; } .toolbar .operations { display: block; } .toolbar .operations ul { display: inline; list-style: none; margin-left: 10px; padding-left: 0; } .toolbar .operations li { list-style: none; display: inline; } /* list page navigational tabs */ #foldertab { padding: 3px 0px 3px 8px; margin-left: 0; border-bottom: 1px solid #3c78b5; font: bold 11px Verdana, sans-serif; } #foldertab li { list-style: none; margin: 0; display: inline; } #foldertab li a { padding: 3px 0.5em; margin-left: 3px; border: 1px solid #3c78b5; border-bottom: none; background: #3c78b5; text-decoration: none; } #foldertab li a:link { color: #ffffff; } #foldertab li a:visited { color: #ffffff; } #foldertab li a:hover { color: #ffffff; background: #003366; border-color: #003366; } #foldertab li a.current { background: white; border-bottom: 1px solid white; color: black; } #foldertab li a.current:link { color: black; } #foldertab li a.current:visited { color: black; } #foldertab li a.current:hover { background: white; border-bottom: 1px solid white; color: black; } /* alphabet list */ ul#squaretab { margin-left: 0; padding-left: 0; white-space: nowrap; font: bold 8px Verdana, sans-serif; } #squaretab li { display: inline; list-style-type: none; } #squaretab a { padding: 2px 6px; border: 1px solid #3c78b5; } #squaretab a:link, #squaretab a:visited { color: #fff; background-color: #3c78b5; text-decoration: none; } #squaretab a:hover { color: #ffffff; background-color: #003366; border-color: #003366; text-decoration: none; } #squaretab li a#current { background: white; color: black; } .blogcalendar * { font-family:verdana, arial, sans-serif; font-size:x-small; font-weight:normal; line-height:140%; padding:2px; } table.blogcalendar { border: 1px solid #3c78b5; } .blogcalendar th.calendarhead, a.calendarhead { font-size:x-small; font-weight:bold; padding:2px; text-transform:uppercase; background-color: #3c78b5; color: #ffffff; letter-spacing: .3em; text-transform: uppercase; } .calendarhead:visited {color: white;} .calendarhead:active {color: white;} .calendarhead:hover {color: white;} .blogcalendar th { font-size:x-small; font-weight:bold; padding:2px; background-color:#f0f0f0; } .blogcalendar td { font-size:x-small; font-weight:normal; } .searchGroup { padding: 0 0 10px 0; background: #f0f0f0; } .searchGroupHeading { font-size: 10px; font-weight: bold; color: #ffffff; background-color: #3c78b5; padding: 2px 4px 1px 4px; } .searchItem { padding: 1px 4px 1px 4px; } .searchItemSelected { padding: 1px 4px 1px 4px; font-weight: bold; background: #ddd; } /* permissions page styles */ .permissionHeading { border-bottom: #bbb; border-width: 0 0 1px 0; border-style: solid; font-size: 16px; text-align: left; } .permissionTab { border-width: 0 0 0 1px; border-style: solid; background: #3c78b5; color: #ffffff; font-size: 10px; } .permissionSuperTab { border-width: 0 0 0 1px; border-style: solid; background: #003366; color: #ffffff; } .permissionCell { border-left: #bbb; border-width: 0 0 0 1px; border-style: solid; } /* warning panel */ .warningPanel { background: #FFFFCE; border:#F0C000 1px solid; padding: 8px; margin: 10px; } /* alert panel */ .alertPanel { background: #FFCCCC; border:#C00 1px solid; padding: 8px; margin: 10px; } /* info panel */ .infoPanel { background: #D8E4F1; border:#3c78b5 1px solid; padding: 8px; margin: 10px; } /* side menu highlighting (e.g. space content screen) */ .optionPadded { padding: 2px; } .optionSelected { background-color: #ffffcc; padding: 2px; border: 1px solid #ddd; margin: -1px; } .optionSelected a { font-weight: bold; text-decoration: none; color: black; } /* information macros */ .noteMacro { border-style: solid; border-width: 1px; border-color: #F0C000; background-color: #FFFFCE; text-align:left; margin-top: 5px; margin-bottom: 5px} .warningMacro { border-style: solid; border-width: 1px; border-color: #c00; background-color: #fcc; text-align:left; margin-top: 5px; margin-bottom: 5px} .infoMacro { border-style: solid; border-width: 1px; border-color: #3c78b5; background-color: #D8E4F1; text-align:left; margin-top: 5px; margin-bottom: 5px} .tipMacro { border-style: solid; border-width: 1px; border-color: #090; background-color: #dfd; text-align:left; margin-top: 5px; margin-bottom: 5px} .informationMacroPadding { padding: 5px 0 0 5px; } table.infoMacro td, table.warningMacro td, table.tipMacro td, table.noteMacro td, table.sectionMacro td { border: none; } table.sectionMacroWithBorder td.columnMacro { border-style: dashed; border-width: 1px; border-color: #cccccc;} .pagecontent { padding: 10px; text-align: left; } /* styles for links in the top bar */ .topBarDiv a:link {color: #ffffff;} .topBarDiv a:visited {color: #ffffff;} .topBarDiv a:active {color: #ffffff;} .topBarDiv a:hover {color: #ffffff;} .topBarDiv {color: #ffffff;} .topBar { background-color: #003366; } /* styles for extended operations */ .greyLinks a:link {color: #666666; text-decoration:underline;} .greyLinks a:visited {color: #666666; text-decoration:underline;} .greyLinks a:active {color: #666666; text-decoration:underline;} .greyLinks a:hover {color: #666666; text-decoration:underline;} .greyLinks {color: #666666; display:block; padding: 10px} .logoSpaceLink {color: #999999; text-decoration: none} .logoSpaceLink a:link {color: #999999; text-decoration: none} .logoSpaceLink a:visited {color: #999999; text-decoration: none} .logoSpaceLink a:active {color: #999999; text-decoration: none} .logoSpaceLink a:hover {color: #003366; text-decoration: none} /* basic panel (basicpanel.vmd) style */ .basicPanelContainer {border: 1px solid #3c78b5; margin-top: 2px; margin-bottom: 8px; width: 100%} .basicPanelTitle {padding: 5px; margin: 0px; background-color: #f0f0f0; color: black; font-weight: bold;} .basicPanelBody {padding: 5px; margin: 0px} .separatorLinks a:link {color: white} .separatorLinks a:visited {color: white} .separatorLinks a:active {color: white} .greynavbar {background-color: #f0f0f0; border-top: 1px solid #3c78b5; margin-top: 2px} div.headerField { float: left; width: auto; height: 100%; } .headerFloat { margin-left: auto; width: 50%; } .headerFloatLeft { float: left; margin-right: 20px; margin-bottom: 10px; } #headerRow { padding: 10px; } div.license-personal { background-color: #003366; color: #ffffff; } div.license-personal a { color: #ffffff; } .greyFormBox { border: 1px solid #cccccc; padding: 5px; } /* IE automatically adds a margin before and after form tags. Use this style to remove that */ .marginlessForm { margin: 0px; } .openPageHighlight { background-color: #ffffcc; padding: 2px; border: 1px solid #ddd; } .editPageInsertLinks, .editPageInsertLinks a { color: #666666; font-weight: bold; font-size: 10px; } /* Style for label heatmap. */ .top10 a { font-weight: bold; font-size: 2em; color: #003366; } .top25 a { font-weight: bold; font-size: 1.6em; color: #003366; } .top50 a { font-size: 1.4em; color: #003366; } .top100 a { font-size: 1.2em; color: #003366; } .heatmap { list-style:none; width: 95%; margin: 0px auto; } .heatmap a { text-decoration:none; } .heatmap a:hover { text-decoration:underline; } .heatmap li { display: inline; } .minitab { padding: 3px 0px 3px 8px; margin-left: 0; margin-top: 1px; margin-bottom: 0px; border-bottom: 1px solid #3c78b5; font: bold 9px Verdana, sans-serif; text-decoration: none; float:none; } .selectedminitab { padding: 3px 0.5em; margin-left: 3px; margin-top: 1px; border: 1px solid #3c78b5; background: white; border-bottom: 1px solid white; color: #000000; text-decoration: none; } .unselectedminitab { padding: 3px 0.5em; margin-left: 3px; margin-top: 1px; border: 1px solid #3c78b5; border-bottom: none; background: #3c78b5; color: #ffffff; text-decoration: none; } a.unselectedminitab:hover { color: #ffffff; background: #003366; border-color: #003366; } a.unselectedminitab:link { color: white; } a.unselectedminitab:visited { color: white; } a.selectedminitab:link { color: black; } a.selectedminitab:visited { color: black; } .linkerror { background-color: #fcc;} a.labelOperationLink:link {text-decoration: underline} a.labelOperationLink:active {text-decoration: underline} a.labelOperationLink:visited {text-decoration: underline} a.labelOperationLink:hover {text-decoration: underline} a.newLabel:link {background-color: #ddffdd} a.newLabel:active {background-color: #ddffdd} a.newLabel:visited {background-color: #ddffdd} a.newLabel:hover {background-color: #ddffdd} ul.square {list-style-type: square} .inline-control-link { background: #ffc; font-size: 9px; color: #666; padding: 2px; text-transform: uppercase; text-decoration: none; } .inline-control-link a:link {text-decoration: none} .inline-control-link a:active {text-decoration: none} .inline-control-link a:visited {text-decoration: none} .inline-control-link a:hover {text-decoration: none} .inline-control-link { background: #ffc; font-size: 9px; color: #666; padding: 2px; text-transform: uppercase; text-decoration: none; cursor: pointer; } div.auto_complete { width: 350px; background: #fff; } div.auto_complete ul { border: 1px solid #888; margin: 0; padding: 0; width: 100%; list-style-type: none; } div.auto_complete ul li { margin: 0; padding: 3px; } div.auto_complete ul li.selected { background-color: #ffb; } div.auto_complete ul strong.highlight { color: #800; margin: 0; padding: 0; } /******* Edit Page Styles *******/ .toogleFormDiv{ border:1px solid #A7A6AA; background-color:white; padding:5px; margin-top: 5px; } .toogleInfoDiv{ border:1px solid #A7A6AA; background-color:white; display:none; padding:5px; margin-top: 10px; } .inputSection{ margin-bottom:20px; } #editBox{ border:1px solid lightgray; background-color:#F0F0F0; } /******* Left Navigation Theme Styles ********/ .leftnav li a { text-decoration:none; color:white; margin:0px; display:block; padding:2px; padding-left:5px; background-color: #3c78b5; border-top:1px solid #3c78b5; } .leftnav li a:active {color:white;} .leftnav li a:visited {color:white;} .leftnav li a:hover {background-color: #003366; color:white;} /* Added by Shaun during i18n */ .replaced { background-color: #33CC66; } .topPadding { margin-top: 20px; } /* new form style */ .form-block { padding: 6px; } .form-error-block { padding: 6px; background: #fcc; border-top: #f0f0f0 1px solid; border-bottom: #f0f0f0 1px solid; margin-bottom: 6px; padding: 0 12px 0 12px; } .form-element-large { font-size: 16px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; } .form-element-small { font-size: 12px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; } .form-header { background: lightyellow; border-top: #f0f0f0 1px solid; border-bottom: #f0f0f0 1px solid; margin-bottom: 6px; padding: 0 12px 0 12px; } .form-header p, .form-block p, .form-error-block p { line-height: normal; margin: 12px 0 12px 0; } .form-example { color: #888; font-size: 11px; } .form-divider { border-bottom: #ccc 1px solid; margin-bottom: 6px; } .form-buttons { margin-top: 6px; border-top: #ccc 1px solid; border-bottom: #ccc 1px solid; background: #f0f0f0; padding: 10px; text-align: center; } .form-buttons input { width: 100px; } .form-block .error { padding: 6px; margin-bottom: 6px; } --> </style> </head> <body> <div id="PageContent"> <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%"><tr> <td valign="top" class="pagebody"> <div class="pageheader"> <span class="pagetitle"> New News: <a href="http://cwiki.apache.org/confluence/display/openjpa}">openjpa</a> : <a href="http://cwiki.apache.org/confluence/display/openjpa/2008/09/11/Nightly+builds+available+again">Nightly builds available again</a> </span> </div> <p> <a href="http://cwiki.apache.org/confluence/display/openjpa/2008/09/11/Nightly+builds+available+again">Nightly builds available again</a> has been created by <a href="http://cwiki.apache.org/confluence/display/~michael.d.dick@gmail.com">Michael Dick</a> <span class="smallfont">(Sep 11, 2008)</span>. </p> <span class="label">Content:</span><br /> <div class="greybox wiki-content"><p>Links to "nightly" (latest) builds are back on the Documentation and Downloads pages. These builds will be updated nightly if there have been changes made to trunk in SVN. </p> <p>-mike</p></div> </td></tr></table></div> <p> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td height="12" background="http://cwiki.apache.org/confluence/images/border/border_bottom.gif"><img src="http://cwiki.apache.org/confluence/images/border/spacer.gif" width="1" height="1" border="0"/></td> </tr> </table> <div class="smalltext"> Powered by <a href="http://www.atlassian.com/software/confluence/default.jsp?clicked=footer" class="smalltext">Atlassian Confluence</a> (Version: 2.2.9 Build:#527 Sep 07, 2006) - <a href="http://jira.atlassian.com/secure/BrowseProject.jspa?id=10470" class="smalltext">Bug/feature request</a><br/> <br> <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action">Unsubscribe or edit your notifications preferences</a> </div> </body> </html> From commits-return-3365-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Thu Sep 11 18:48:32 2008 Return-Path: <commits-return-3365-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 2910 invoked from network); 11 Sep 2008 18:48:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Sep 2008 18:48:32 -0000 Received: (qmail 30012 invoked by uid 500); 11 Sep 2008 18:48:30 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 29995 invoked by uid 500); 11 Sep 2008 18:48:30 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 29986 invoked by uid 99); 11 Sep 2008 18:48:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Sep 2008 11:48:29 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 Sep 2008 18:47:39 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 4CFE52388970; Thu, 11 Sep 2008 11:47:41 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r694412 - in /openjpa/branches/sql-cache: openjpa-kernel/src/main/java/org/apache/openjpa/conf/ openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/ ope... Date: Thu, 11 Sep 2008 18:47:38 -0000 To: commits@openjpa.apache.org From: ppoddar@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080911184741.4CFE52388970@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ppoddar Date: Thu Sep 11 11:47:36 2008 New Revision: 694412 URL: http://svn.apache.org/viewvc?rev=694412&view=rev Log: Refactor package location closer to kernel, add exclusion pattern, add comments Added: openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PreparedQuery.java - copied, changed from r694111, openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQuery.java openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PreparedQueryCache.java - copied, changed from r694135, openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQueryCache.java openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PreparedQueryCacheImpl.java openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryStatistics.java - copied, changed from r694135, openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryStatistics.java openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCacheExclusion.java Removed: openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQuery.java openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQueryCache.java openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryStatistics.java Modified: openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfiguration.java openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/PreparedQueryCacheValue.java openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java Modified: openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfiguration.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfiguration.java?rev=694412&r1=694411&r2=694412&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfiguration.java (original) +++ openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfiguration.java Thu Sep 11 11:47:36 2008 @@ -29,13 +29,13 @@ import org.apache.openjpa.event.RemoteCommitProvider; import org.apache.openjpa.kernel.AutoClear; import org.apache.openjpa.kernel.AutoDetach; -import org.apache.openjpa.kernel.Broker; import org.apache.openjpa.kernel.BrokerFactory; import org.apache.openjpa.kernel.BrokerImpl; import org.apache.openjpa.kernel.ConnectionRetainModes; import org.apache.openjpa.kernel.FetchConfiguration; import org.apache.openjpa.kernel.InverseManager; import org.apache.openjpa.kernel.LockManager; +import org.apache.openjpa.kernel.PreparedQueryCache; import org.apache.openjpa.kernel.QueryFlushModes; import org.apache.openjpa.kernel.RestoreState; import org.apache.openjpa.kernel.SavepointManager; @@ -46,7 +46,6 @@ import org.apache.openjpa.lib.conf.Configuration; import org.apache.openjpa.meta.MetaDataFactory; import org.apache.openjpa.meta.MetaDataRepository; -import org.apache.openjpa.persistence.PreparedQueryCache; import org.apache.openjpa.util.ClassResolver; import org.apache.openjpa.util.ProxyManager; import org.apache.openjpa.util.StoreFacadeTypeRegistry; Modified: openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java?rev=694412&r1=694411&r2=694412&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java (original) +++ openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/OpenJPAConfigurationImpl.java Thu Sep 11 11:47:36 2008 @@ -38,6 +38,7 @@ import org.apache.openjpa.kernel.InverseManager; import org.apache.openjpa.kernel.LockLevels; import org.apache.openjpa.kernel.LockManager; +import org.apache.openjpa.kernel.PreparedQueryCache; import org.apache.openjpa.kernel.QueryFlushModes; import org.apache.openjpa.kernel.RestoreState; import org.apache.openjpa.kernel.SavepointManager; @@ -49,7 +50,6 @@ import org.apache.openjpa.lib.util.Localizer; import org.apache.openjpa.meta.MetaDataFactory; import org.apache.openjpa.meta.MetaDataRepository; -import org.apache.openjpa.persistence.PreparedQueryCache; import org.apache.openjpa.util.ClassResolver; import org.apache.openjpa.util.ImplHelper; import org.apache.openjpa.util.ProxyManager; Modified: openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/PreparedQueryCacheValue.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/PreparedQueryCacheValue.java?rev=694412&r1=694411&r2=694412&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/PreparedQueryCacheValue.java (original) +++ openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/conf/PreparedQueryCacheValue.java Thu Sep 11 11:47:36 2008 @@ -19,7 +19,6 @@ package org.apache.openjpa.conf; import org.apache.openjpa.lib.conf.PluginValue; -import org.apache.openjpa.persistence.PreparedQueryCache; /** * A cache of prepared queries indexed by an identifier. @@ -32,7 +31,7 @@ extends PluginValue { public static final String[] ALIASES = { - "true", PreparedQueryCache.class.getName(), + "true", "org.apache.openjpa.kernel.PreparedQueryCacheImpl", "false", null, }; Copied: openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PreparedQuery.java (from r694111, openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQuery.java) URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PreparedQuery.java?p2=openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PreparedQuery.java&p1=openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQuery.java&r1=694111&r2=694412&rev=694412&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQuery.java (original) +++ openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PreparedQuery.java Thu Sep 11 11:47:36 2008 @@ -16,76 +16,81 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.openjpa.persistence; +package org.apache.openjpa.kernel; -import org.apache.openjpa.kernel.Query; -import org.apache.openjpa.kernel.QueryHints; /** - * A prepared query binds a compiled query to its target SQL. + * A prepared query associates a compiled query to a <em>parsed state</em> that + * can be executed possibly with more efficiency. An obvious example is to + * associate a compiled query to an executable SQL string. * - * The target SQL is meant to be executed directly bypassing the critical - * cost of constructing the SQL on every query execution. As the subsequent - * execution of a cached query will bypass compilation as a JPQL query, - * the post-compilation state of the original query is captured in this receiver - * to be transferred to the executable query instance. + * The query expressed in target language can be executed directly bypassing + * the critical translation cost to the data store target language on every + * execution. * - * The target SQL depends on context of query execution such as fetch plan or - * lock group. No attempt is made to monitor and automatically invalidate a - * prepared SQL when the same query is executed with different context - * parameters. + * As the subsequent execution of a cached query will bypass normal query + * compilation, the post-compilation state of the original query is captured by + * this receiver to be transferred to the executable query instance. * - * The user must set a {@link QueryHints#HINT_INVALIDATE_PREPARED_QUERY hint} to - * invalidate. + * This receiver must not hold any context-sensitive reference or dependency. + * Because the whole idea of preparing a query (for a cost) is to be able to + * execute the same logical query in different persistence contexts. However, + * a prepared query may not be valid when some parameters of execution context + * such as lock group or fetch plan changes in a way that will change the target + * query. Refer to {@link PreparedQueryCache} for invalidation mechanism on + * possible actions under such circumstances. + * + * The query execution model <em>does</em> account for context changes that do + * not impact the target query e.g. bind variables. * * @author Pinaki Poddar * * @since 1.3.0 - * @nojavadoc */ public class PreparedQuery { - private final String _sql; + private final String _ex; private final String _id; - // Post-compilation state of an executable query - Class _candidate = null; - boolean _subclasses = true; - boolean _isProjection = false; - + // Post-compilation state of an executable query, populated on construction + private Class _candidate; + private boolean _subclasses; + private boolean _isProjection; + + /** + * + * @param id an identifier for this query to be used as cache key + * @param corresponding data store language expression + * @param compiled a compiled query + */ public PreparedQuery(String id, String sql, Query compiled) { this._id = id; - this._sql = sql; + this._ex = sql; - _candidate = compiled.getCandidateType(); - _subclasses = compiled.hasSubclasses(); - _isProjection = compiled.getProjectionAliases().length > 0; + if (compiled != null) { + _candidate = compiled.getCandidateType(); + _subclasses = compiled.hasSubclasses(); + _isProjection = compiled.getProjectionAliases().length > 0; + } } public String getIdentifier() { return _id; } - public String getSQL() { - return _sql; - } - - public String toString() { - return "PreparedQuery " + _id + "==>" + _sql; + public String getDatastoreAction() { + return _ex; } - void setInto(Query q) { -// q.setCandidateCollection(last.getCandidateCollection()); -// q.setCandidateExtent(last.getCandidateExtent()); - + /** + * Pours the post-compilation state held by this receiver to the given + * query. + */ + public void setInto(Query q) { if (!_isProjection) q.setCandidateType(_candidate, _subclasses); - -// q.setIgnoreChanges(last.getIgnoreChanges()); -// q.setRange(last.getStartRange(), last.getEndRange()); -// q.setReadOnly(last.isReadOnly()); -// q.setResultMapping(last.getResultMappingScope(), -// last.getResultMappingName()); -// q.setResultType(last.getResultType()); -// q.setUnique(last.isUnique()); + } + + public String toString() { + return "PreparedQuery: [" + _id + "] --> [" + _ex + "]"; } } Copied: openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PreparedQueryCache.java (from r694135, openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQueryCache.java) URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PreparedQueryCache.java?p2=openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PreparedQueryCache.java&p1=openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQueryCache.java&r1=694135&r2=694412&rev=694412&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/PreparedQueryCache.java (original) +++ openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PreparedQueryCache.java Thu Sep 11 11:47:36 2008 @@ -16,222 +16,137 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.openjpa.persistence; +package org.apache.openjpa.kernel; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Collections; -import java.util.HashMap; -import java.util.HashSet; import java.util.List; import java.util.Map; -import java.util.Set; -import java.util.TreeMap; -import java.util.concurrent.locks.ReentrantLock; -import org.apache.commons.lang.StringUtils; -import org.apache.openjpa.kernel.QueryHints; import org.apache.openjpa.lib.conf.Configurable; -import org.apache.openjpa.lib.conf.Configuration; /** * A cache to maintain {@link PreparedQuery prepared queries}. * - * The target SQL depends on context of query execution such as fetch plan or - * lock group. No attempt is made to monitor and automatically invalidate a - * prepared SQL when the same query is executed with different context - * parameters. + * The target query associated to a cached prepared query <em>may</em> depend on + * query execution context such as fetch plan or lock group. This cache, by + * design, does not monitor the context or automatically invalidate an entry + * when the query is executed with context parameters that affect the target + * query. * - * The user must set a {@link QueryHints#HINT_INVALIDATE_PREPARED_QUERY hint} to - * invalidate. + * The user must notify this receiver to invalidate a cached entry when context + * changes in a way that will modify the resultant target language query. + * + * One of the built-in mechanism (available in JPA facade) is to set query hints + * to either invalidate the query entirely or ignore the cached version for the + * current execution. + * + * @see QueryHints#HINT_IGNORE_PREPARED_QUERY + * @see QueryHints#HINT_INVALIDATE_PREPARED_QUERY + * + * This cache allows customization of whether a query can be cached or not + * via either explicit marking of certain keys as non-cachable (which is + * irreversible) or addition/removal of exclusion patterns (which is reversible). + * + * @see #markUncachable(String) + * @see #addExclusionPattern(String) + * @see #setExcludes(String) + * @see #removeExclusionPattern(String) * * @author Pinaki Poddar * * @since 1.3.0 - * @nojavadoc */ -public class PreparedQueryCache implements Configurable { - private static final String PATTERN_SEPARATOR = "\\;"; +public interface PreparedQueryCache extends Configurable { - private final Map<String, PreparedQuery> _delegate; - private final Set<String> _uncachables; - private final QueryStatistics _stats; - private List<String> _excludes; - private ReentrantLock _lock = new ReentrantLock(); - - public PreparedQueryCache() { - _delegate = new HashMap<String, PreparedQuery>(); - _uncachables = new HashSet<String>(); - _stats = new QueryStatistics.Default(); - } - /** - * Get a map view of the cached SQL indexed by query identifier. + * Get a map view of the cached queries indexed by identifier. */ - public Map<String,String> getMapView() { - lock(); - try { - Map<String, String> view = new TreeMap<String, String>(); - for (Map.Entry<String, PreparedQuery> entry : _delegate.entrySet()) - view.put(entry.getKey(), entry.getValue().getSQL()); - return view; - } finally { - unlock(); - } - } - + public Map<String, String> getMapView(); + /** * Cache the given PreparedQuery. * The key is the identifier of the given PreparedQuery itself. + * The query must not be cached if either the key matches any exclusion + * pattern or the key has been marked non-cachable. + * + * @return true if the given query is cached. false if it can not be cached + * due to exclusion. + * + * @see #markUncachable(String) + * @see #setExcludes(String) + * @see #addExclusionPattern(String) */ - public boolean cache(PreparedQuery q) { - lock(); - try { - if (isExcluded(q.getIdentifier())) { - markUncachable(q.getIdentifier()); - return false; - } - _delegate.put(q.getIdentifier(), q); - return true; - } finally { - unlock(); - } - } - + public boolean cache(PreparedQuery q); + /** - * Remove the PreparedQuery with the given identifier. + * Remove the PreparedQuery with the given identifier from this cache. */ - public boolean invalidate(String id) { - lock(); - try { - return _delegate.remove(id) != null; - } finally { - unlock(); - } - } - + public boolean invalidate(String id); + /** * Get the PreparedQuery with the given identifier if it exists. null * otherwise. */ - public PreparedQuery get(String id) { - lock(); - try { - return _delegate.get(id); - } finally { - unlock(); - } - } - + public PreparedQuery get(String id); + /** * Affirms if a PreparedQuery can be cached against the given key. * * @return Boolean.FALSE if the given key is explicitly marked before as not - * be cached or matches any of the exclusion pattern. - * Boolean.TRUE if the given key has been in the cache. + * be cached or matches any of the exclusion patterns. + * Boolean.TRUE if the given key currently exists in the cache. * Otherwise, return null implying this receiver can not determine whether * this key can be cached on not. + * */ - public Boolean isCachable(String id) { - lock(); - try { - if (_uncachables.contains(id)) - return Boolean.FALSE; - if (_delegate.containsKey(id)) - return Boolean.TRUE; - return null; - } finally { - unlock(); - } - } - + public Boolean isCachable(String id); + /** * Marks the given key as not amenable to caching. - * Marking helps to avoid repeated computational cost of determining whether - * a query can be cached or not. + * Explicit marking helps to avoid repeated computational cost of + * determining whether a query can be cached or not. + * + * Explicit marking can not be reversed by removal of exclusion patterns. + * * @return The value for the given key if it had been cached before. null * otherwise. */ - public PreparedQuery markUncachable(String id) { - lock(); - try { - _uncachables.add(id); - return _delegate.remove(id); - } finally { - unlock(); - } - } + public PreparedQuery markUncachable(String id); + + /** + * Affirms if the given key matches any of the exclusion patterns. + */ + public boolean isExcluded(String id); + + /** + * Gets the exclusion patterns. + */ + public List<String> getExcludes(); - public boolean isExcluded(String id) { - lock(); - try { - if (_excludes == null || _excludes.isEmpty()) - return false; - for (String exclude : _excludes) - if (exclude.equalsIgnoreCase(id) || exclude.matches(id)) - return true; - return false; - } finally { - unlock(); - } - } + /** + * Sets one or more exclusion regular expression patterns separated by + * semicolon. Any existing cache entry whose key matches any of the given + * pattern will be marked non-cachable in a reversible manner. + */ + public void setExcludes(String excludes); + + /** + * Adds the given pattern to the list of excluded patterns. Any existing + * cache entry whose key matches the given pattern will be marked + * non-cachable in a reversible manner. + */ + public void addExclusionPattern(String pattern); - public QueryStatistics getStatistics() { - return _stats; - } + /** + * Removes the given pattern from the list of excluded patterns. + * Any excluded key that matches the given pattern can now be cached + * again, unless it has been marked non-cachable explicitly. + * + * @see #markUncachable(String) + */ + public void removeExclusionPattern(String pattern); - void lock() { - if (_lock != null) - _lock.lock(); - } - - void unlock() { - if (_lock != null && _lock.isLocked()) - _lock.unlock(); - } - - //------------------------------------------------------- - // Configurable implementation - //------------------------------------------------------- - /** - * Invoked prior to setting bean properties. - */ - public void setConfiguration(Configuration conf) { - } - - /** - * Invoked before bean property configuration is begun on this object. - */ - public void startConfiguration() { - - } - - /** - * Invoked upon completion of bean property configuration for this object. - */ - public void endConfiguration() { - - } - - /** - * Sets one or more exclusion patterns separated by semicolon. - */ - public void setExcludes(String excludes) { - lock(); - try { - if (StringUtils.isEmpty(excludes)) - return; - if (_excludes == null) - _excludes = new ArrayList<String>(); - String[] patterns = excludes.split(PATTERN_SEPARATOR); - _excludes.addAll(Arrays.asList(patterns)); - } finally { - unlock(); - } - } - - public List<String> getExcludes() { - return _excludes == null ? Collections.EMPTY_LIST : - Collections.unmodifiableList(_excludes); - } -} + /** + * Gets the simple statistics for executed queries. + */ + public QueryStatistics getStatistics(); +} \ No newline at end of file Added: openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PreparedQueryCacheImpl.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PreparedQueryCacheImpl.java?rev=694412&view=auto ============================================================================== --- openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PreparedQueryCacheImpl.java (added) +++ openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PreparedQueryCacheImpl.java Thu Sep 11 11:47:36 2008 @@ -0,0 +1,278 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.kernel; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.TreeMap; +import java.util.concurrent.locks.ReentrantLock; + +import org.apache.commons.lang.StringUtils; +import org.apache.openjpa.lib.conf.Configuration; + +/** + * An implementation of the cache of {@link PreparedQuery prepared queries}. + * + * @author Pinaki Poddar + * + * @since 1.3.0 + * @nojavadoc + */ +public class PreparedQueryCacheImpl implements PreparedQueryCache { + private static final String PATTERN_SEPARATOR = "\\;"; + private static final String EXLUDED_BY_USER = "Excluded by user"; + + // Key: Query identifier + private final Map<String, PreparedQuery> _delegate; + // Key: Query identifier Value: Reason why excluded + private final Map<String, String> _uncachables; + private List<String> _exclusionPatterns; + private final QueryStatistics _stats; + private ReentrantLock _lock = new ReentrantLock(); + + public PreparedQueryCacheImpl() { + _delegate = new HashMap<String, PreparedQuery>(); + _uncachables = new HashMap<String, String>(); + _stats = new QueryStatistics.Default(); + } + + public Map<String,String> getMapView() { + lock(); + try { + Map<String, String> view = new TreeMap<String, String>(); + for (Map.Entry<String, PreparedQuery> entry : _delegate.entrySet()) + view.put(entry.getKey(), entry.getValue().getDatastoreAction()); + return view; + } finally { + unlock(); + } + } + + /** + * Cache the given query keyed by its identifier. Does not cache if the + * identifier matches any exclusion pattern or has been marked as + * non-cachable. Also register the identifier as not cachable against + * the matched exclusion pattern. + */ + public boolean cache(PreparedQuery q) { + lock(); + try { + String id = q.getIdentifier(); + if (isCachable(id) == Boolean.FALSE) + return false; + String pattern = getMatchedExclusionPattern(id); + if (pattern != null) { + markUncachable(q.getIdentifier(), pattern); + return false; + } + _delegate.put(q.getIdentifier(), q); + return true; + } finally { + unlock(); + } + } + + public boolean invalidate(String id) { + lock(); + try { + return _delegate.remove(id) != null; + } finally { + unlock(); + } + } + + public PreparedQuery get(String id) { + lock(); + try { + return _delegate.get(id); + } finally { + unlock(); + } + } + + public Boolean isCachable(String id) { + lock(); + try { + if (_uncachables.containsKey(id)) + return Boolean.FALSE; + if (_delegate.containsKey(id)) + return Boolean.TRUE; + return null; + } finally { + unlock(); + } + } + + public PreparedQuery markUncachable(String id) { + return markUncachable(id, EXLUDED_BY_USER); + } + + private PreparedQuery markUncachable(String id, String pattern) { + lock(); + try { + if (_uncachables.get(id) != EXLUDED_BY_USER) + _uncachables.put(id, pattern); + return _delegate.remove(id); + } finally { + unlock(); + } + } + + public boolean isExcluded(String id) { + return getMatchedExclusionPattern(id) != null; + } + + public void setExcludes(String excludes) { + lock(); + try { + if (StringUtils.isEmpty(excludes)) + return; + if (_exclusionPatterns == null) + _exclusionPatterns = new ArrayList<String>(); + String[] patterns = excludes.split(PATTERN_SEPARATOR); + for (String pattern : patterns) + addExclusionPattern(pattern); + } finally { + unlock(); + } + } + + public List<String> getExcludes() { + return _exclusionPatterns == null ? Collections.EMPTY_LIST : + Collections.unmodifiableList(_exclusionPatterns); + } + + /** + * Adds a pattern for exclusion. Any query cached currently whose identifier + * matches the given pattern will be marked invalidated as a side-effect. + */ + public void addExclusionPattern(String pattern) { + lock(); + try { + if (_exclusionPatterns == null) + _exclusionPatterns = new ArrayList<String>(); + _exclusionPatterns.add(pattern); + Collection<String> invalidKeys = getMatchedKeys(pattern, + _delegate.keySet()); + for (String invalidKey : invalidKeys) + markUncachable(invalidKey, pattern); + } finally { + unlock(); + } + } + + /** + * Removes a pattern for exclusion. Any query identifier marked as not + * cachable due to the given pattern will now be removed from the list of + * uncachables as a side-effect. + */ + public void removeExclusionPattern(String pattern) { + lock(); + try { + if (_exclusionPatterns == null) + return; + _exclusionPatterns.remove(pattern); + Collection<String> rebornKeys = getMatchedKeys(pattern, _uncachables); + for (String rebornKey : rebornKeys) + _uncachables.remove(rebornKey); + } finally { + unlock(); + } + } + + public QueryStatistics getStatistics() { + return _stats; + } + + /** + * Gets the pattern that matches the given identifier. + */ + private String getMatchedExclusionPattern(String id) { + lock(); + try { + if (_exclusionPatterns == null || _exclusionPatterns.isEmpty()) + return null; + for (String pattern : _exclusionPatterns) + if (matches(pattern, id)) + return pattern; + return null; + } finally { + unlock(); + } + } + + /** + * Gets the keys of the given map whose values match the given pattern. + */ + private Collection<String> getMatchedKeys(String pattern, + Map<String,String> map) { + List<String> result = new ArrayList<String>(); + for (Map.Entry<String, String> entry : map.entrySet()) { + if (matches(pattern, entry.getValue())) { + result.add(entry.getKey()); + } + } + return result; + } + + /** + * Gets the elements of the given list which match the given pattern. + */ + private Collection<String> getMatchedKeys(String pattern, + Collection<String> coll) { + List<String> result = new ArrayList<String>(); + for (String key : coll) { + if (matches(pattern, key)) { + result.add(key); + } + } + return result; + } + + void lock() { + if (_lock != null) + _lock.lock(); + } + + void unlock() { + if (_lock != null && _lock.isLocked()) + _lock.unlock(); + } + + boolean matches(String pattern, String target) { + return target != null && (target.equals(pattern) + || target.matches(pattern)); + } + + //------------------------------------------------------- + // Configurable contract + //------------------------------------------------------- + public void setConfiguration(Configuration conf) { + } + + public void startConfiguration() { + } + + public void endConfiguration() { + } +} Copied: openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryStatistics.java (from r694135, openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryStatistics.java) URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryStatistics.java?p2=openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryStatistics.java&p1=openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryStatistics.java&r1=694135&r2=694412&rev=694412&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryStatistics.java (original) +++ openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryStatistics.java Thu Sep 11 11:47:36 2008 @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.openjpa.persistence; +package org.apache.openjpa.kernel; import java.io.Serializable; import java.util.Date; @@ -26,6 +26,11 @@ /** * Records query execution statistics. * + * Statistics can be reset. + * + * Gathers both accumulated statistics since start as well as statistics since + * last reset. + * * @since 1.3.0 * * @author Pinaki Poddar @@ -103,9 +108,9 @@ return getCount(astats, query, READ); } - private long getCount(Map<String, long[]> target, String query, int index) { + private long getCount(Map<String, long[]> target, String query, int i) { long[] row = target.get(query); - return (row == null) ? 0 : row[index]; + return (row == null) ? 0 : row[i]; } public Date since() { @@ -129,12 +134,12 @@ addSample(astats, query, index); } - private void addSample(Map<String, long[]> target, String query, int index) { + private void addSample(Map<String, long[]> target, String query, int i) { long[] row = target.get(query); if (row == null) { row = new long[1]; } - row[index]++; + row[i]++; target.put(query, row); } Modified: openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java?rev=694412&r1=694411&r2=694412&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java (original) +++ openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java Thu Sep 11 11:47:36 2008 @@ -21,18 +21,15 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; -import java.util.Map; - -import javax.persistence.EntityManager; import org.apache.openjpa.conf.OpenJPAConfiguration; +import org.apache.openjpa.kernel.PreparedQuery; +import org.apache.openjpa.kernel.PreparedQueryCache; import org.apache.openjpa.kernel.QueryHints; import org.apache.openjpa.kernel.QueryLanguages; import org.apache.openjpa.kernel.jpql.JPQLParser; import org.apache.openjpa.persistence.OpenJPAEntityManager; import org.apache.openjpa.persistence.OpenJPAQuery; -import org.apache.openjpa.persistence.PreparedQuery; -import org.apache.openjpa.persistence.PreparedQueryCache; import org.apache.openjpa.persistence.test.SingleEMFTestCase; /** @@ -90,7 +87,6 @@ } public void testExclusionPattern() { - List<String> patterns = getCache().getExcludes(); OpenJPAEntityManager em = emf.createEntityManager(); OpenJPAQuery q1 = em.createQuery(EXCLUDED_QUERY_1); q1.getResultList(); @@ -129,13 +125,13 @@ assertNotCached(jpql); assertLanguage(q1, JPQLParser.LANG_JPQL); - List result = q1.getResultList(); + q1.getResultList(); assertCached(jpql); assertLanguage(q1, JPQLParser.LANG_JPQL); PreparedQuery cached = getCache().get(jpql); assertEquals(jpql, cached.getIdentifier()); - assertNotEquals(jpql, cached.getSQL()); + assertNotEquals(jpql, cached.getDatastoreAction()); } public void testPreparedQueryIsCachedAcrossExecution() { @@ -146,7 +142,7 @@ assertLanguage(q1, JPQLParser.LANG_JPQL); - List result = q1.getResultList(); + q1.getResultList(); assertCached(jpql); assertLanguage(q1, JPQLParser.LANG_JPQL); @@ -162,7 +158,8 @@ OpenJPAEntityManager em = emf.createEntityManager(); OpenJPAQuery q1 = em.createQuery(jpql); assertNotCached(jpql); - List result = q1.getResultList(); + + q1.getResultList(); assertCached(jpql); assertLanguage(q1, JPQLParser.LANG_JPQL); @@ -192,7 +189,8 @@ OpenJPAEntityManager em = emf.createEntityManager(); OpenJPAQuery q1 = em.createQuery(jpql); assertNotCached(jpql); - List result = q1.getResultList(); + + q1.getResultList(); assertCached(jpql); assertLanguage(q1, JPQLParser.LANG_JPQL); @@ -330,7 +328,7 @@ if (cache == null) return "null"; if (cache.get(jpql) != null) - return cache.get(jpql).getSQL(); + return cache.get(jpql).getDatastoreAction(); return "null"; } Added: openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCacheExclusion.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCacheExclusion.java?rev=694412&view=auto ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCacheExclusion.java (added) +++ openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCacheExclusion.java Thu Sep 11 11:47:36 2008 @@ -0,0 +1,123 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.persistence.jdbc.sqlcache; + +import java.util.Map; + +import org.apache.openjpa.kernel.PreparedQuery; +import org.apache.openjpa.kernel.PreparedQueryCache; +import org.apache.openjpa.kernel.PreparedQueryCacheImpl; + +import junit.framework.TestCase; + +/** + * Test exclusion patterns of PreparedQueryCache in isolation. + * + * @author Pinaki Poddar + * + */ +public class TestPreparedQueryCacheExclusion extends TestCase { + private PreparedQueryCache cache; + private String[] keys = {"jpql1", "jpql2", "jpql3"}; + private String[] values = {"sql1", "sql2", "sql3"}; + + protected void setUp() throws Exception { + super.setUp(); + cache = new PreparedQueryCacheImpl(); + for (int i = 0; i < keys.length; i++) { + PreparedQuery p = new PreparedQuery(keys[i], values[i], null); + cache.cache(p); + } + } + + protected void tearDown() throws Exception { + super.tearDown(); + } + + public void testExclusionPatternsAreSet() { + String excludes = "a;b;c"; + cache.setExcludes(excludes); + assertEquals(3, cache.getExcludes().size()); + assertTrue(cache.isExcluded("a")); + assertTrue(cache.isExcluded("b")); + assertTrue(cache.isExcluded("c")); + assertFalse(cache.isExcluded("d")); + } + + public void testCachePopulationSetUp() { + assertContent(keys, values); + } + + public void testAddExclusionPatternDisallowsCacheing() { + int EXCLUDED = 1; + cache.addExclusionPattern(keys[EXCLUDED]); + + PreparedQuery p = new PreparedQuery(keys[EXCLUDED], values[EXCLUDED], null); + assertFalse("Must not cache excluded key " + keys[EXCLUDED], cache.cache(p)); + } + + public void testAddExclusionPatternMakesExistingEntryInvalid() { + int EXCLUDED = 1; + cache.addExclusionPattern(keys[EXCLUDED]); + Map<String, String> view = cache.getMapView(); + for (int i = 0; i < keys.length; i++) { + if (i == EXCLUDED) { + assertFalse(view.containsKey(keys[i])); + assertFalse(view.containsValue(values[i])); + } else { + assertTrue(view.containsKey(keys[i])); + assertTrue(view.containsValue(values[i])); + } + } + } + + public void testRemoveExclusionPatternAllowsCacheing() { + int EXCLUDED = 1; + cache.addExclusionPattern(keys[EXCLUDED]); + + PreparedQuery p = new PreparedQuery(keys[EXCLUDED], values[EXCLUDED], null); + assertFalse("Must not cache excluded key " + keys[EXCLUDED], cache.cache(p)); + + cache.removeExclusionPattern(keys[EXCLUDED]); + assertTrue("Must cache remove excluded key " + keys[EXCLUDED], cache.cache(p)); + } + + public void testRemoveExclusionPatternDoesNotRemoveUserProhbitedKeys() { + String USER_MARKED_UNCACHABLE = "[user prohibited]"; + cache.markUncachable(USER_MARKED_UNCACHABLE); + + PreparedQuery p = new PreparedQuery(USER_MARKED_UNCACHABLE, "xyz", null); + assertFalse("Must not cache user-prohibited key " + + USER_MARKED_UNCACHABLE, cache.cache(p)); + + cache.removeExclusionPattern(USER_MARKED_UNCACHABLE); + assertFalse("Must not cache user-prohibited key even when removed " + + USER_MARKED_UNCACHABLE, cache.cache(p)); + } + + void assertContent(String[] keys, String[] values) { + Map<String, String> view = cache.getMapView(); + for (int i = 0; i < keys.length; i++) { + assertTrue("key " + keys[i] + " not in " + view, + view.containsKey(keys[i])); + assertTrue("value " + values[i] + " not in " + view, + view.containsValue(values[i])); + } + } +} Modified: openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java?rev=694412&r1=694411&r2=694412&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java (original) +++ openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerFactoryImpl.java Thu Sep 11 11:47:36 2008 @@ -67,7 +67,6 @@ private transient Constructor<FetchPlan> _plan = null; private transient StoreCache _cache = null; private transient QueryResultCache _queryCache = null; - private transient Map<String, PreparedQuery> _sqlQueryCache = null; /** * Default constructor provided for auto-instantiation. Modified: openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java?rev=694412&r1=694411&r2=694412&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java (original) +++ openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java Thu Sep 11 11:47:36 2008 @@ -50,6 +50,8 @@ import org.apache.openjpa.kernel.LockLevels; import org.apache.openjpa.kernel.OpCallbacks; import org.apache.openjpa.kernel.OpenJPAStateManager; +import org.apache.openjpa.kernel.PreparedQuery; +import org.apache.openjpa.kernel.PreparedQueryCache; import org.apache.openjpa.kernel.QueryFlushModes; import org.apache.openjpa.kernel.QueryLanguages; import org.apache.openjpa.kernel.Seq; @@ -871,7 +873,7 @@ PreparedQuery cached = getPreparedQuery(qid); if (cached != null) { language = QueryLanguages.LANG_PREPARED_SQL; - query = cached.getSQL(); + query = cached.getDatastoreAction(); } org.apache.openjpa.kernel.Query q = _broker.newQuery(language, query); Modified: openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java?rev=694412&r1=694411&r2=694412&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java (original) +++ openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java Thu Sep 11 11:47:36 2008 @@ -39,6 +39,8 @@ import org.apache.openjpa.kernel.DelegatingQuery; import org.apache.openjpa.kernel.DelegatingResultList; import org.apache.openjpa.kernel.Filters; +import org.apache.openjpa.kernel.PreparedQuery; +import org.apache.openjpa.kernel.PreparedQueryCache; import org.apache.openjpa.kernel.QueryHints; import org.apache.openjpa.kernel.QueryLanguages; import org.apache.openjpa.kernel.QueryOperations; From commits-return-3366-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Fri Sep 12 16:11:08 2008 Return-Path: <commits-return-3366-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 47411 invoked from network); 12 Sep 2008 16:11:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Sep 2008 16:11:08 -0000 Received: (qmail 11076 invoked by uid 500); 12 Sep 2008 16:11:05 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 11021 invoked by uid 500); 12 Sep 2008 16:11:05 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 11012 invoked by uid 99); 12 Sep 2008 16:11:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Sep 2008 09:11:05 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Sep 2008 16:10:15 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id CB1CB2388A0F; Fri, 12 Sep 2008 09:10:17 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r694720 - in /openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa: kernel/FetchConfigurationImpl.java meta/FieldMetaData.java Date: Fri, 12 Sep 2008 16:10:17 -0000 To: commits@openjpa.apache.org From: ppoddar@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080912161017.CB1CB2388A0F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ppoddar Date: Fri Sep 12 09:10:17 2008 New Revision: 694720 URL: http://svn.apache.org/viewvc?rev=694720&view=rev Log: OPENJPA-704: Changes were not assocaited with JIRA issue which was created after the change :) Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/FieldMetaData.java Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java?rev=694720&r1=694719&r2=694720&view=diff ============================================================================== --- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java (original) +++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java Fri Sep 12 09:10:17 2008 @@ -594,7 +594,7 @@ || (fmd.isInDefaultFetchGroup() && hasFetchGroupDefault()) || hasField(fmd.getFullName(false)) - || hasField(fmd.getRealName())) + || hasField(fmd.getRealName())) // OPENJPA-704 return true; String[] fgs = fmd.getCustomFetchGroups(); for (int i = 0; i < fgs.length; i++) Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/FieldMetaData.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/FieldMetaData.java?rev=694720&r1=694719&r2=694720&view=diff ============================================================================== --- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/FieldMetaData.java (original) +++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/FieldMetaData.java Fri Sep 12 09:10:17 2008 @@ -353,6 +353,7 @@ * The field name, qualified by the defining class. */ public String getRealName() { + // Added to support OPENJPA-704 return getDefiningMetaData().getDescribedType().getName() + "." + _name; } From commits-return-3367-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Fri Sep 12 18:07:08 2008 Return-Path: <commits-return-3367-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 15276 invoked from network); 12 Sep 2008 18:07:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Sep 2008 18:07:08 -0000 Received: (qmail 32449 invoked by uid 500); 12 Sep 2008 18:07:05 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 32440 invoked by uid 500); 12 Sep 2008 18:07:05 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 32431 invoked by uid 99); 12 Sep 2008 18:07:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Sep 2008 11:07:05 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED,HS_INDEX_PARAM X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Sep 2008 18:06:06 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 853F72388A0F; Fri, 12 Sep 2008 11:06:08 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r694757 - in /openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache: Company.java TestPreparedQueryCache.java Date: Fri, 12 Sep 2008 18:06:08 -0000 To: commits@openjpa.apache.org From: ppoddar@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080912180608.853F72388A0F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ppoddar Date: Fri Sep 12 11:06:07 2008 New Revision: 694757 URL: http://svn.apache.org/viewvc?rev=694757&view=rev Log: Test prepared query cache for Named Query. They tests currently will not pass because the feature is absent now Modified: openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/Company.java openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java Modified: openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/Company.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/Company.java?rev=694757&r1=694756&r2=694757&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/Company.java (original) +++ openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/Company.java Fri Sep 12 11:06:07 2008 @@ -24,6 +24,12 @@ import javax.persistence.*; @Entity +@NamedQueries({ + @NamedQuery(name="Company.PreparedQueryWithNoParameter", query="select x from Company x"), + @NamedQuery(name="Company.PreparedQueryWithNamedParameter", query="select x from Company x where x.name=:name and x.startYear=:startYear"), + @NamedQuery(name="Company.PreparedQueryWithPositionalParameter", query="select x from Company x where x.name=?1 and x.startYear=?2"), + @NamedQuery(name="Company.PreparedQueryWithLiteral", query="select x from Company x where x.name='X' and x.startYear=1960"), +}) public class Company { @Id @GeneratedValue @@ -31,6 +37,8 @@ private String name; + private int startYear; + @OneToMany(mappedBy="company", cascade=CascadeType.ALL) private Collection<Department> departments = new HashSet<Department>(); @@ -54,7 +62,12 @@ public long getId() { return id; } - - + public int getStartYear() { + return startYear; + } + + public void setStartYear(int startYear) { + this.startYear = startYear; + } } Modified: openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java?rev=694757&r1=694756&r2=694757&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java (original) +++ openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java Fri Sep 12 11:06:07 2008 @@ -40,13 +40,18 @@ * */ public class TestPreparedQueryCache extends SingleEMFTestCase { + // # observations to compute timing statistics public static final int SAMPLE_SIZE = 100; - public static final long NANOS_TO_MILLS = 1000*1000; - public static final boolean QUERY_CACHE = true; + + public static final boolean USE_CACHE = true; + public static final boolean BIND_DIFFERENT_PARM_VALUES = true; + public static final boolean IS_NAMED_QUERY = true; + public static final String[] COMPANY_NAMES = { "acme.org" }; public static final String[] DEPARTMENT_NAMES = { "Marketing", "Sales", "Engineering" }; public static final String[] EMPLOYEE_NAMES = { "Tom", "Dick", "Harray" }; + public static final String EXCLUDED_QUERY_1 = "select count(p) from Company p"; public static final String EXCLUDED_QUERY_2 = "select count(p) from Department p"; public static final String INCLUDED_QUERY = "select count(p) from Address p"; @@ -235,47 +240,76 @@ } public void testQueryWithNoParameter() { - compare("select p from Company p"); + String jpql = "select p from Company p"; + Object[] params = null; + compare(!IS_NAMED_QUERY, jpql, BIND_DIFFERENT_PARM_VALUES, params); } public void testQueryWithLiteral() { - compare("select p from Company p where p.name = 'PObject'"); + String jpql = "select p from Company p where p.name = 'PObject'"; + Object[] params = null; + compare(!IS_NAMED_QUERY, jpql, BIND_DIFFERENT_PARM_VALUES, params); } public void testQueryWithParameter() { - compare("select p from Company p where p.name = :param", - "param", "x"); + String jpql = "select p from Company p where p.name = :param"; + Object[] params = {"param", "x"}; + compare(!IS_NAMED_QUERY, jpql, BIND_DIFFERENT_PARM_VALUES, params); } public void testQueryWithJoinsAndParameters() { - compare("select e from Employee e " + "where e.name = :emp " - + "and e.department.name = :dept " + - "and e.department.company.name = :company " + - "and e.address.zip = :zip", - - "emp", "John", - "dept", "Engineering", - "company", "acme.org", - "zip", 12345); + String jpql = "select e from Employee e " + "where e.name = :emp " + + "and e.department.name = :dept " + + "and e.department.company.name = :company " + + "and e.address.zip = :zip"; + Object[] params = { "emp", "John", + "dept", "Engineering", + "company", "acme.org", + "zip", 12345}; + compare(!IS_NAMED_QUERY, jpql, BIND_DIFFERENT_PARM_VALUES, params); + } + + public void testNamedQueryWithNoParameter() { + String namedQuery = "Company.PreparedQueryWithNoParameter"; + Object[] params = null; + compare(IS_NAMED_QUERY, namedQuery, BIND_DIFFERENT_PARM_VALUES, params); + } + + public void testNamedQueryWithLiteral() { + String namedQuery = "Company.PreparedQueryWithLiteral"; + Object[] params = null; + compare(IS_NAMED_QUERY, namedQuery, BIND_DIFFERENT_PARM_VALUES, params); + } + + public void testNamedQueryWithPositionalParameter() { + String namedQuery = "Company.PreparedQueryWithPositionalParameter"; + Object[] params = {1, "x", 2, 1960}; + compare(IS_NAMED_QUERY, namedQuery, BIND_DIFFERENT_PARM_VALUES, params); + } + + public void testNamedQueryWithNamedParameter() { + String namedQuery = "Company.PreparedQueryWithNamedParameter"; + Object[] params = {"name", "x", "startYear", 1960}; + compare(IS_NAMED_QUERY, namedQuery, BIND_DIFFERENT_PARM_VALUES, params); } - + /** * Compare the result of execution of the same query with and without * Prepared Query Cache. * */ - void compare(String jpql, Object... params) { + void compare(boolean isNamed, String jpql, boolean append, Object... params) { // if (true) return; // run the query once for warming up - run(jpql, params, !QUERY_CACHE, 1); + run(jpql, params, !USE_CACHE, 1, isNamed, append); // run N times without cache - long without = run(jpql, params, !QUERY_CACHE, SAMPLE_SIZE); - assertNotCached(jpql); + long without = run(jpql, params, !USE_CACHE, SAMPLE_SIZE, isNamed, append); + assertNotCached(isNamed ? getJPQL(jpql) : jpql); // run N times with cache - long with = run(jpql, params, QUERY_CACHE, SAMPLE_SIZE); - assertCached(jpql); + long with = run(jpql, params, USE_CACHE, SAMPLE_SIZE, isNamed, append); + assertCached(isNamed ? getJPQL(jpql) : jpql); long delta = (without == 0) ? 0 : (without - with) * 100 / without; @@ -295,21 +329,25 @@ * * returns median time taken for single execution. */ - long run(String jpql, Object[] params, boolean cache, int N) { + long run(String jpql, Object[] params, boolean useCache, int N, + boolean isNamedQuery, boolean appendIndexValuetoParameters) { OpenJPAEntityManager em = emf.createEntityManager(); - em.getConfiguration().setPreparedQueryCache(cache); + em.getConfiguration().setPreparedQueryCache(useCache); List<Long> stats = new ArrayList<Long>(); for (int i = 0; i < N; i++) { long start = System.nanoTime(); - OpenJPAQuery q = em.createQuery(jpql); + OpenJPAQuery q = isNamedQuery + ? em.createNamedQuery(jpql) : em.createQuery(jpql); for (int j = 0; params != null && j < params.length - 1; j += 2) { String key = params[j].toString(); Object val = params[j + 1]; if (val instanceof String) - q.setParameter(key, val + "-" + i); + q.setParameter(key, appendIndexValuetoParameters ? + val + "-" + i : val); else if (val instanceof Integer) - q.setParameter(key, ((Integer) val).intValue() + i); + q.setParameter(key, appendIndexValuetoParameters ? + ((Integer) val).intValue() + i : val); else q.setParameter(key, val); } @@ -331,6 +369,12 @@ return cache.get(jpql).getDatastoreAction(); return "null"; } + + String getJPQL(String namedQuery) { + return emf.getConfiguration().getMetaDataRepositoryInstance() + .getQueryMetaData(null, namedQuery, null, true) + .getQueryString(); + } @@ -346,7 +390,11 @@ System.err.println("Press return to continue..."); // System.in.read(); long start = System.nanoTime(); - _this.run(jpql, params, true, 100); + _this.run(jpql, params, + USE_CACHE, + SAMPLE_SIZE, + !IS_NAMED_QUERY, + BIND_DIFFERENT_PARM_VALUES); long end = System.nanoTime(); System.err.println("Time taken " + (end-start) + "ns"); } From commits-return-3368-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Fri Sep 12 18:41:09 2008 Return-Path: <commits-return-3368-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 41392 invoked from network); 12 Sep 2008 18:41:09 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Sep 2008 18:41:09 -0000 Received: (qmail 72988 invoked by uid 500); 12 Sep 2008 18:41:06 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 72978 invoked by uid 500); 12 Sep 2008 18:41:06 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 72969 invoked by uid 99); 12 Sep 2008 18:41:06 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Sep 2008 11:41:06 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Sep 2008 18:40:16 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 95D472388A0F; Fri, 12 Sep 2008 11:40:48 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r694773 - /openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java Date: Fri, 12 Sep 2008 18:40:48 -0000 To: commits@openjpa.apache.org From: ppoddar@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080912184048.95D472388A0F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ppoddar Date: Fri Sep 12 11:40:48 2008 New Revision: 694773 URL: http://svn.apache.org/viewvc?rev=694773&view=rev Log: Print correct JPQL and SQL for testing. Modified: openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java Modified: openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java?rev=694773&r1=694772&r2=694773&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java (original) +++ openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java Fri Sep 12 11:40:48 2008 @@ -299,25 +299,25 @@ * */ void compare(boolean isNamed, String jpql, boolean append, Object... params) { -// if (true) return; + String realJPQL = isNamed ? getJPQL(jpql) : jpql; // run the query once for warming up run(jpql, params, !USE_CACHE, 1, isNamed, append); // run N times without cache long without = run(jpql, params, !USE_CACHE, SAMPLE_SIZE, isNamed, append); - assertNotCached(isNamed ? getJPQL(jpql) : jpql); + assertNotCached(realJPQL); // run N times with cache long with = run(jpql, params, USE_CACHE, SAMPLE_SIZE, isNamed, append); - assertCached(isNamed ? getJPQL(jpql) : jpql); + assertCached(realJPQL); long delta = (without == 0) ? 0 : (without - with) * 100 / without; - String sql = getSQL(jpql); + String sql = getSQL(realJPQL); System.err.println("Execution time in nanos for " + SAMPLE_SIZE + " query execution with and without SQL cache:" + with + " " + without + " (" + delta + "%)"); - System.err.println("JPQL: " + jpql); + System.err.println("JPQL: " + realJPQL); System.err.println("SQL : " + sql); assertFalse("change in execution time = " + delta + "%", delta < 0); } @@ -361,13 +361,17 @@ return stats.get(N/2); } - String getSQL(String jpql) { + /** + * Get the SQL corresponding to the given query key. + * @param jpql + * @return + */ + String getSQL(String queryKey) { PreparedQueryCache cache = emf.getConfiguration().getPreparedQueryCacheInstance(); if (cache == null) return "null"; - if (cache.get(jpql) != null) - return cache.get(jpql).getDatastoreAction(); - return "null"; + PreparedQuery query = cache.get(queryKey); + return (query != null) ? query.getDatastoreAction() : "null"; } String getJPQL(String namedQuery) { From commits-return-3369-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Fri Sep 12 20:02:06 2008 Return-Path: <commits-return-3369-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 97343 invoked from network); 12 Sep 2008 20:02:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 12 Sep 2008 20:02:06 -0000 Received: (qmail 63604 invoked by uid 500); 12 Sep 2008 20:02:03 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 63548 invoked by uid 500); 12 Sep 2008 20:02:03 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 63539 invoked by uid 99); 12 Sep 2008 20:02:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Sep 2008 13:02:02 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Sep 2008 20:01:13 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 2E18F238896D; Fri, 12 Sep 2008 13:01:15 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r694790 - in /openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence: EntityManagerImpl.java QueryImpl.java Date: Fri, 12 Sep 2008 20:01:14 -0000 To: commits@openjpa.apache.org From: ppoddar@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080912200115.2E18F238896D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ppoddar Date: Fri Sep 12 13:01:14 2008 New Revision: 694790 URL: http://svn.apache.org/viewvc?rev=694790&view=rev Log: Support createNamedQuery() for prepared query cacheing Modified: openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java Modified: openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java?rev=694790&r1=694789&r2=694790&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java (original) +++ openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/EntityManagerImpl.java Fri Sep 12 13:01:14 2008 @@ -905,12 +905,25 @@ QueryMetaData meta = _broker.getConfiguration(). getMetaDataRepositoryInstance().getQueryMetaData(null, name, _broker.getClassLoader(), true); - org.apache.openjpa.kernel.Query del = - _broker.newQuery(meta.getLanguage(), null); - meta.setInto(del); - del.compile(); - - OpenJPAQuery q = new QueryImpl(this, _ret, del); + String query = null; + String language = meta.getLanguage(); + String qid = meta.getQueryString(); + + PreparedQuery cached = getPreparedQuery(qid); + if (cached != null) { + language = QueryLanguages.LANG_PREPARED_SQL; + query = cached.getDatastoreAction(); + } + org.apache.openjpa.kernel.Query del = _broker.newQuery(language, + query); + if (cached != null) { + cached.setInto(del); + } else { + meta.setInto(del); + } + del.compile(); + + OpenJPAQuery q = new QueryImpl(this, _ret, del).setId(qid); String[] hints = meta.getHintKeys(); Object[] values = meta.getHintValues(); for (int i = 0; i < hints.length; i++) Modified: openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java?rev=694790&r1=694789&r2=694790&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java (original) +++ openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java Fri Sep 12 13:01:14 2008 @@ -71,8 +71,7 @@ private DelegatingQuery _query; private transient EntityManagerImpl _em; private transient FetchPlan _fetch; - private ParameterMap _params; - private transient Boolean _cacheable = null; + private transient ParameterMap _params; private String _id; @@ -631,8 +630,12 @@ if (cached == null) return; Broker broker = _em.getBroker(); + // Critical assumption: Only JPQL queries are cached and more + // importantly, the identifier of the prepared query is the original + // JPQL String String JPQL = JPQLParser.LANG_JPQL; String jpql = _id; + org.apache.openjpa.kernel.Query newQuery = broker.newQuery(JPQL, jpql); newQuery.getFetchConfiguration().copy(_query.getFetchConfiguration()); newQuery.compile(); From commits-return-3370-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Sat Sep 13 18:54:15 2008 Return-Path: <commits-return-3370-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 1412 invoked from network); 13 Sep 2008 18:54:15 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Sep 2008 18:54:15 -0000 Received: (qmail 96444 invoked by uid 500); 13 Sep 2008 18:54:12 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 96432 invoked by uid 500); 13 Sep 2008 18:54:11 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 96417 invoked by uid 99); 13 Sep 2008 18:54:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 13 Sep 2008 11:54:11 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 13 Sep 2008 18:53:21 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 0C75D238896D; Sat, 13 Sep 2008 11:53:54 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r695004 - in /openjpa/branches/sql-cache: openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/ openjpa-persistence/src/main/java/org/apache/openjpa/pers... Date: Sat, 13 Sep 2008 18:53:53 -0000 To: commits@openjpa.apache.org From: ppoddar@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080913185354.0C75D238896D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ppoddar Date: Sat Sep 13 11:53:53 2008 New Revision: 695004 URL: http://svn.apache.org/viewvc?rev=695004&view=rev Log: Capture hit count in QueryStatistics and add some print facility Modified: openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryStatistics.java openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java Modified: openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryStatistics.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryStatistics.java?rev=695004&r1=695003&r2=695004&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryStatistics.java (original) +++ openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/QueryStatistics.java Sat Sep 13 11:53:53 2008 @@ -18,6 +18,7 @@ */ package org.apache.openjpa.kernel; +import java.io.PrintStream; import java.io.Serializable; import java.util.Date; import java.util.HashMap; @@ -39,9 +40,10 @@ public interface QueryStatistics extends Serializable { /** - * Record that the given query has been executed. + * Record that the given query has been executed. The boolean parameter + * designates whether the executed query is a cached version. */ - void recordExecution(String query); + void recordExecution(String query, boolean cached); /** * Gets number of total query execution since last reset. @@ -64,6 +66,28 @@ public long getTotalExecutionCount(String query); /** + * Gets number of total query execution that are cached since last reset. + */ + public long getHitCount(); + + /** + * Gets number of total query execution that are cached since start. + */ + public long getTotalHitCount(); + + /** + * Gets number of executions for the given query that are cached since + * last reset. + */ + public long getHitCount(String query); + + /** + * Gets number of executions for the given query that are cached since + * start. + */ + public long getTotalHitCount(String query); + + /** * Gets the time of last reset. */ public Date since(); @@ -79,18 +103,25 @@ public void reset(); /** + * Dumps on the given output stream. + */ + public void dump(PrintStream out); + + /** * A default implementation. * */ public static class Default implements QueryStatistics { - private long[] astat = new long[1]; - private long[] stat = new long[1]; + private static final int ARRAY_SIZE = 2; + private long[] astat = new long[ARRAY_SIZE]; + private long[] stat = new long[ARRAY_SIZE]; private Map<String, long[]> stats = new HashMap<String, long[]>(); private Map<String, long[]> astats = new HashMap<String, long[]>(); private Date start = new Date(); - private Date since = new Date(); + private Date since = start; private static final int READ = 0; + private static final int HIT = 1; public long getExecutionCount() { return stat[READ]; @@ -108,6 +139,22 @@ return getCount(astats, query, READ); } + public long getHitCount() { + return stat[HIT]; + } + + public long getTotalHitCount() { + return astat[HIT]; + } + + public long getHitCount(String query) { + return getCount(stats, query, HIT); + } + + public long getTotalHitCount(String query) { + return getCount(astats, query, HIT); + } + private long getCount(Map<String, long[]> target, String query, int i) { long[] row = target.get(query); return (row == null) ? 0 : row[i]; @@ -122,7 +169,7 @@ } public void reset() { - stat = new long[1]; + stat = new long[ARRAY_SIZE]; stats.clear(); since = new Date(); } @@ -137,14 +184,54 @@ private void addSample(Map<String, long[]> target, String query, int i) { long[] row = target.get(query); if (row == null) { - row = new long[1]; + row = new long[ARRAY_SIZE]; } row[i]++; target.put(query, row); } - public void recordExecution(String query) { + public void recordExecution(String query, boolean cached) { addSample(query, READ); + if (cached) + addSample(query, HIT); + } + + public void dump(PrintStream out) { + String header = "Query Statistics starting from " + start; + out.print(header); + if (since == start) { + out.println(); + out.println("Total Query Execution: " + toString(astat)); + out.println("\tTotal \t\tQuery"); + } else { + out.println(" last reset on " + since); + out.println("Total Query Execution since start " + + toString(astat) + " since reset " + toString(stat)); + out.println("\tSince Start \tSince Reset \t\tQuery"); + } + int i = 0; + for (String key : stats.keySet()) { + i++; + long[] arow = astats.get(key); + if (since == start) { + out.println(i + ". \t" + toString(arow) + " \t" + key); + } else { + long[] row = stats.get(key); + out.println(i + ". \t" + toString(arow) + " \t" + + toString(row) + " \t\t" + key); + } + } + } + + long pct(long per, long cent) { + if (cent <= 0) + return 0; + return (100*per)/cent; + } + + String toString(long[] row) { + return row[READ] + ":" + row[HIT] + "(" + pct(row[HIT], row[READ]) + + "%)"; } } } Modified: openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java?rev=695004&r1=695003&r2=695004&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java (original) +++ openjpa/branches/sql-cache/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/jdbc/sqlcache/TestPreparedQueryCache.java Sat Sep 13 11:53:53 2008 @@ -27,6 +27,7 @@ import org.apache.openjpa.kernel.PreparedQueryCache; import org.apache.openjpa.kernel.QueryHints; import org.apache.openjpa.kernel.QueryLanguages; +import org.apache.openjpa.kernel.QueryStatistics; import org.apache.openjpa.kernel.jpql.JPQLParser; import org.apache.openjpa.persistence.OpenJPAEntityManager; import org.apache.openjpa.persistence.OpenJPAQuery; @@ -40,6 +41,10 @@ * */ public class TestPreparedQueryCache extends SingleEMFTestCase { + // Fail if performance degrades with cache compared to without cache + public static final boolean FAIL_ON_PERF_DEGRADE = + Boolean.getBoolean("FailOnPerformanceRegression"); + // # observations to compute timing statistics public static final int SAMPLE_SIZE = 100; @@ -222,21 +227,76 @@ } public void testQueryStatistics() { - String jpql1 = "select p from Company p"; - String jpql2 = "select p from Company p where p.name = 'PObject'"; + String jpql1 = "select c from Company c"; + String jpql2 = "select c from Company c where c.name = 'PObject'"; OpenJPAEntityManager em = emf.createEntityManager(); OpenJPAQuery q1 = em.createQuery(jpql1); OpenJPAQuery q2 = em.createQuery(jpql2); int N1 = 5; int N2 = 8; for (int i = 0; i < N1; i++) - em.createQuery(q1).getResultList(); + q1.getResultList(); for (int i = 0; i < N2; i++) - em.createQuery(q2).getResultList(); + q2.getResultList(); + + QueryStatistics stats = getCache().getStatistics(); + stats.dump(System.out); + + assertEquals(N1, stats.getExecutionCount(jpql1)); + assertEquals(N2, stats.getExecutionCount(jpql2)); + assertEquals(N1+N2, stats.getExecutionCount()); + assertEquals(N1-1, stats.getHitCount(jpql1)); + assertEquals(N2-1, stats.getHitCount(jpql2)); + assertEquals(N1+N2-2, stats.getHitCount()); + + } + + public void testResetQueryStatistics() { + String jpql1 = "select c from Company c"; + String jpql2 = "select c from Company c where c.name = 'PObject'"; + OpenJPAEntityManager em = emf.createEntityManager(); + OpenJPAQuery q1 = em.createQuery(jpql1); + OpenJPAQuery q2 = em.createQuery(jpql2); + int N10 = 4; + int N20 = 7; + for (int i = 0; i < N10; i++) + q1.getResultList(); + for (int i = 0; i < N20; i++) + q2.getResultList(); + + QueryStatistics stats = getCache().getStatistics(); + assertEquals(N10, stats.getExecutionCount(jpql1)); + assertEquals(N20, stats.getExecutionCount(jpql2)); + assertEquals(N10+N20, stats.getExecutionCount()); + assertEquals(N10-1, stats.getHitCount(jpql1)); + assertEquals(N20-1, stats.getHitCount(jpql2)); + assertEquals(N10+N20-2, stats.getHitCount()); + + stats.reset(); + + int N11 = 7; + int N21 = 4; + for (int i = 0; i < N11; i++) + q1.getResultList(); + for (int i = 0; i < N21; i++) + q2.getResultList(); + + stats.dump(System.out); + + assertEquals(N11, stats.getExecutionCount(jpql1)); + assertEquals(N21, stats.getExecutionCount(jpql2)); + assertEquals(N11+N21, stats.getExecutionCount()); + assertEquals(N11, stats.getHitCount(jpql1)); + assertEquals(N21, stats.getHitCount(jpql2)); + assertEquals(N11+N21, stats.getHitCount()); + + assertEquals(N10+N11, stats.getTotalExecutionCount(jpql1)); + assertEquals(N20+N21, stats.getTotalExecutionCount(jpql2)); + assertEquals(N10+N11+N20+N21, stats.getTotalExecutionCount()); + assertEquals(N10+N11-1, stats.getTotalHitCount(jpql1)); + assertEquals(N20+N21-1, stats.getTotalHitCount(jpql2)); + assertEquals(N10+N11+N20+N21-2, stats.getTotalHitCount()); - assertEquals(N1, getCache().getStatistics().getExecutionCount(jpql1)); - assertEquals(N2, getCache().getStatistics().getExecutionCount(jpql2)); - assertEquals(N1+N2, getCache().getStatistics().getExecutionCount()); } public void testQueryWithNoParameter() { @@ -319,7 +379,14 @@ + without + " (" + delta + "%)"); System.err.println("JPQL: " + realJPQL); System.err.println("SQL : " + sql); - assertFalse("change in execution time = " + delta + "%", delta < 0); + if (delta < 0) { + if (FAIL_ON_PERF_DEGRADE) + assertFalse("change in execution time = " + delta + "%", + delta < 0); + else + System.err.println("*** WARN: Perforamce regression with cache." + + " Execution time degrades by " + delta + "%"); + } } /** Modified: openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java?rev=695004&r1=695003&r2=695004&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java (original) +++ openjpa/branches/sql-cache/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java Sat Sep 13 11:53:53 2008 @@ -250,7 +250,7 @@ boolean usingCachedQuery = (cachedQuery != null); validate(_query.getParameterTypes(), !usingCachedQuery); recordStatistics(usingCachedQuery ? cachedQuery.getIdentifier() - : _query.getQueryString()); + : _query.getQueryString(), usingCachedQuery); Object result = _query.execute(getParameterMap(usingCachedQuery)); return result; } @@ -588,20 +588,18 @@ if (cache.isCachable(_id) == Boolean.FALSE) return null; PreparedQuery cached = cache.get(_id); - if (cached == null) { - String[] sqls = _query.getDataStoreActions(getParameterMap(true)); - boolean cacheable = (sqls.length == 1); - if (!cacheable) { - cache.markUncachable(_id); - return null; - } - cached = new PreparedQuery(_id, sqls[0], _query); - // Attempt to cache may fail if query matches exclusion pattern - if (!cache.cache(cached)) { - cached = null; - } + if (cached != null) + return cached; + + String[] sqls = _query.getDataStoreActions(getParameterMap(true)); + boolean cacheable = (sqls.length == 1); + if (!cacheable) { + cache.markUncachable(_id); + return null; } - return cached; + PreparedQuery newEntry = new PreparedQuery(_id, sqls[0], _query); + cache.cache(newEntry); + return null; // because we cached it as a result of this call } boolean isHinted(String hint) { @@ -643,12 +641,12 @@ broker.getInstanceExceptionTranslator()); } - private void recordStatistics(String query) { + private void recordStatistics(String query, boolean usingCachedVersion) { PreparedQueryCache cache = _em.getConfiguration() .getPreparedQueryCacheInstance(); if (cache == null) return; - cache.getStatistics().recordExecution(query); + cache.getStatistics().recordExecution(query,usingCachedVersion); } public int hashCode() { From commits-return-3371-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Sat Sep 13 20:09:44 2008 Return-Path: <commits-return-3371-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 38602 invoked from network); 13 Sep 2008 20:09:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Sep 2008 20:09:43 -0000 Received: (qmail 20455 invoked by uid 500); 13 Sep 2008 20:09:40 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 20441 invoked by uid 500); 13 Sep 2008 20:09:40 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 20430 invoked by uid 99); 13 Sep 2008 20:09:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 13 Sep 2008 13:09:40 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 13 Sep 2008 20:08:51 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 384A723889F7; Sat, 13 Sep 2008 13:08:53 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r695021 - in /openjpa/branches/sql-cache/openjpa-kernel/src/main: java/org/apache/openjpa/kernel/PreparedQueryCacheImpl.java resources/org/apache/openjpa/kernel/localizer.properties Date: Sat, 13 Sep 2008 20:08:53 -0000 To: commits@openjpa.apache.org From: ppoddar@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080913200853.384A723889F7@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ppoddar Date: Sat Sep 13 13:08:52 2008 New Revision: 695021 URL: http://svn.apache.org/viewvc?rev=695021&view=rev Log: Add logging to PreparedQueryCache Modified: openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PreparedQueryCacheImpl.java openjpa/branches/sql-cache/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties Modified: openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PreparedQueryCacheImpl.java URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PreparedQueryCacheImpl.java?rev=695021&r1=695020&r2=695021&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PreparedQueryCacheImpl.java (original) +++ openjpa/branches/sql-cache/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/PreparedQueryCacheImpl.java Sat Sep 13 13:08:52 2008 @@ -28,7 +28,11 @@ import java.util.concurrent.locks.ReentrantLock; import org.apache.commons.lang.StringUtils; +import org.apache.openjpa.conf.OpenJPAConfiguration; import org.apache.openjpa.lib.conf.Configuration; +import org.apache.openjpa.lib.log.Log; +import org.apache.openjpa.lib.log.LogFactory; +import org.apache.openjpa.lib.util.Localizer; /** * An implementation of the cache of {@link PreparedQuery prepared queries}. @@ -41,7 +45,7 @@ public class PreparedQueryCacheImpl implements PreparedQueryCache { private static final String PATTERN_SEPARATOR = "\\;"; private static final String EXLUDED_BY_USER = "Excluded by user"; - + // Key: Query identifier private final Map<String, PreparedQuery> _delegate; // Key: Query identifier Value: Reason why excluded @@ -49,6 +53,8 @@ private List<String> _exclusionPatterns; private final QueryStatistics _stats; private ReentrantLock _lock = new ReentrantLock(); + private Log _log; + private Localizer _loc = Localizer.forPackage(PreparedQueryCacheImpl.class); public PreparedQueryCacheImpl() { _delegate = new HashMap<String, PreparedQuery>(); @@ -78,13 +84,19 @@ lock(); try { String id = q.getIdentifier(); - if (isCachable(id) == Boolean.FALSE) + if (isCachable(id) == Boolean.FALSE) { + if (_log.isWarnEnabled()) + _log.warn(_loc.get("prepared-query-not-cachable", id)); return false; + } String pattern = getMatchedExclusionPattern(id); if (pattern != null) { markUncachable(q.getIdentifier(), pattern); return false; } + if (_log.isTraceEnabled()) + _log.trace(_loc.get("prepared-query-cache", q.getIdentifier(), + q.getDatastoreAction())); _delegate.put(q.getIdentifier(), q); return true; } finally { @@ -95,6 +107,8 @@ public boolean invalidate(String id) { lock(); try { + if (_log.isTraceEnabled()) + _log.trace(_loc.get("prepared-query-invalidate", id)); return _delegate.remove(id) != null; } finally { unlock(); @@ -127,11 +141,19 @@ return markUncachable(id, EXLUDED_BY_USER); } - private PreparedQuery markUncachable(String id, String pattern) { + private PreparedQuery markUncachable(String id, String reason) { lock(); try { - if (_uncachables.get(id) != EXLUDED_BY_USER) - _uncachables.put(id, pattern); + boolean excludedByUser = _uncachables.get(id) == EXLUDED_BY_USER; + if (!excludedByUser) + _uncachables.put(id, reason); + if (_log.isInfoEnabled()) { + if (excludedByUser) + _log.info(_loc.get("prepared-query-uncache-strong", id)); + else + _log.info(_loc.get("prepared-query-uncache-weak", id, + reason)); + } return _delegate.remove(id); } finally { unlock(); @@ -174,6 +196,9 @@ _exclusionPatterns.add(pattern); Collection<String> invalidKeys = getMatchedKeys(pattern, _delegate.keySet()); + if (!invalidKeys.isEmpty() && _log.isInfoEnabled()) + _log.info(_loc.get("prepared-query-add-pattern", pattern, + invalidKeys.size(), invalidKeys)); for (String invalidKey : invalidKeys) markUncachable(invalidKey, pattern); } finally { @@ -192,8 +217,11 @@ if (_exclusionPatterns == null) return; _exclusionPatterns.remove(pattern); - Collection<String> rebornKeys = getMatchedKeys(pattern, _uncachables); - for (String rebornKey : rebornKeys) + Collection<String> reborns = getMatchedKeys(pattern, _uncachables); + if (!reborns.isEmpty() && _log.isInfoEnabled()) + _log.info(_loc.get("prepared-query-remove-pattern", pattern, + reborns.size(), reborns)); + for (String rebornKey : reborns) _uncachables.remove(rebornKey); } finally { unlock(); @@ -268,6 +296,7 @@ // Configurable contract //------------------------------------------------------- public void setConfiguration(Configuration conf) { + _log = conf.getLog(OpenJPAConfiguration.LOG_RUNTIME); } public void startConfiguration() { Modified: openjpa/branches/sql-cache/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties URL: http://svn.apache.org/viewvc/openjpa/branches/sql-cache/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties?rev=695021&r1=695020&r2=695021&view=diff ============================================================================== --- openjpa/branches/sql-cache/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties (original) +++ openjpa/branches/sql-cache/openjpa-kernel/src/main/resources/org/apache/openjpa/kernel/localizer.properties Sat Sep 13 13:08:52 2008 @@ -404,4 +404,17 @@ bound parameters with following values "{3}". This can happen if you have \ declared but missed to bind values for one or more parameters. query-execution-error: Failed to execute query "{0}". Check the query syntax \ - for correctness. See nested exception for details. \ No newline at end of file + for correctness. See nested exception for details. +prepared-query-cache: Adding query "{0}" to prepared query cache. The target \ + database query is "{1}". +prepared-query-not-cachable: Query "{0}" can not be cached. +prepared-query-invalidate: Prepared Query "{0}" is invalidated +prepared-query-uncache-strong: Query "{0}" is marked permanently not to be \ + cached. +prepared-query-uncache-weak: Query "{0}" is marked not to be cached because it \ + matched exclusion pattern "{1}". This query can be cached if the exclusion \ + pattern is removed later. +prepared-query-add-pattern: Added exclusion pattern "{0}" which has removed \ + following {1} prepared queries from the cache: "{2}" +prepared-query-remove-pattern: Removed exclusion pattern "{0}" which has made \ + following {1} queries again possible to be cached: "{2}" \ No newline at end of file From commits-return-3372-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Mon Sep 15 22:28:48 2008 Return-Path: <commits-return-3372-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 91772 invoked from network); 15 Sep 2008 22:28:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Sep 2008 22:28:48 -0000 Received: (qmail 93220 invoked by uid 500); 15 Sep 2008 22:28:45 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 93209 invoked by uid 500); 15 Sep 2008 22:28:44 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 93199 invoked by uid 99); 15 Sep 2008 22:28:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Sep 2008 15:28:44 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Sep 2008 22:27:47 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id C0095238896B; Mon, 15 Sep 2008 15:27:49 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r695674 - /openjpa/trunk/openjpa-project/pom.xml Date: Mon, 15 Sep 2008 22:27:49 -0000 To: commits@openjpa.apache.org From: mikedd@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080915222749.C0095238896B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mikedd Date: Mon Sep 15 15:27:47 2008 New Revision: 695674 URL: http://svn.apache.org/viewvc?rev=695674&view=rev Log: OPENJPA-711 adding jai dependencies for building the manual Modified: openjpa/trunk/openjpa-project/pom.xml Modified: openjpa/trunk/openjpa-project/pom.xml URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/pom.xml?rev=695674&r1=695673&r2=695674&view=diff ============================================================================== --- openjpa/trunk/openjpa-project/pom.xml (original) +++ openjpa/trunk/openjpa-project/pom.xml Mon Sep 15 15:27:47 2008 @@ -80,6 +80,24 @@ <docbook.version>1.67.2</docbook.version> <local.repository>${settings.localRepository}</local.repository> + <!-- + Java imaging apis are needed to include images in a PDF. + JIMI or JAI may be used. Neither is available in a maven + repository and should be downloaded and installed manually + to your local repository. + + ie : + $ mvn install:install-file -Dfile=jai_core.jar \ + -DgroupId=javax.media -DartifactId=jai-core \ + -Dversion=1.1.3 -Dpackaging=jar + + Alternatively if you have installed the JAI artifacts to an + internal repository you can specify it with the + -Djai.maven.repos=REPOS_URL command line argument. + --> + <jai.maven.repo>http://not.a.real.repository</jai.maven.repo> + <jai.version>1.1.3</jai.version> + <!-- authentication for nightly uploads --> <nightly.user.name>${user.name}</nightly.user.name> <nightly.password>passw0rd</nightly.password> @@ -289,6 +307,18 @@ <version>4.4</version> <scope>runtime</scope> </dependency> + <dependency> + <groupId>javax.media</groupId> + <artifactId>jai_core</artifactId> + <version>${jai.version}</version> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>javax.media</groupId> + <artifactId>jai_codec</artifactId> + <version>${jai.version}</version> + <scope>runtime</scope> + </dependency> </dependencies> </plugin> </plugins> @@ -306,6 +336,13 @@ <url>http://agilejava.com/maven</url> </pluginRepository> </pluginRepositories> + <repositories> + <repository> + <id>jai.repository</id> + <name>JAI Repository (indirectly used by Docbook plugin)</name> + <url>${jai.maven.repo}</url> + </repository> + </repositories> </profile> <!-- Upload distribution files, javadoc and manual to openjpa.apache.org/builds/latest. From commits-return-3373-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Mon Sep 15 22:45:31 2008 Return-Path: <commits-return-3373-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 6259 invoked from network); 15 Sep 2008 22:45:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Sep 2008 22:45:31 -0000 Received: (qmail 9898 invoked by uid 500); 15 Sep 2008 22:45:28 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 9881 invoked by uid 500); 15 Sep 2008 22:45:28 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 9872 invoked by uid 99); 15 Sep 2008 22:45:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Sep 2008 15:45:28 -0700 X-ASF-Spam-Status: No, hits=-1996.3 required=10.0 tests=ALL_TRUSTED,HTML_MESSAGE,MIME_HTML_ONLY X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Sep 2008 22:44:28 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 10821234C1C5 for <commits@openjpa.apache.org>; Mon, 15 Sep 2008 15:45:00 -0700 (PDT) Message-ID: <1669558167.1221518700032.JavaMail.www-data@brutus> Date: Mon, 15 Sep 2008 15:45:00 -0700 (PDT) From: confluence@apache.org To: commits@openjpa.apache.org Subject: [CONF] OpenJPA: Building OpenJPA (page edited) MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org <html> <head> <base href="http://cwiki.apache.org/confluence" /> <style type="text/css"> <!-- body, p, td, table, tr, .bodytext, .stepfield { font-family: Verdana, arial, sans-serif; font-size: 11px; line-height: 16px; color: #000000; font-weight: normal; } #PageContent { text-align: left; background-color: #fff; padding: 0px; margin: 0px; padding-bottom:20px; } /* ** when this stylesheet is used for the Tiny MCE Wysiwyg editor's edit area, we can't ** use an id=PageContent or class=wiki-content, so we must ** set the body style to that used for PageContent, and p to that used for wiki-content. */ body { margin: 0px; padding: 0px; text-align: center; background-color: #f0f0f0; } @media print { body { background-color: #fff; } } .monospaceInput { font:12px monospace } .wiki-content p, .commentblock p { margin: 16px 0px 16px 0px; padding: 0px; } .wiki-content-preview { padding: 5px; border-left: 1px solid #3c78b5; border-right: 1px solid #3c78b5; } ul, ol { margin-top: 2px; margin-bottom: 2px; padding-top: 0px; padding-bottom: 0px; } pre { padding: 0px; margin-top: 5px; margin-left: 15px; margin-bottom: 5px; margin-right: 5px; text-align: left; } .helpheading { font-weight: bold; background-color: #D0D9BD; border-bottom: 1px solid #3c78b5; padding: 4px 4px 4px 4px; margin: 0px; margin-top: 10px; } .helpcontent { padding: 4px 4px 20px 4px; background-color: #f5f7f1; } .code { border: 1px dashed #3c78b5; font-size: 11px; font-family: Courier; margin: 10px; line-height: 13px; } .focusedComment { background: #ffffce; } .commentBox, .focusedComment { padding: 10px; margin: 5px 0 5px 0; border: 1px #bbb solid; } .codeHeader { background-color: #f0f0f0; border-bottom: 1px dashed #3c78b5; padding: 3px; text-align: center; } .codeContent { text-align: left; background-color: #f0f0f0; padding: 3px; } .preformatted { border: 1px dashed #3c78b5; font-size: 11px; font-family: Courier; margin: 10px; line-height: 13px; } .preformattedHeader { background-color: #f0f0f0; border-bottom: 1px dashed #3c78b5; padding: 3px; text-align: center; } .preformattedContent { background-color: #f0f0f0; padding: 3px; } .panel { border: 1px dashed #3c78b5; margin: 10px; margin-top: 0px; } .panelHeader { background-color: #f0f0f0; border-bottom: 1px dashed #3c78b5; padding: 3px; text-align: center; } .panelContent { background-color: #f0f0f0; padding: 5px; } .anonymousAlert { background-color: #f0f0f0; border: 1px dashed red; font-size: 11px; padding: 10px 5px 10px 5px; margin: 4px; line-height: 13px; } .lockAlert { background-color: #f0f0f0; width: 50%; border: 1px dashed red; font-size: 11px; padding: 10px 5px 10px 5px; margin: 4px; line-height: 13px; } .code-keyword { color: #000091; background-color: inherit; } .code-object { color: #910091; background-color: inherit; } .code-quote { color: #009100; background-color: inherit; } .code-comment { color: #808080; background-color: inherit; } .code-xml .code-keyword { color: inherit; font-weight: bold; } .code-tag { color: #000091; background-color: inherit; } .breadcrumbs { background-color: #f0f0f0; border-color: #3c78b5; border-width: 1px 0px 1px 0px; border-style: solid; font-size: 11px; padding: 3px 0px 3px 0px; } .navmenu { border: 1px solid #ccc; } .menuheading { font-weight: bold; background-color: #f0f0f0; border-bottom: 1px solid #3c78b5; padding: 4px 4px 2px 4px; } .menuitems { padding: 4px 4px 20px 4px; } .rightpanel { border-left: 1px solid #ccc; border-bottom: 1px solid #ccc; } #helpheading { text-align: left; font-weight: bold; background-color: #D0D9BD; border-bottom: 1px solid #3c78b5; padding: 4px 4px 4px 4px; margin: 0px; } #helpcontent { padding: 4px 4px 4px 4px; background-color: #f5f7f1; } .helptab-unselected { font-weight: bold; padding: 5px; background-color: #f5f7f1; } .helptab-selected { font-weight: bold; background-color: #D0D9BD; padding: 5px; } .helptabs { margin: 0px; background-color: #f5f7f1; padding: 5px; } .infopanel-heading { font-weight: bold; padding: 4px 0px 2px 0px; } .pagebody { } .pageheader { padding: 5px 5px 5px 0px; border-bottom: 1px solid #3c78b5; } .pagetitle { font-size: 22px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; } .newpagetitle { color: #ccc !important; } .steptitle { font-size: 18px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; margin-bottom: 7px; } .substeptitle { font-size: 12px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; margin: 2px 4px 4px 4px; padding: 2px 4px 1px 4px; } .stepdesc { font-family: Verdana, arial, sans-serif; font-size: 11px; line-height: 16px; font-weight: normal; color: #666666; margin-top: 7px; margin-bottom: 7px; } .steplabel { font-weight: bold; margin-right: 4px; color: black; float: left; width: 15%; text-align: right; } .stepfield { background: #f0f0f0; padding: 5px; } .submitButtons{ margin-top:5px; text-align:right; } .formtitle { font-size: 12px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; } .sectionbottom { border-bottom: 1px solid #3c78b5; } .topRow { border-top: 2px solid #3c78b5; } .tabletitle { font-size: 14px; font-weight: bold; font-family: Arial, sans-serif; padding: 3px 0px 2px 0px; margin: 8px 4px 2px 0px; color: #003366; border-bottom: 2px solid #3c78b5; } .pagesubheading { color: #666666; font-size: 10px; padding: 0px 0px 5px 0px; } HR { color: 3c78b5; height: 1; } A:link, A:visited, A:active, A:hover { color: #003366; } h1 A:link, h1 A:visited, h1 A:active { text-decoration: none; } h1 A:hover { border-bottom: 1px dotted #003366; } .wiki-content > :first-child, .commentblock > :first-child { margin-top: 3px; } .logocell { padding: 10px; } input { font-family: verdana, geneva, arial, sans-serif; font-size: 11px; color: #000000; } textarea, textarea.editor { font-family: verdana, geneva, arial, sans-serif; font-size: 11px; color: #333333; } /* use logoSpaceLink instead. .spacenametitle { font: 21px/31px Impact, Arial, Helvetica; font-weight: 100; color: #999999; margin: 0px; } .spacenametitle img { margin: 0 0 -4px 0; } .spacenametitle a { text-decoration: none; color: #999999; } .spacenametitle a:visited { text-decoration: none; color: #999999; }*/ .spacenametitle-printable { font: 20px/25px Impact, Arial, Helvetica; font-weight: 100; color: #999999; margin: 0px; } .spacenametitle-printable a { text-decoration: none; color: #999999; } .spacenametitle-printable a:visited { text-decoration: none; color: #999999; } .blogDate { font-weight: bold; text-decoration: none; color: black; } .blogSurtitle { background: #f0f0f0; border: 1px solid #ddd; padding: 3px; margin: 1px 1px 10px 1px; } .blogHeading { font-size: 20px; line-height: normal; font-weight: bold; padding: 0px; margin: 0px; } .blogHeading a { text-decoration: none; color: black; } .endsection { align: right; color: #666666; margin-top: 10px; } .endsectionleftnav { align: right; color: #666666; margin-top: 10px; } h1 { font-size: 24px; line-height: normal; font-weight: bold; background-color: #f0f0f0; color: #003366; border-bottom: 1px solid #3c78b5; padding: 2px; margin: 36px 0px 4px 0px; } h2 { font-size: 18px; line-height: normal; font-weight: bold; background-color: #f0f0f0; border-bottom: 1px solid #3c78b5; padding: 2px; margin: 27px 0px 4px 0px; } h3 { font-size: 14px; line-height: normal; font-weight: bold; background-color: #f0f0f0; padding: 2px; margin: 21px 0px 4px 0px; } h4 { font-size: 12px; line-height: normal; font-weight: bold; background-color: #f0f0f0; padding: 2px; margin: 18px 0px 4px 0px; } h4.search { font-size: 12px; line-height: normal; font-weight: normal; background-color: #f0f0f0; padding: 4px; margin: 18px 0px 4px 0px; } h5 { font-size: 10px; line-height: normal; font-weight: bold; background-color: #f0f0f0; padding: 2px; margin: 14px 0px 4px 0px; } h6 { font-size: 8px; line-height: normal; font-weight: bold; background-color: #f0f0f0; padding: 2px; margin: 14px 0px 4px 0px; } .smallfont { font-size: 10px; } .descfont { font-size: 10px; color: #666666; } .smallerfont { font-size: 9px; } .smalltext { color: #666666; font-size: 10px; } .smalltext a { color: #666666; } .smalltext-blue { color: #3c78b5; font-size: 10px; } .surtitle { margin-left: 1px; margin-bottom: 5px; font-size: 14px; color: #666666; } /* css hack found here: http://www.fo3nix.pwp.blueyonder.co.uk/tutorials/css/hacks/ */ .navItemOver { font-size: 10px; font-weight: bold; color: #ffffff; background-color: #003366; cursor: hand; voice-family: '\'}\''; voice-family:inherit; cursor: pointer;} .navItemOver a { color: #ffffff; background-color:#003366; text-decoration: none; } .navItemOver a:visited { color: #ffffff; background-color:#003366; text-decoration: none; } .navItemOver a:hover { color: #ffffff; background-color:#003366; text-decoration: none; } .navItem { font-size: 10px; font-weight: bold; color: #ffffff; background-color: #3c78b5; } .navItem a { color: #ffffff; text-decoration: none; } .navItem a:hover { color: #ffffff; text-decoration: none; } .navItem a:visited { color: #ffffff; text-decoration: none; } div.padded { padding: 4px; } div.thickPadded { padding: 10px; } h3.macrolibrariestitle { margin: 0px 0px 0px 0px; } div.centered { text-align: center; margin: 10px; } div.centered table {margin: 0px auto; text-align: left; } .tableview table { margin: 0; } .tableview th { text-align: left; color: #003366; font-size: 12px; padding: 5px 0px 0px 5px; border-bottom: 2px solid #3c78b5; } .tableview td { text-align: left; border-color: #ccc; border-width: 0px 0px 1px 0px; border-style: solid; margin: 0; padding: 4px 10px 4px 5px; } .grid { margin: 2px 0px 5px 0px; border-collapse: collapse; } .grid th { border: 1px solid #ccc; padding: 2px 4px 2px 4px; background: #f0f0f0; text-align: center; } .grid td { border: 1px solid #ccc; padding: 3px 4px 3px 4px; } .gridHover { background-color: #f9f9f9; } td.infocell { background-color: #f0f0f0; } .label { font-weight: bold; color: #003366; } label { font-weight: bold; color: #003366; } .error { background-color: #fcc; } .errorBox { background-color: #fcc; border: 1px solid #c00; padding: 5px; margin: 5px; } .errorMessage { color: #c00; } .success { background-color: #dfd; } .successBox { background-color: #dfd; border: 1px solid #090; padding: 5px; margin-top:5px; margin-bottom:5px; } blockquote { padding-left: 10px; padding-right: 10px; margin-left: 5px; margin-right: 0px; border-left: 1px solid #3c78b5; } table.confluenceTable { margin: 5px; border-collapse: collapse; } /* Added as a temporary fix for CONF-4223. The table elements appear to be inheriting the border: none attribute from the sectionMacro class */ table.confluenceTable td.confluenceTd { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; } /* Added as a temporary fix for CONF-4223. The table elements appear to be inheriting the border: none attribute from the sectionMacro class */ table.confluenceTable th.confluenceTh { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; background-color: #f0f0f0; text-align: center; } td.confluenceTd { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; } th.confluenceTh { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; background-color: #f0f0f0; text-align: center; } DIV.small { font-size: 9px; } H1.pagename { margin-top: 0px; } IMG.inline {} .loginform { margin: 5px; border: 1px solid #ccc; } /* The text how the "This is a preview" comment should be shown. */ .previewnote { text-align: center; font-size: 11px; color: red; } /* How the preview content should be shown */ .previewcontent { background: #E0E0E0; } /* How the system messages should be shown (DisplayMessage.jsp) */ .messagecontent { background: #E0E0E0; } /* How the "This page has been modified..." -comment should be shown. */ .conflictnote { } .createlink { color: maroon; } a.createlink { color: maroon; } .templateparameter { font-size: 9px; color: darkblue; } .diffadded { background: #ddffdd; padding: 1px 1px 1px 4px; border-left: 4px solid darkgreen; } .diffdeleted { color: #999; background: #ffdddd; padding: 1px 1px 1px 4px; border-left: 4px solid darkred; } .diffnochange { padding: 1px 1px 1px 4px; border-left: 4px solid lightgrey; } .differror { background: brown; } .diff { font-family: lucida console, courier new, fixed-width; font-size: 12px; line-height: 14px; } .diffaddedchars { background-color:#99ff99; font-weight:bolder; } .diffremovedchars { background-color:#ff9999; text-decoration: line-through; font-weight:bolder; } .greybackground { background: #f0f0f0 } .greybox { border: 1px solid #ddd; padding: 3px; margin: 1px 1px 10px 1px; } .borderedGreyBox { border: 1px solid #cccccc; background-color: #f0f0f0; padding: 10px; } .greyboxfilled { border: 1px solid #ddd; background: #f0f0f0; padding: 3px; margin: 1px 1px 10px 1px; } .navBackgroundBox { padding: 5px 5px 5px 5px; font-size: 22px; font-weight: bold; font-family: Arial, sans-serif; color: white; background: #3c78b5; text-decoration: none; } .previewBoxTop { background-color: #f0f0f0; border-width: 1px 1px 0px 1px; border-style: solid; border-color: #3c78b5; padding: 5px; margin: 5px 0px 0px 0px; text-align: center; } .previewContent { background-color: #fff; border-color: #3c78b5; border-width: 0px 1px 0px 1px; border-style: solid; padding: 10px; margin: 0px; } .previewBoxBottom { background-color: #f0f0f0; border-width: 0px 1px 1px 1px; border-style: solid; border-color: #3c78b5; padding: 5px; margin: 0px 0px 5px 0px; text-align: center; } .functionbox { background-color: #f0f0f0; border: 1px solid #3c78b5; padding: 3px; margin: 1px 1px 10px 1px; } .functionbox-greyborder { background-color: #f0f0f0; border: 1px solid #ddd; padding: 3px; margin: 1px 1px 10px 1px; } .search-highlight { background-color: #ffffcc; } /* normal (white) background */ .rowNormal { background-color: #ffffff; } /* alternate (pale yellow) background */ .rowAlternate { background-color: #f7f7f7; } /* used in the list attachments table */ .rowAlternateNoBottomColor { background-color: #f7f7f7; } .rowAlternateNoBottomNoColor { } .rowAlternateNoBottomColor td { border-bottom: 0px; } .rowAlternateNoBottomNoColor td { border-bottom: 0px; } /* row highlight (grey) background */ .rowHighlight { background-color: #f0f0f0; } TD.greenbar {FONT-SIZE: 2px; BACKGROUND: #00df00; BORDER: 1px solid #9c9c9c; PADDING: 0px; } TD.redbar {FONT-SIZE: 2px; BACKGROUND: #df0000; BORDER: 1px solid #9c9c9c; PADDING: 0px; } TD.darkredbar {FONT-SIZE: 2px; BACKGROUND: #af0000; BORDER: 1px solid #9c9c9c; PADDING: 0px; } TR.testpassed {FONT-SIZE: 2px; BACKGROUND: #ddffdd; PADDING: 0px; } TR.testfailed {FONT-SIZE: 2px; BACKGROUND: #ffdddd; PADDING: 0px; } .toolbar { margin: 0px; border-collapse: collapse; } .toolbar td { border: 1px solid #ccc; padding: 2px 2px 2px 2px; color: #ccc; } td.noformatting { border-width: 0px; border-style: none; text-align: center; padding: 0px; } .commentblock { margin: 12px 0 12px 0; } /* * Divs displaying the license information, if necessary. */ .license-eval, .license-none, .license-nonprofit { border-top: 1px solid #bbbbbb; text-align: center; font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; } .license-eval, .license-none { background-color: #ffcccc; } .license-eval b, .license-none b { color: #990000 } .license-nonprofit { background-color: #ffffff; } /* * The shadow at the bottom of the page between the main content and the * "powered by" section. */ .bottomshadow { height: 12px; background-image: url("$req.contextPath/images/border/border_bottom.gif"); background-repeat: repeat-x; } /* * Styling of the operations box */ .navmenu .operations li, .navmenu .operations ul { list-style: none; margin-left: 0; padding-left: 0; } .navmenu .operations ul { margin-bottom: 9px; } .navmenu .label { font-weight: inherit; } /* * Styling of ops as a toolbar */ .toolbar div { display: none; } .toolbar .label { display: none; } .toolbar .operations { display: block; } .toolbar .operations ul { display: inline; list-style: none; margin-left: 10px; padding-left: 0; } .toolbar .operations li { list-style: none; display: inline; } /* list page navigational tabs */ #foldertab { padding: 3px 0px 3px 8px; margin-left: 0; border-bottom: 1px solid #3c78b5; font: bold 11px Verdana, sans-serif; } #foldertab li { list-style: none; margin: 0; display: inline; } #foldertab li a { padding: 3px 0.5em; margin-left: 3px; border: 1px solid #3c78b5; border-bottom: none; background: #3c78b5; text-decoration: none; } #foldertab li a:link { color: #ffffff; } #foldertab li a:visited { color: #ffffff; } #foldertab li a:hover { color: #ffffff; background: #003366; border-color: #003366; } #foldertab li a.current { background: white; border-bottom: 1px solid white; color: black; } #foldertab li a.current:link { color: black; } #foldertab li a.current:visited { color: black; } #foldertab li a.current:hover { background: white; border-bottom: 1px solid white; color: black; } /* alphabet list */ ul#squaretab { margin-left: 0; padding-left: 0; white-space: nowrap; font: bold 8px Verdana, sans-serif; } #squaretab li { display: inline; list-style-type: none; } #squaretab a { padding: 2px 6px; border: 1px solid #3c78b5; } #squaretab a:link, #squaretab a:visited { color: #fff; background-color: #3c78b5; text-decoration: none; } #squaretab a:hover { color: #ffffff; background-color: #003366; border-color: #003366; text-decoration: none; } #squaretab li a#current { background: white; color: black; } .blogcalendar * { font-family:verdana, arial, sans-serif; font-size:x-small; font-weight:normal; line-height:140%; padding:2px; } table.blogcalendar { border: 1px solid #3c78b5; } .blogcalendar th.calendarhead, a.calendarhead { font-size:x-small; font-weight:bold; padding:2px; text-transform:uppercase; background-color: #3c78b5; color: #ffffff; letter-spacing: .3em; text-transform: uppercase; } .calendarhead:visited {color: white;} .calendarhead:active {color: white;} .calendarhead:hover {color: white;} .blogcalendar th { font-size:x-small; font-weight:bold; padding:2px; background-color:#f0f0f0; } .blogcalendar td { font-size:x-small; font-weight:normal; } .searchGroup { padding: 0 0 10px 0; background: #f0f0f0; } .searchGroupHeading { font-size: 10px; font-weight: bold; color: #ffffff; background-color: #3c78b5; padding: 2px 4px 1px 4px; } .searchItem { padding: 1px 4px 1px 4px; } .searchItemSelected { padding: 1px 4px 1px 4px; font-weight: bold; background: #ddd; } /* permissions page styles */ .permissionHeading { border-bottom: #bbb; border-width: 0 0 1px 0; border-style: solid; font-size: 16px; text-align: left; } .permissionTab { border-width: 0 0 0 1px; border-style: solid; background: #3c78b5; color: #ffffff; font-size: 10px; } .permissionSuperTab { border-width: 0 0 0 1px; border-style: solid; background: #003366; color: #ffffff; } .permissionCell { border-left: #bbb; border-width: 0 0 0 1px; border-style: solid; } /* warning panel */ .warningPanel { background: #FFFFCE; border:#F0C000 1px solid; padding: 8px; margin: 10px; } /* alert panel */ .alertPanel { background: #FFCCCC; border:#C00 1px solid; padding: 8px; margin: 10px; } /* info panel */ .infoPanel { background: #D8E4F1; border:#3c78b5 1px solid; padding: 8px; margin: 10px; } /* side menu highlighting (e.g. space content screen) */ .optionPadded { padding: 2px; } .optionSelected { background-color: #ffffcc; padding: 2px; border: 1px solid #ddd; margin: -1px; } .optionSelected a { font-weight: bold; text-decoration: none; color: black; } /* information macros */ .noteMacro { border-style: solid; border-width: 1px; border-color: #F0C000; background-color: #FFFFCE; text-align:left; margin-top: 5px; margin-bottom: 5px} .warningMacro { border-style: solid; border-width: 1px; border-color: #c00; background-color: #fcc; text-align:left; margin-top: 5px; margin-bottom: 5px} .infoMacro { border-style: solid; border-width: 1px; border-color: #3c78b5; background-color: #D8E4F1; text-align:left; margin-top: 5px; margin-bottom: 5px} .tipMacro { border-style: solid; border-width: 1px; border-color: #090; background-color: #dfd; text-align:left; margin-top: 5px; margin-bottom: 5px} .informationMacroPadding { padding: 5px 0 0 5px; } table.infoMacro td, table.warningMacro td, table.tipMacro td, table.noteMacro td, table.sectionMacro td { border: none; } table.sectionMacroWithBorder td.columnMacro { border-style: dashed; border-width: 1px; border-color: #cccccc;} .pagecontent { padding: 10px; text-align: left; } /* styles for links in the top bar */ .topBarDiv a:link {color: #ffffff;} .topBarDiv a:visited {color: #ffffff;} .topBarDiv a:active {color: #ffffff;} .topBarDiv a:hover {color: #ffffff;} .topBarDiv {color: #ffffff;} .topBar { background-color: #003366; } /* styles for extended operations */ .greyLinks a:link {color: #666666; text-decoration:underline;} .greyLinks a:visited {color: #666666; text-decoration:underline;} .greyLinks a:active {color: #666666; text-decoration:underline;} .greyLinks a:hover {color: #666666; text-decoration:underline;} .greyLinks {color: #666666; display:block; padding: 10px} .logoSpaceLink {color: #999999; text-decoration: none} .logoSpaceLink a:link {color: #999999; text-decoration: none} .logoSpaceLink a:visited {color: #999999; text-decoration: none} .logoSpaceLink a:active {color: #999999; text-decoration: none} .logoSpaceLink a:hover {color: #003366; text-decoration: none} /* basic panel (basicpanel.vmd) style */ .basicPanelContainer {border: 1px solid #3c78b5; margin-top: 2px; margin-bottom: 8px; width: 100%} .basicPanelTitle {padding: 5px; margin: 0px; background-color: #f0f0f0; color: black; font-weight: bold;} .basicPanelBody {padding: 5px; margin: 0px} .separatorLinks a:link {color: white} .separatorLinks a:visited {color: white} .separatorLinks a:active {color: white} .greynavbar {background-color: #f0f0f0; border-top: 1px solid #3c78b5; margin-top: 2px} div.headerField { float: left; width: auto; height: 100%; } .headerFloat { margin-left: auto; width: 50%; } .headerFloatLeft { float: left; margin-right: 20px; margin-bottom: 10px; } #headerRow { padding: 10px; } div.license-personal { background-color: #003366; color: #ffffff; } div.license-personal a { color: #ffffff; } .greyFormBox { border: 1px solid #cccccc; padding: 5px; } /* IE automatically adds a margin before and after form tags. Use this style to remove that */ .marginlessForm { margin: 0px; } .openPageHighlight { background-color: #ffffcc; padding: 2px; border: 1px solid #ddd; } .editPageInsertLinks, .editPageInsertLinks a { color: #666666; font-weight: bold; font-size: 10px; } /* Style for label heatmap. */ .top10 a { font-weight: bold; font-size: 2em; color: #003366; } .top25 a { font-weight: bold; font-size: 1.6em; color: #003366; } .top50 a { font-size: 1.4em; color: #003366; } .top100 a { font-size: 1.2em; color: #003366; } .heatmap { list-style:none; width: 95%; margin: 0px auto; } .heatmap a { text-decoration:none; } .heatmap a:hover { text-decoration:underline; } .heatmap li { display: inline; } .minitab { padding: 3px 0px 3px 8px; margin-left: 0; margin-top: 1px; margin-bottom: 0px; border-bottom: 1px solid #3c78b5; font: bold 9px Verdana, sans-serif; text-decoration: none; float:none; } .selectedminitab { padding: 3px 0.5em; margin-left: 3px; margin-top: 1px; border: 1px solid #3c78b5; background: white; border-bottom: 1px solid white; color: #000000; text-decoration: none; } .unselectedminitab { padding: 3px 0.5em; margin-left: 3px; margin-top: 1px; border: 1px solid #3c78b5; border-bottom: none; background: #3c78b5; color: #ffffff; text-decoration: none; } a.unselectedminitab:hover { color: #ffffff; background: #003366; border-color: #003366; } a.unselectedminitab:link { color: white; } a.unselectedminitab:visited { color: white; } a.selectedminitab:link { color: black; } a.selectedminitab:visited { color: black; } .linkerror { background-color: #fcc;} a.labelOperationLink:link {text-decoration: underline} a.labelOperationLink:active {text-decoration: underline} a.labelOperationLink:visited {text-decoration: underline} a.labelOperationLink:hover {text-decoration: underline} a.newLabel:link {background-color: #ddffdd} a.newLabel:active {background-color: #ddffdd} a.newLabel:visited {background-color: #ddffdd} a.newLabel:hover {background-color: #ddffdd} ul.square {list-style-type: square} .inline-control-link { background: #ffc; font-size: 9px; color: #666; padding: 2px; text-transform: uppercase; text-decoration: none; } .inline-control-link a:link {text-decoration: none} .inline-control-link a:active {text-decoration: none} .inline-control-link a:visited {text-decoration: none} .inline-control-link a:hover {text-decoration: none} .inline-control-link { background: #ffc; font-size: 9px; color: #666; padding: 2px; text-transform: uppercase; text-decoration: none; cursor: pointer; } div.auto_complete { width: 350px; background: #fff; } div.auto_complete ul { border: 1px solid #888; margin: 0; padding: 0; width: 100%; list-style-type: none; } div.auto_complete ul li { margin: 0; padding: 3px; } div.auto_complete ul li.selected { background-color: #ffb; } div.auto_complete ul strong.highlight { color: #800; margin: 0; padding: 0; } /******* Edit Page Styles *******/ .toogleFormDiv{ border:1px solid #A7A6AA; background-color:white; padding:5px; margin-top: 5px; } .toogleInfoDiv{ border:1px solid #A7A6AA; background-color:white; display:none; padding:5px; margin-top: 10px; } .inputSection{ margin-bottom:20px; } #editBox{ border:1px solid lightgray; background-color:#F0F0F0; } /******* Left Navigation Theme Styles ********/ .leftnav li a { text-decoration:none; color:white; margin:0px; display:block; padding:2px; padding-left:5px; background-color: #3c78b5; border-top:1px solid #3c78b5; } .leftnav li a:active {color:white;} .leftnav li a:visited {color:white;} .leftnav li a:hover {background-color: #003366; color:white;} /* Added by Shaun during i18n */ .replaced { background-color: #33CC66; } .topPadding { margin-top: 20px; } /* new form style */ .form-block { padding: 6px; } .form-error-block { padding: 6px; background: #fcc; border-top: #f0f0f0 1px solid; border-bottom: #f0f0f0 1px solid; margin-bottom: 6px; padding: 0 12px 0 12px; } .form-element-large { font-size: 16px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; } .form-element-small { font-size: 12px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; } .form-header { background: lightyellow; border-top: #f0f0f0 1px solid; border-bottom: #f0f0f0 1px solid; margin-bottom: 6px; padding: 0 12px 0 12px; } .form-header p, .form-block p, .form-error-block p { line-height: normal; margin: 12px 0 12px 0; } .form-example { color: #888; font-size: 11px; } .form-divider { border-bottom: #ccc 1px solid; margin-bottom: 6px; } .form-buttons { margin-top: 6px; border-top: #ccc 1px solid; border-bottom: #ccc 1px solid; background: #f0f0f0; padding: 10px; text-align: center; } .form-buttons input { width: 100px; } .form-block .error { padding: 6px; margin-bottom: 6px; } --> </style> </head> <body> <div id="PageContent"> <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%"><tr> <td valign="top" class="pagebody"> <div class="pageheader"> <span class="pagetitle"> Page Edited : <a href="http://cwiki.apache.org/confluence/display/openjpa">openjpa</a> : <a href="http://cwiki.apache.org/confluence/display/openjpa/Building+OpenJPA">Building OpenJPA</a> </span> </div> <p> <a href="http://cwiki.apache.org/confluence/display/openjpa/Building+OpenJPA">Building OpenJPA</a> has been edited by <a href="http://cwiki.apache.org/confluence/display/~michael.d.dick@gmail.com">Michael Dick</a> <span class="smallfont">(Sep 15, 2008)</span>. </p> <p> Change summary: <div class="greybox wiki-content"><p>Update instructions for building the manual. </p></div> </p> <p> <a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=23556&originalVersion=21&revisedVersion=22">(View changes)</a> </p> <span class="label">Content:</span><br/> <div class="greybox wiki-content"> <h1><a name="BuildingOpenJPA-BuildingOpenJPA"></a>Building OpenJPA</h1> <p>These instructions describe how to check out the current OpenJPA source code (from the Subversion source code management repository) and build it (using the Apache Maven 2 build tool). They are written for use from the console, and are known to work on Linux and Mac OSX. They are also reported to work from Windows.</p> <ol> <li>Ensure that you have Java 1.5 installed and in your path by running: <tt>java -version</tt> OpenJPA does not currently build with JDK 1.6.</li> <li>Install the build tool, Apache Maven 2.0.8, from <span class="nobr"><a href="http://maven.apache.org/" title="Visit page outside Confluence" rel="nofollow">http://maven.apache.org/<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span>. If it is installed correctly, typing <tt>mvn -v</tt> from the console will result in the text <tt>Maven version: 2.0.8</tt></li> <li>Install the SCM tool, Subversion, from <span class="nobr"><a href="http://subversion.tigris.org/" title="Visit page outside Confluence" rel="nofollow">http://subversion.tigris.org/<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span>. If it installed correctly, typing the following command should output help information: <tt>svn help</tt></li> <li>Create a new directory you want to do your work in, then change to that directory from the console.</li> <li>Check out the sources by running: <tt>svn co <span class="nobr"><a href="https://svn.apache.org/repos/asf/openjpa/trunk" title="Visit page outside Confluence" rel="nofollow">https://svn.apache.org/repos/asf/openjpa/trunk<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> openjpa</tt>. It will check out the sources to openjpa directory. More information on checking out the OpenJPA sources can be found on the <a href="/confluence/display/openjpa/SourceAccess" title="SourceAccess">SourceAccess</a> page.</li> <li>Change to the openjpa directory, which has already been created in the previous step.</li> <li>Build OpenJPA by running: <tt>mvn package</tt> or better <tt>mvn install</tt>. The first time you run the build, many dependencies are automatically resolved and downloaded. <b>It is common for dependency downloading to fail the first time, which will fail the build.</b> If any of these dependency downloads fail, just re-run the command. You may also add the following to your <tt>~/.m2/setting.xml</tt> file (see <span class="nobr"><a href="http://maven.apache.org/guides/mini/guide-mirror-settings.html" title="Visit page outside Confluence" rel="nofollow">http://maven.apache.org/guides/mini/guide-mirror-settings.html<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span>)<br/> #</li> </ol> <div class="code"><div class="codeContent"> <pre class="code-xml"><span class="code-tag"><settings></span> <span class="code-tag"><mirrors></span> <span class="code-tag"><mirror></span> <span class="code-tag"><id></span>repo.mergere.com<span class="code-tag"></id></span> <span class="code-tag"><url></span>http://repo.mergere.com/maven2<span class="code-tag"></url></span> <span class="code-tag"><mirrorOf></span>central<span class="code-tag"></mirrorOf></span> <span class="code-tag"></mirror></span> <span class="code-tag"></mirrors></span> <span class="code-tag"></settings></span></pre> </div></div> <p> If any tests fail, and you want to ignore the failures, instead run:</p> <p> <tt>mvn package -DfailIfNoTests=false</tt></p> <p>An example session as as follows:</p> <div class="code"><div class="codeContent"> <pre class="code-java">$ cd /tmp/ $ java -version java version <span class="code-quote">"1.5.0_06"</span> Java(TM) 2 <span class="code-object">Runtime</span> Environment, Standard Edition (build 1.5.0_06-112) Java HotSpot(TM) Client VM (build 1.5.0_06-64, mixed mode, sharing) $ mvn -v Maven version: 2.0.8 $ svn --version svn, version 1.4.3 (r23084) compiled Jan 18 2007, 07:47:40 $ svn co https:<span class="code-comment">//svn.apache.org/repos/asf/openjpa/trunk/ </span> A trunk/openjpa-lib A trunk/openjpa-lib/src A trunk/openjpa-lib/src/test A trunk/openjpa-lib/src/test/java A trunk/openjpa-lib/src/test/java/org A trunk/openjpa-lib/src/test/java/org/apache A trunk/openjpa-lib/src/test/java/org/apache/openjpa A trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib A trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib/test A trunk/openjpa-lib/src/test/java/org/apache/openjpa/lib/test/AbstractTestCase.java ... A trunk/openjpa-persistence/pom.xml Checked out revision 421381. $ cd trunk/ $ mvn compile [INFO] Scanning <span class="code-keyword">for</span> projects... [INFO] Reactor build order: [INFO] OpenJPA [INFO] OpenJPA Utilities [INFO] OpenJPA Kernel [INFO] OpenJPA JDBC [INFO] OpenJPA JPA [INFO] OpenJPA JPA JDBC [INFO] OpenJPA XML Store [INFO] OpenJPA Slice [INFO] OpenJPA Aggregate Jar [INFO] OpenJPA Distribution [INFO] OpenJPA Persistence Examples [INFO] OpenJPA Integration Tests [INFO] OpenJPA Examples Integration Tests [INFO] OpenJPA JPA TCK Integration Tests [INFO] ---------------------------------------------------------------------------- [INFO] Building OpenJPA [INFO] task-segment: [compile] [INFO] ---------------------------------------------------------------------------- ... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Reactor Summary: [INFO] ------------------------------------------------------------------------ [INFO] OpenJPA ............................................... SUCCESS [0.000s] [INFO] OpenJPA Utilities ..................................... SUCCESS [1:12.953s] [INFO] OpenJPA Kernel ........................................ SUCCESS [13.219s] [INFO] OpenJPA JDBC .......................................... SUCCESS [9.094s] [INFO] OpenJPA JPA ........................................... SUCCESS [3.500s] [INFO] OpenJPA JPA JDBC ...................................... SUCCESS [3.250s] [INFO] OpenJPA XML Store ..................................... SUCCESS [0.140s] [INFO] OpenJPA Slice ......................................... SUCCESS [0.719s] [INFO] OpenJPA Aggregate Jar ................................. SUCCESS [0.250s] [INFO] OpenJPA Distribution .................................. SUCCESS [0.344s] [INFO] OpenJPA Persistence Examples .......................... SUCCESS [0.265s] [INFO] OpenJPA Integration Tests ............................. SUCCESS [0.000s] [INFO] OpenJPA Examples Integration Tests .................... SUCCESS [0.000s] [INFO] OpenJPA JPA TCK Integration Tests ..................... SUCCESS [0.000s] [INFO] ------------------------------------------------------------------------ [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESSFUL [INFO] ------------------------------------------------------------------------ [INFO] Total time: 1 minute 44 seconds [INFO] Finished at: Tue Sep 02 08:09:27 CDT 2008 [INFO] Final Memory: 11M/29M [INFO] ------------------------------------------------------------------------ $ mvn <span class="code-keyword">package</span> -DskipTests [INFO] Scanning <span class="code-keyword">for</span> projects... ... [INFO] [assembly:attached {execution: bin}] [INFO] Building zip: /tmp/openjpatestbuild/trunk/openjpa-project/target/site/ downloads/apache-openjpa-1.3.0-SNAPSHOT-binary.zip ... $ ls -lh openjpa-project/target/filtered-site/resources/downloads/ total 46985 -rw-r--r-- 1 sutter pony3 9374808 Sep 2 08:14 apache-openjpa-1.3.0-SNAPSHOT-binary.zip -rw-r--r-- 1 sutter pony3 14680997 Sep 2 08:16 apache-openjpa-1.3.0-SNAPSHOT-source.zip</pre> </div></div> <h2><a name="BuildingOpenJPA-Executingvariousbuildtasks"></a>Executing various build tasks</h2> <h5><a name="BuildingOpenJPA-Runningjustthe%22TestPersistence%22testcase"></a>Running just the "TestPersistence" test case</h5> <div class="code"><div class="codeContent"> <pre class="code-java">mvn test -Dtest=TestPersistence</pre> </div></div> <h5><a name="BuildingOpenJPA-Buildingandrunningonlytheexamplesincludedinthedistribution"></a>Building and running only the examples included in the distribution</h5> <div class="code"><div class="codeContent"> <pre class="code-java">mvn -DskipTests -Pexamples-profile integration-test</pre> </div></div> <h5><a name="BuildingOpenJPA-Buildingjustthejavadoc"></a>Building just the javadoc</h5> <p>First install the jars:</p> <div class="code"><div class="codeContent"> <pre class="code-java">mvn install -DskipTests</pre> </div></div> <p>Then build the javadoc:</p> <div class="code"><div class="codeContent"> <pre class="code-java">mvn <span class="code-keyword">package</span> -DskipTests -Pjavadoc-profile</pre> </div></div> <p>The javadoc will be output to <tt>target/site/apidocs/index.html</tt>.</p> <h5><a name="BuildingOpenJPA-Buildingjustthedocbookdocumentation"></a>Building just the docbook documentation</h5> <div class="code"><div class="codeContent"> <pre class="code-java">set MAVEN_OPTS=-Xmx512m mvn -f openjpa-project/pom.xml process-resources -Pdocbook-profile</pre> </div></div> <p>The manual HTML will be output to <tt>openjpa-project/target/manual/manual.html</tt>.</p> <table cellpadding='5' width='85%' cellspacing='8px' class='noteMacro' border="0" align='center'><colgroup><col width='24'><col></colgroup><tr><td valign='top'><img src="/confluence/images/icons/emoticons/warning.gif" width="16" height="16" align="absmiddle" alt="" border="0"></td><td> <p>In order to include images in a PDF file the docbook plugin needs to have a Java imaging library included on the classpath. At this time the Java imaging libraries (JAI and JIMI) are not included in the central maven repository. In order to satisfy this requirement you will have to download them and install them to your local repository manually. Instructions on how to do this are included in openjpa-project/pom.xml. </p></td></tr></table> <h5><a name="BuildingOpenJPA-BuildingwithJDK1.4moduleverification%28onlyforversionsofOpenJPApriortosvnrevision640685%29"></a>Building with JDK 1.4 module verification (only for versions of OpenJPA prior to svn revision 640685)</h5> <div class="code"><div class="codeContent"> <pre class="code-java">mvn compile -Djava14.jar=C:\Program Files\Java\j2re1.4.2_07\lib\rt.jar compile</pre> </div></div> <p>Specifying the "java14.jar" system property will cause the JDK-1.4-dependent modules to be compiled with the value as the bootclasspath to the compiler. This can be useful to ensure that modifications and additions do not violate the JDK version restriction of the module. Since the runtime jar location is platform, version, and installation dependent, the exact location of the runtime jar will vary, which is why it needs to be manually specified.</p></div> </td></tr></table></div> <p> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td height="12" background="http://cwiki.apache.org/confluence/images/border/border_bottom.gif"><img src="http://cwiki.apache.org/confluence/images/border/spacer.gif" width="1" height="1" border="0"/></td> </tr> </table> <div class="smalltext"> Powered by <a href="http://www.atlassian.com/software/confluence/default.jsp?clicked=footer" class="smalltext">Atlassian Confluence</a> (Version: 2.2.9 Build:#527 Sep 07, 2006) - <a href="http://jira.atlassian.com/secure/BrowseProject.jspa?id=10470" class="smalltext">Bug/feature request</a><br/> <br> <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action">Unsubscribe or edit your notifications preferences</a> </div> </body> </html> From commits-return-3374-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Tue Sep 16 19:34:55 2008 Return-Path: <commits-return-3374-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 86730 invoked from network); 16 Sep 2008 19:34:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Sep 2008 19:34:55 -0000 Received: (qmail 4383 invoked by uid 500); 16 Sep 2008 19:34:52 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 4370 invoked by uid 500); 16 Sep 2008 19:34:51 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 4361 invoked by uid 99); 16 Sep 2008 19:34:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Sep 2008 12:34:51 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Sep 2008 19:34:01 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id D9AC92388A1E; Tue, 16 Sep 2008 12:34:33 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r696019 - /openjpa/branches/1.0.x/openjpa-project/pom.xml Date: Tue, 16 Sep 2008 19:34:33 -0000 To: commits@openjpa.apache.org From: mikedd@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080916193433.D9AC92388A1E@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mikedd Date: Tue Sep 16 12:34:33 2008 New Revision: 696019 URL: http://svn.apache.org/viewvc?rev=696019&view=rev Log: OPENJPA-695 adding nightly upload profile to branches Modified: openjpa/branches/1.0.x/openjpa-project/pom.xml Modified: openjpa/branches/1.0.x/openjpa-project/pom.xml URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-project/pom.xml?rev=696019&r1=696018&r2=696019&view=diff ============================================================================== --- openjpa/branches/1.0.x/openjpa-project/pom.xml (original) +++ openjpa/branches/1.0.x/openjpa-project/pom.xml Tue Sep 16 12:34:33 2008 @@ -76,6 +76,10 @@ <docbook.target>${project.basedir}/target/manual</docbook.target> <docbook.version>1.67.2</docbook.version> <local.repository>${settings.localRepository}</local.repository> + + <!-- authentication for nightly uploads --> + <nightly.user.name>${user.name}</nightly.user.name> + <nightly.password>passw0rd</nightly.password> </properties> <scm> @@ -276,6 +280,76 @@ </pluginRepository> </pluginRepositories> </profile> + <!-- + Upload distribution files, javadoc and manual to openjpa.apache.org/builds/latest. + This profile is designed to be run nightly by a continuous build server, but can + also be run manually. + + The nightly.user.name and nightly.password properties need to be set prior to using + this profile, ie : + $ mvn -Dnightly.user.name=mikedd -Dnightly.password=mikesPassword -Pnightly-upload package + or (using a profile defined in $user.home/.m2/settings.xml ) + $ mvn -Pnightly-upload,mikes-nightly-credentials package + --> + <profile> + <id>nightly-upload</id> + <build> + <plugins> + <plugin> + <artifactId>maven-antrun-plugin</artifactId> + <executions> + <execution> + <phase>package</phase> + <configuration> + <tasks> + <mkdir dir="target/site/tempDocs"/> + <unzip dest="target/site/tempDocs"> + <fileset dir="target/site/downloads"> + <include name="*binary*.zip"/> + </fileset> + <patternset> + <include name="**/javadoc/**"/> + <include name="**/manual/**"/> + </patternset> + </unzip> + <move todir="target/site/tempDocs/docs"> + <fileset dir="target/site/tempDocs/apache-openjpa-${pom.version}/docs"/> + </move> + <scp todir="${nightly.user.name}:${nightly.password}@people.apache.org:/www/openjpa.apache.org/builds/latest-1.0.x/downloads" + trust="true"> + <fileset dir="target/site/downloads"/> + </scp> + + <scp todir="${nightly.user.name}:${nightly.password}@people.apache.org:/www/openjpa.apache.org/builds/latest-1.0.x/docs" + trust="true"> + <fileset dir="target/site/tempDocs/docs"/> + </scp> + <sshexec host="people.apache.org" + username="${nightly.user.name}" + password="${nightly.password}" + command="chmod -R g+w /www/openjpa.apache.org/builds/latest-1.0.x" + trust="true"/> + <delete> + <fileset dir="target/site/tempDocs"/> + </delete> + </tasks> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + <dependencies> + <dependency> + <groupId>org.apache.ant</groupId> + <artifactId>ant-jsch</artifactId> + <version>1.7.0</version> + </dependency> + </dependencies> + </plugin> + </plugins> + </build> + </profile> </profiles> <!-- need to explicitly list dependencies for assembly to work --> From commits-return-3375-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Tue Sep 16 19:35:03 2008 Return-Path: <commits-return-3375-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 86799 invoked from network); 16 Sep 2008 19:35:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Sep 2008 19:35:02 -0000 Received: (qmail 4770 invoked by uid 500); 16 Sep 2008 19:34:59 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 4752 invoked by uid 500); 16 Sep 2008 19:34:59 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 4743 invoked by uid 99); 16 Sep 2008 19:34:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Sep 2008 12:34:59 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Sep 2008 19:34:09 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id DC77A23889B9; Tue, 16 Sep 2008 12:34:41 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r696020 - /openjpa/branches/1.2.x/openjpa-project/pom.xml Date: Tue, 16 Sep 2008 19:34:41 -0000 To: commits@openjpa.apache.org From: mikedd@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080916193441.DC77A23889B9@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mikedd Date: Tue Sep 16 12:34:41 2008 New Revision: 696020 URL: http://svn.apache.org/viewvc?rev=696020&view=rev Log: OPENJPA-695 adding nightly upload profile to branches Modified: openjpa/branches/1.2.x/openjpa-project/pom.xml Modified: openjpa/branches/1.2.x/openjpa-project/pom.xml URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-project/pom.xml?rev=696020&r1=696019&r2=696020&view=diff ============================================================================== --- openjpa/branches/1.2.x/openjpa-project/pom.xml (original) +++ openjpa/branches/1.2.x/openjpa-project/pom.xml Tue Sep 16 12:34:41 2008 @@ -79,6 +79,10 @@ <docbook.target>${project.basedir}/target/manual</docbook.target> <docbook.version>1.67.2</docbook.version> <local.repository>${settings.localRepository}</local.repository> + + <!-- authentication for nightly uploads --> + <nightly.user.name>${user.name}</nightly.user.name> + <nightly.password>passw0rd</nightly.password> </properties> <build> @@ -303,6 +307,76 @@ </pluginRepository> </pluginRepositories> </profile> + <!-- + Upload distribution files, javadoc and manual to openjpa.apache.org/builds/latest. + This profile is designed to be run nightly by a continuous build server, but can + also be run manually. + + The nightly.user.name and nightly.password properties need to be set prior to using + this profile, ie : + $ mvn -Dnightly.user.name=mikedd -Dnightly.password=mikesPassword -Pnightly-upload package + or (using a profile defined in $user.home/.m2/settings.xml ) + $ mvn -Pnightly-upload,mikes-nightly-credentials package + --> + <profile> + <id>nightly-upload</id> + <build> + <plugins> + <plugin> + <artifactId>maven-antrun-plugin</artifactId> + <executions> + <execution> + <phase>package</phase> + <configuration> + <tasks> + <mkdir dir="target/site/tempDocs"/> + <unzip dest="target/site/tempDocs"> + <fileset dir="target/site/downloads"> + <include name="*binary*.zip"/> + </fileset> + <patternset> + <include name="**/javadoc/**"/> + <include name="**/manual/**"/> + </patternset> + </unzip> + <move todir="target/site/tempDocs/docs"> + <fileset dir="target/site/tempDocs/apache-openjpa-${pom.version}/docs"/> + </move> + <scp todir="${nightly.user.name}:${nightly.password}@people.apache.org:/www/openjpa.apache.org/builds/latest-1.2.x/downloads" + trust="true"> + <fileset dir="target/site/downloads"/> + </scp> + + <scp todir="${nightly.user.name}:${nightly.password}@people.apache.org:/www/openjpa.apache.org/builds/latest-1.2.x/docs" + trust="true"> + <fileset dir="target/site/tempDocs/docs"/> + </scp> + <sshexec host="people.apache.org" + username="${nightly.user.name}" + password="${nightly.password}" + command="chmod -R g+w /www/openjpa.apache.org/builds/latest-1.2.x" + trust="true"/> + <delete> + <fileset dir="target/site/tempDocs"/> + </delete> + </tasks> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + <dependencies> + <dependency> + <groupId>org.apache.ant</groupId> + <artifactId>ant-jsch</artifactId> + <version>1.7.0</version> + </dependency> + </dependencies> + </plugin> + </plugins> + </build> + </profile> </profiles> <!-- need to explicitly list dependencies for assembly to work --> From commits-return-3376-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Tue Sep 16 19:40:02 2008 Return-Path: <commits-return-3376-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 89739 invoked from network); 16 Sep 2008 19:40:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Sep 2008 19:40:02 -0000 Received: (qmail 10999 invoked by uid 500); 16 Sep 2008 19:39:59 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 10988 invoked by uid 500); 16 Sep 2008 19:39:59 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 10979 invoked by uid 99); 16 Sep 2008 19:39:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Sep 2008 12:39:59 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Sep 2008 19:39:02 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id CC3F52388A1B; Tue, 16 Sep 2008 12:39:34 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r696026 - /openjpa/branches/1.2.x/openjpa-project/pom.xml Date: Tue, 16 Sep 2008 19:39:34 -0000 To: commits@openjpa.apache.org From: mikedd@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080916193934.CC3F52388A1B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mikedd Date: Tue Sep 16 12:39:34 2008 New Revision: 696026 URL: http://svn.apache.org/viewvc?rev=696026&view=rev Log: OPENJPA-711 merging revision 695674 to 1.2.x branch Modified: openjpa/branches/1.2.x/openjpa-project/pom.xml Modified: openjpa/branches/1.2.x/openjpa-project/pom.xml URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-project/pom.xml?rev=696026&r1=696025&r2=696026&view=diff ============================================================================== --- openjpa/branches/1.2.x/openjpa-project/pom.xml (original) +++ openjpa/branches/1.2.x/openjpa-project/pom.xml Tue Sep 16 12:39:34 2008 @@ -80,6 +80,24 @@ <docbook.version>1.67.2</docbook.version> <local.repository>${settings.localRepository}</local.repository> + <!-- + Java imaging apis are needed to include images in a PDF. + JIMI or JAI may be used. Neither is available in a maven + repository and should be downloaded and installed manually + to your local repository. + + ie : + $ mvn install:install-file -Dfile=jai_core.jar \ + -DgroupId=javax.media -DartifactId=jai-core \ + -Dversion=1.1.3 -Dpackaging=jar + + Alternatively if you have installed the JAI artifacts to an + internal repository you can specify it with the + -Djai.maven.repos=REPOS_URL command line argument. + --> + <jai.maven.repo>http://not.a.real.repository</jai.maven.repo> + <jai.version>1.1.3</jai.version> + <!-- authentication for nightly uploads --> <nightly.user.name>${user.name}</nightly.user.name> <nightly.password>passw0rd</nightly.password> @@ -289,6 +307,18 @@ <version>4.4</version> <scope>runtime</scope> </dependency> + <dependency> + <groupId>javax.media</groupId> + <artifactId>jai_core</artifactId> + <version>${jai.version}</version> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>javax.media</groupId> + <artifactId>jai_codec</artifactId> + <version>${jai.version}</version> + <scope>runtime</scope> + </dependency> </dependencies> </plugin> </plugins> @@ -306,6 +336,13 @@ <url>http://agilejava.com/maven</url> </pluginRepository> </pluginRepositories> + <repositories> + <repository> + <id>jai.repository</id> + <name>JAI Repository (indirectly used by Docbook plugin)</name> + <url>${jai.maven.repo}</url> + </repository> + </repositories> </profile> <!-- Upload distribution files, javadoc and manual to openjpa.apache.org/builds/latest. From commits-return-3377-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Tue Sep 16 19:40:30 2008 Return-Path: <commits-return-3377-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 90011 invoked from network); 16 Sep 2008 19:40:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Sep 2008 19:40:30 -0000 Received: (qmail 11191 invoked by uid 500); 16 Sep 2008 19:40:27 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 11175 invoked by uid 500); 16 Sep 2008 19:40:27 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 11166 invoked by uid 99); 16 Sep 2008 19:40:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Sep 2008 12:40:27 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Sep 2008 19:39:30 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id BC51223889B9; Tue, 16 Sep 2008 12:39:32 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r696025 - /openjpa/branches/1.0.x/openjpa-project/pom.xml Date: Tue, 16 Sep 2008 19:39:32 -0000 To: commits@openjpa.apache.org From: mikedd@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080916193932.BC51223889B9@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mikedd Date: Tue Sep 16 12:39:32 2008 New Revision: 696025 URL: http://svn.apache.org/viewvc?rev=696025&view=rev Log: OPENJPA-711 merging revision 695674 to 1.0.x branch Modified: openjpa/branches/1.0.x/openjpa-project/pom.xml Modified: openjpa/branches/1.0.x/openjpa-project/pom.xml URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-project/pom.xml?rev=696025&r1=696024&r2=696025&view=diff ============================================================================== --- openjpa/branches/1.0.x/openjpa-project/pom.xml (original) +++ openjpa/branches/1.0.x/openjpa-project/pom.xml Tue Sep 16 12:39:32 2008 @@ -77,6 +77,24 @@ <docbook.version>1.67.2</docbook.version> <local.repository>${settings.localRepository}</local.repository> + <!-- + Java imaging apis are needed to include images in a PDF. + JIMI or JAI may be used. Neither is available in a maven + repository and should be downloaded and installed manually + to your local repository. + + ie : + $ mvn install:install-file -Dfile=jai_core.jar \ + -DgroupId=javax.media -DartifactId=jai-core \ + -Dversion=1.1.3 -Dpackaging=jar + + Alternatively if you have installed the JAI artifacts to an + internal repository you can specify it with the + -Djai.maven.repos=REPOS_URL command line argument. + --> + <jai.maven.repo>http://not.a.real.repository</jai.maven.repo> + <jai.version>1.1.3</jai.version> + <!-- authentication for nightly uploads --> <nightly.user.name>${user.name}</nightly.user.name> <nightly.password>passw0rd</nightly.password> @@ -262,6 +280,18 @@ <version>4.4</version> <scope>runtime</scope> </dependency> + <dependency> + <groupId>javax.media</groupId> + <artifactId>jai_core</artifactId> + <version>${jai.version}</version> + <scope>runtime</scope> + </dependency> + <dependency> + <groupId>javax.media</groupId> + <artifactId>jai_codec</artifactId> + <version>${jai.version}</version> + <scope>runtime</scope> + </dependency> </dependencies> </plugin> </plugins> @@ -279,6 +309,13 @@ <url>http://agilejava.com/maven</url> </pluginRepository> </pluginRepositories> + <repositories> + <repository> + <id>jai.repository</id> + <name>JAI Repository (indirectly used by Docbook plugin)</name> + <url>${jai.maven.repo}</url> + </repository> + </repositories> </profile> <!-- Upload distribution files, javadoc and manual to openjpa.apache.org/builds/latest. From commits-return-3378-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Tue Sep 16 21:55:31 2008 Return-Path: <commits-return-3378-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 87346 invoked from network); 16 Sep 2008 21:55:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Sep 2008 21:55:30 -0000 Received: (qmail 39000 invoked by uid 500); 16 Sep 2008 21:55:21 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 38988 invoked by uid 500); 16 Sep 2008 21:55:21 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 38971 invoked by uid 99); 16 Sep 2008 21:55:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Sep 2008 14:55:21 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Sep 2008 21:54:30 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 06A1A23889E9; Tue, 16 Sep 2008 14:55:03 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r696082 - /openjpa/trunk/openjpa-project/pom.xml Date: Tue, 16 Sep 2008 21:55:02 -0000 To: commits@openjpa.apache.org From: mikedd@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080916215503.06A1A23889E9@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mikedd Date: Tue Sep 16 14:55:02 2008 New Revision: 696082 URL: http://svn.apache.org/viewvc?rev=696082&view=rev Log: OPENJPA-726 adding md5sum for nightly downloads Modified: openjpa/trunk/openjpa-project/pom.xml Modified: openjpa/trunk/openjpa-project/pom.xml URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/pom.xml?rev=696082&r1=696081&r2=696082&view=diff ============================================================================== --- openjpa/trunk/openjpa-project/pom.xml (original) +++ openjpa/trunk/openjpa-project/pom.xml Tue Sep 16 14:55:02 2008 @@ -379,11 +379,15 @@ <move todir="target/site/tempDocs/docs"> <fileset dir="target/site/tempDocs/apache-openjpa-${pom.version}/docs"/> </move> + <checksum> + <fileset dir="target/site/downloads/"> + <include name="*.zip"/> + </fileset> + </checksum> <scp todir="${nightly.user.name}:${nightly.password}@people.apache.org:/www/openjpa.apache.org/builds/latest/downloads" trust="true"> <fileset dir="target/site/downloads"/> </scp> - <scp todir="${nightly.user.name}:${nightly.password}@people.apache.org:/www/openjpa.apache.org/builds/latest/docs" trust="true"> <fileset dir="target/site/tempDocs/docs"/> From commits-return-3379-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Tue Sep 16 22:08:43 2008 Return-Path: <commits-return-3379-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 97953 invoked from network); 16 Sep 2008 22:08:43 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Sep 2008 22:08:43 -0000 Received: (qmail 60636 invoked by uid 500); 16 Sep 2008 22:08:40 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 60627 invoked by uid 500); 16 Sep 2008 22:08:40 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 60618 invoked by uid 99); 16 Sep 2008 22:08:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Sep 2008 15:08:40 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Sep 2008 22:07:49 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 6059C23889B9; Tue, 16 Sep 2008 15:08:22 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r696086 - /openjpa/branches/1.2.x/openjpa-project/pom.xml Date: Tue, 16 Sep 2008 22:08:22 -0000 To: commits@openjpa.apache.org From: mikedd@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080916220822.6059C23889B9@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mikedd Date: Tue Sep 16 15:08:21 2008 New Revision: 696086 URL: http://svn.apache.org/viewvc?rev=696086&view=rev Log: OPENJPA-726 merge revision 696082 to 1.2.x branch Modified: openjpa/branches/1.2.x/openjpa-project/pom.xml Modified: openjpa/branches/1.2.x/openjpa-project/pom.xml URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-project/pom.xml?rev=696086&r1=696085&r2=696086&view=diff ============================================================================== --- openjpa/branches/1.2.x/openjpa-project/pom.xml (original) +++ openjpa/branches/1.2.x/openjpa-project/pom.xml Tue Sep 16 15:08:21 2008 @@ -379,11 +379,15 @@ <move todir="target/site/tempDocs/docs"> <fileset dir="target/site/tempDocs/apache-openjpa-${pom.version}/docs"/> </move> + <checksum> + <fileset dir="target/site/downloads/"> + <include name="*.zip"/> + </fileset> + </checksum> <scp todir="${nightly.user.name}:${nightly.password}@people.apache.org:/www/openjpa.apache.org/builds/latest-1.2.x/downloads" trust="true"> <fileset dir="target/site/downloads"/> </scp> - <scp todir="${nightly.user.name}:${nightly.password}@people.apache.org:/www/openjpa.apache.org/builds/latest-1.2.x/docs" trust="true"> <fileset dir="target/site/tempDocs/docs"/> From commits-return-3380-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Tue Sep 16 22:09:14 2008 Return-Path: <commits-return-3380-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 98029 invoked from network); 16 Sep 2008 22:09:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Sep 2008 22:09:14 -0000 Received: (qmail 60830 invoked by uid 500); 16 Sep 2008 22:09:11 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 60812 invoked by uid 500); 16 Sep 2008 22:09:11 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 60803 invoked by uid 99); 16 Sep 2008 22:09:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Sep 2008 15:09:10 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Sep 2008 22:08:20 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 95E2923889B9; Tue, 16 Sep 2008 15:08:53 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r696087 - /openjpa/branches/1.0.x/openjpa-project/pom.xml Date: Tue, 16 Sep 2008 22:08:53 -0000 To: commits@openjpa.apache.org From: mikedd@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080916220853.95E2923889B9@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mikedd Date: Tue Sep 16 15:08:53 2008 New Revision: 696087 URL: http://svn.apache.org/viewvc?rev=696087&view=rev Log: OPENJPA-726 merge revision 696082 to 1.0.x branch Modified: openjpa/branches/1.0.x/openjpa-project/pom.xml Modified: openjpa/branches/1.0.x/openjpa-project/pom.xml URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-project/pom.xml?rev=696087&r1=696086&r2=696087&view=diff ============================================================================== --- openjpa/branches/1.0.x/openjpa-project/pom.xml (original) +++ openjpa/branches/1.0.x/openjpa-project/pom.xml Tue Sep 16 15:08:53 2008 @@ -352,11 +352,15 @@ <move todir="target/site/tempDocs/docs"> <fileset dir="target/site/tempDocs/apache-openjpa-${pom.version}/docs"/> </move> + <checksum> + <fileset dir="target/site/downloads/"> + <include name="*.zip"/> + </fileset> + </checksum> <scp todir="${nightly.user.name}:${nightly.password}@people.apache.org:/www/openjpa.apache.org/builds/latest-1.0.x/downloads" trust="true"> <fileset dir="target/site/downloads"/> </scp> - <scp todir="${nightly.user.name}:${nightly.password}@people.apache.org:/www/openjpa.apache.org/builds/latest-1.0.x/docs" trust="true"> <fileset dir="target/site/tempDocs/docs"/> From commits-return-3381-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Wed Sep 17 08:07:10 2008 Return-Path: <commits-return-3381-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 62588 invoked from network); 17 Sep 2008 08:07:10 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Sep 2008 08:07:10 -0000 Received: (qmail 9897 invoked by uid 500); 17 Sep 2008 08:07:07 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 9841 invoked by uid 500); 17 Sep 2008 08:07:07 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 9832 invoked by uid 99); 17 Sep 2008 08:07:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 01:07:07 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 08:06:16 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 37D00238896F; Wed, 17 Sep 2008 01:06:19 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r696193 - /openjpa/trunk/openjpa-all/pom.xml Date: Wed, 17 Sep 2008 08:06:19 -0000 To: commits@openjpa.apache.org From: mikedd@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080917080619.37D00238896F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mikedd Date: Wed Sep 17 01:06:18 2008 New Revision: 696193 URL: http://svn.apache.org/viewvc?rev=696193&view=rev Log: OPENJPA-713 exclude sources and javadoc from aggregate openjpa jar Modified: openjpa/trunk/openjpa-all/pom.xml Modified: openjpa/trunk/openjpa-all/pom.xml URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-all/pom.xml?rev=696193&r1=696192&r2=696193&view=diff ============================================================================== --- openjpa/trunk/openjpa-all/pom.xml (original) +++ openjpa/trunk/openjpa-all/pom.xml Wed Sep 17 01:06:18 2008 @@ -53,6 +53,8 @@ <fileset dir="${basedir}/.."> <include name="*/target/openjpa-*.jar" /> <exclude name="*/target/openjpa-examples-*.jar" /> + <exclude name="**/*-sources.jar"/> + <exclude name="**/*-javadoc.jar"/> </fileset> </unjar> From commits-return-3382-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Wed Sep 17 08:16:52 2008 Return-Path: <commits-return-3382-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 65569 invoked from network); 17 Sep 2008 08:16:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Sep 2008 08:16:52 -0000 Received: (qmail 20018 invoked by uid 500); 17 Sep 2008 08:16:48 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 20005 invoked by uid 500); 17 Sep 2008 08:16:48 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 19996 invoked by uid 99); 17 Sep 2008 08:16:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 01:16:48 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 08:15:58 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 37837238896F; Wed, 17 Sep 2008 01:16:01 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r696194 - /openjpa/branches/1.2.x/openjpa-all/pom.xml Date: Wed, 17 Sep 2008 08:16:00 -0000 To: commits@openjpa.apache.org From: mikedd@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080917081601.37837238896F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mikedd Date: Wed Sep 17 01:16:00 2008 New Revision: 696194 URL: http://svn.apache.org/viewvc?rev=696194&view=rev Log: OPENJPA-713 exclude sources and javadoc from aggregate openjpa jar (merge revision 696193) Modified: openjpa/branches/1.2.x/openjpa-all/pom.xml Modified: openjpa/branches/1.2.x/openjpa-all/pom.xml URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-all/pom.xml?rev=696194&r1=696193&r2=696194&view=diff ============================================================================== --- openjpa/branches/1.2.x/openjpa-all/pom.xml (original) +++ openjpa/branches/1.2.x/openjpa-all/pom.xml Wed Sep 17 01:16:00 2008 @@ -53,6 +53,8 @@ <fileset dir="${basedir}/.."> <include name="*/target/openjpa-*.jar" /> <exclude name="*/target/openjpa-examples-*.jar" /> + <exclude name="**/*-sources.jar"/> + <exclude name="**/*-javadoc.jar"/> </fileset> </unjar> From commits-return-3383-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Wed Sep 17 08:17:23 2008 Return-Path: <commits-return-3383-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 65691 invoked from network); 17 Sep 2008 08:17:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Sep 2008 08:17:23 -0000 Received: (qmail 22422 invoked by uid 500); 17 Sep 2008 08:17:19 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 22412 invoked by uid 500); 17 Sep 2008 08:17:19 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 22403 invoked by uid 99); 17 Sep 2008 08:17:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 01:17:19 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 08:16:29 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 5032D23889E9; Wed, 17 Sep 2008 01:16:32 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r696195 - /openjpa/branches/1.0.x/openjpa-all/pom.xml Date: Wed, 17 Sep 2008 08:16:32 -0000 To: commits@openjpa.apache.org From: mikedd@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080917081632.5032D23889E9@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mikedd Date: Wed Sep 17 01:16:31 2008 New Revision: 696195 URL: http://svn.apache.org/viewvc?rev=696195&view=rev Log: OPENJPA-713 exclude sources and javadoc from aggregate openjpa jar (merge revision 696193) Modified: openjpa/branches/1.0.x/openjpa-all/pom.xml Modified: openjpa/branches/1.0.x/openjpa-all/pom.xml URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-all/pom.xml?rev=696195&r1=696194&r2=696195&view=diff ============================================================================== --- openjpa/branches/1.0.x/openjpa-all/pom.xml (original) +++ openjpa/branches/1.0.x/openjpa-all/pom.xml Wed Sep 17 01:16:31 2008 @@ -61,6 +61,8 @@ <fileset dir="${basedir}/.."> <include name="*/target/openjpa-*.jar" /> <exclude name="*/target/openjpa-examples-*.jar" /> + <exclude name="**/*-sources.jar"/> + <exclude name="**/*-javadoc.jar"/> </fileset> </unjar> From commits-return-3384-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Wed Sep 17 15:31:04 2008 Return-Path: <commits-return-3384-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 33906 invoked from network); 17 Sep 2008 15:31:04 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Sep 2008 15:31:04 -0000 Received: (qmail 70911 invoked by uid 500); 17 Sep 2008 15:31:01 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 70897 invoked by uid 500); 17 Sep 2008 15:31:01 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 70888 invoked by uid 99); 17 Sep 2008 15:31:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 08:31:01 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 15:30:11 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id A0011238896B; Wed, 17 Sep 2008 08:30:43 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r696343 - /openjpa/branches/1.0.x/openjpa-project/src/doc/manual/jpa_overview_mapping.xml Date: Wed, 17 Sep 2008 15:30:43 -0000 To: commits@openjpa.apache.org From: mikedd@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080917153043.A0011238896B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mikedd Date: Wed Sep 17 08:30:41 2008 New Revision: 696343 URL: http://svn.apache.org/viewvc?rev=696343&view=rev Log: OPENJPA-727 remove reference to missing image file Modified: openjpa/branches/1.0.x/openjpa-project/src/doc/manual/jpa_overview_mapping.xml Modified: openjpa/branches/1.0.x/openjpa-project/src/doc/manual/jpa_overview_mapping.xml URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-project/src/doc/manual/jpa_overview_mapping.xml?rev=696343&r1=696342&r2=696343&view=diff ============================================================================== --- openjpa/branches/1.0.x/openjpa-project/src/doc/manual/jpa_overview_mapping.xml (original) +++ openjpa/branches/1.0.x/openjpa-project/src/doc/manual/jpa_overview_mapping.xml Wed Sep 17 08:30:41 2008 @@ -184,23 +184,11 @@ to other tables. </para> <para> -The example below maps classes to tables according to the following diagram. The +The example below maps classes to tables to separate schemas. The <literal>CONTRACT</literal>, <literal>SUB</literal>, and <literal>LINE_ITEM </literal> tables are in the <literal>CNTRCT</literal> schema; all other tables are in the default schema. </para> - <mediaobject> - <imageobject> - <!-- PNG image data, 513 x 410 (see README) --> - <imagedata fileref="img/mapping-tables.png" width="341px"/> - - </imageobject> - </mediaobject> - <para> -Note that the diagram does not include our model's <classname>Document -</classname> and <classname>Address</classname> classes. Mapped superclasses and -embeddable classes are never mapped to tables. - </para> <example id="jpa_overview_mapping_classex"> <title> Mapping Classes From commits-return-3385-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Wed Sep 17 15:51:23 2008 Return-Path: <commits-return-3385-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 52731 invoked from network); 17 Sep 2008 15:51:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Sep 2008 15:51:23 -0000 Received: (qmail 8724 invoked by uid 500); 17 Sep 2008 15:51:20 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 8665 invoked by uid 500); 17 Sep 2008 15:51:20 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 8656 invoked by uid 99); 17 Sep 2008 15:51:20 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 08:51:20 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 15:50:30 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id B2DB5238896D; Wed, 17 Sep 2008 08:50:32 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r696346 - /openjpa/branches/1.2.x/openjpa-project/src/doc/manual/jpa_overview_mapping.xml Date: Wed, 17 Sep 2008 15:50:32 -0000 To: commits@openjpa.apache.org From: mikedd@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080917155032.B2DB5238896D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mikedd Date: Wed Sep 17 08:50:31 2008 New Revision: 696346 URL: http://svn.apache.org/viewvc?rev=696346&view=rev Log: OPENJPA-727 merge revision 696343 to 1.2.x. Removing reference to missing image file. Modified: openjpa/branches/1.2.x/openjpa-project/src/doc/manual/jpa_overview_mapping.xml Modified: openjpa/branches/1.2.x/openjpa-project/src/doc/manual/jpa_overview_mapping.xml URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-project/src/doc/manual/jpa_overview_mapping.xml?rev=696346&r1=696345&r2=696346&view=diff ============================================================================== --- openjpa/branches/1.2.x/openjpa-project/src/doc/manual/jpa_overview_mapping.xml (original) +++ openjpa/branches/1.2.x/openjpa-project/src/doc/manual/jpa_overview_mapping.xml Wed Sep 17 08:50:31 2008 @@ -184,23 +184,11 @@ to other tables. </para> <para> -The example below maps classes to tables according to the following diagram. The +The example below maps classes to tables to separate schemas. The <literal>CONTRACT</literal>, <literal>SUB</literal>, and <literal>LINE_ITEM </literal> tables are in the <literal>CNTRCT</literal> schema; all other tables are in the default schema. </para> - <mediaobject> - <imageobject> - <!-- PNG image data, 513 x 410 (see README) --> - <imagedata fileref="img/mapping-tables.png" width="341px"/> - - </imageobject> - </mediaobject> - <para> -Note that the diagram does not include our model's <classname>Document -</classname> and <classname>Address</classname> classes. Mapped superclasses and -embeddable classes are never mapped to tables. - </para> <example id="jpa_overview_mapping_classex"> <title> Mapping Classes From commits-return-3386-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Wed Sep 17 15:52:30 2008 Return-Path: <commits-return-3386-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 53807 invoked from network); 17 Sep 2008 15:52:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Sep 2008 15:52:30 -0000 Received: (qmail 12717 invoked by uid 500); 17 Sep 2008 15:52:27 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 12706 invoked by uid 500); 17 Sep 2008 15:52:27 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 12694 invoked by uid 99); 17 Sep 2008 15:52:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 08:52:27 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 15:51:36 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 8CC24238896F; Wed, 17 Sep 2008 08:51:39 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r696347 - /openjpa/trunk/openjpa-project/src/doc/manual/jpa_overview_mapping.xml Date: Wed, 17 Sep 2008 15:51:39 -0000 To: commits@openjpa.apache.org From: mikedd@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080917155139.8CC24238896F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mikedd Date: Wed Sep 17 08:51:38 2008 New Revision: 696347 URL: http://svn.apache.org/viewvc?rev=696347&view=rev Log: OPENJPA-727 merge revision 696343 to trunk. Removing reference to missing image file. Modified: openjpa/trunk/openjpa-project/src/doc/manual/jpa_overview_mapping.xml Modified: openjpa/trunk/openjpa-project/src/doc/manual/jpa_overview_mapping.xml URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/src/doc/manual/jpa_overview_mapping.xml?rev=696347&r1=696346&r2=696347&view=diff ============================================================================== --- openjpa/trunk/openjpa-project/src/doc/manual/jpa_overview_mapping.xml (original) +++ openjpa/trunk/openjpa-project/src/doc/manual/jpa_overview_mapping.xml Wed Sep 17 08:51:38 2008 @@ -184,23 +184,11 @@ to other tables. </para> <para> -The example below maps classes to tables according to the following diagram. The +The example below maps classes to tables to separate schemas. The <literal>CONTRACT</literal>, <literal>SUB</literal>, and <literal>LINE_ITEM </literal> tables are in the <literal>CNTRCT</literal> schema; all other tables are in the default schema. </para> - <mediaobject> - <imageobject> - <!-- PNG image data, 513 x 410 (see README) --> - <imagedata fileref="img/mapping-tables.png" width="341px"/> - - </imageobject> - </mediaobject> - <para> -Note that the diagram does not include our model's <classname>Document -</classname> and <classname>Address</classname> classes. Mapped superclasses and -embeddable classes are never mapped to tables. - </para> <example id="jpa_overview_mapping_classex"> <title> Mapping Classes From commits-return-3387-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Wed Sep 17 16:05:40 2008 Return-Path: <commits-return-3387-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 63621 invoked from network); 17 Sep 2008 16:05:40 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Sep 2008 16:05:40 -0000 Received: (qmail 39395 invoked by uid 500); 17 Sep 2008 16:05:37 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 39385 invoked by uid 500); 17 Sep 2008 16:05:37 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 39376 invoked by uid 99); 17 Sep 2008 16:05:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 09:05:37 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 16:04:39 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 37098238896F; Wed, 17 Sep 2008 09:05:12 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r696350 - in /openjpa/trunk/openjpa-project/src/doc/manual: jpa_overview_mapping.xml jpa_overview_query.xml ref_guide_dbsetup.xml ref_guide_pc.xml ref_guide_remote.xml ref_guide_slice.xml supported_databases.xml Date: Wed, 17 Sep 2008 16:05:11 -0000 To: commits@openjpa.apache.org From: mikedd@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080917160512.37098238896F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mikedd Date: Wed Sep 17 09:05:10 2008 New Revision: 696350 URL: http://svn.apache.org/viewvc?rev=696350&view=rev Log: OPENJPA-724 committing patch provided by Milosz Tylenda. Modified: openjpa/trunk/openjpa-project/src/doc/manual/jpa_overview_mapping.xml openjpa/trunk/openjpa-project/src/doc/manual/jpa_overview_query.xml openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_pc.xml openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_remote.xml openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_slice.xml openjpa/trunk/openjpa-project/src/doc/manual/supported_databases.xml Modified: openjpa/trunk/openjpa-project/src/doc/manual/jpa_overview_mapping.xml URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/src/doc/manual/jpa_overview_mapping.xml?rev=696350&r1=696349&r2=696350&view=diff ============================================================================== --- openjpa/trunk/openjpa-project/src/doc/manual/jpa_overview_mapping.xml (original) +++ openjpa/trunk/openjpa-project/src/doc/manual/jpa_overview_mapping.xml Wed Sep 17 09:05:10 2008 @@ -4115,6 +4115,7 @@ <join-table name="MAG_ARTS"> <join-column name="MAG_ISBN" referenced-column-name="ISBN"/> <join-column name="MAG_TITLE" referenced-column-name="TITLE"/> + <inverse-join-column name="ART_ID" referenced-column-name="ID"/> </join-table> </one-to-many> ... @@ -4124,12 +4125,15 @@ <table name="ART"/> <attributes> <id name="id"/> - <many-to-many name="articles"> + <many-to-many name="authors"> <order-by>lastName, firstName</order-by> <join-table name="ART_AUTHS"> <join-column name="ART_ID" referenced-column-name="ID"/> <inverse-join-column name="AUTH_ID" referenced-column-name="AID"/> </join-table> + <cascade> + <cascade-persist/> + </cascade> </many-to-many> ... </attributes> @@ -4170,7 +4174,7 @@ <itemizedlist> <listitem> <para> -<literal>Magazine.publisher</literal> and <literal>Company.ags</literal>. +<literal>Magazine.publisher</literal> and <literal>Company.mags</literal>. </para> </listitem> <listitem> @@ -4264,9 +4268,9 @@ ... <one-to-many name="items"> <map-key name="num"> - <join-table name="MAG_ARTS"> - <join-column name="MAG_ISBN" referenced-column-name="ISBN"/> - <join-column name="MAG_TITLE" referenced-column-name="TITLE"/> + <join-table name="SUB_ITEMS" schema="CNTRCT"> + <join-column name="SUB_ID"/> + <inverse-join-column name="ITEM_ID"/> </join-table> <cascade> <cascade-persist/> Modified: openjpa/trunk/openjpa-project/src/doc/manual/jpa_overview_query.xml URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/src/doc/manual/jpa_overview_query.xml?rev=696350&r1=696349&r2=696350&view=diff ============================================================================== --- openjpa/trunk/openjpa-project/src/doc/manual/jpa_overview_query.xml (original) +++ openjpa/trunk/openjpa-project/src/doc/manual/jpa_overview_query.xml Wed Sep 17 09:05:10 2008 @@ -130,7 +130,7 @@ member names are not. For example, the expression above could also be expressed as: </para> -<programlisting>SELECT x FROM Magazine x WHERE x.title = 'JDJ'</programlisting> +<programlisting>select x from Magazine x where x.title = 'JDJ'</programlisting> <para> But it could not be expressed as: </para> @@ -175,18 +175,18 @@ example: </para> <programlisting> -SELECT x FROM Magazine x WHERE (x.price > 3.00 AND x.price <= 5.00) OR x.price = 7.00 +SELECT x FROM Magazine x WHERE (x.price > 3.00 AND x.price <= 5.00) OR x.price < 7.00 </programlisting> <para> -This expression would match magazines whose price is 4.00, 5.00, or 7.00, but -not 6.00. Alternately: +This expression would match magazines whose price is less than 7.00. +Alternately: </para> <programlisting> -SELECT x FROM Magazine x WHERE x.price > 3.00 AND (x.price <= 5.00 OR x.price = 7.00) +SELECT x FROM Magazine x WHERE x.price > 3.00 AND (x.price <= 5.00 OR x.price < 7.00) </programlisting> <para> -This expression will magazines whose price is 5.00 or 7.00, but not 4.00 or -6.00. +This expression would match magazines whose price is 4.00, 5.00 or 6.00, but not +1.00, 2.00 or 3.00. </para> <para> JPQL also includes the following conditionals: @@ -2247,7 +2247,7 @@ <listitem> <para> <programlisting>address.phone NOT LIKE '12%3'</programlisting> is false for -'123' and '12993' and true for '1234' If the value of the string_expression or +'123' and '12993' and true for '1234'. If the value of the string_expression or pattern_value is <literal>NULL</literal> or unknown, the value of the <literal> LIKE</literal> expression is unknown. If the escape_character is specified and is <literal>NULL</literal>, the value of the <literal>LIKE</literal> expression @@ -2301,8 +2301,10 @@ JPQL Collection Member Expressions -The use of the comparison collection_member_expression is as follows: syntax for -the operator MEMBER OF in an +The use of the comparison collection_member_expression is as follows: + + + collection_member_expression ::= entity_expression [NOT] MEMBER [OF] collection_valued_path_expression @@ -2331,6 +2333,9 @@ expression is NULL or unknown, the value of the collection member expression is unknown. + +The use of the reserved word OF is optional in this expression. +
@@ -2346,9 +2351,6 @@ </itemizedlist> </para> <para> -The use of the reserved word OF is optional in this expression. - </para> - <para> Example: <programlisting>SELECT DISTINCT auth FROM Author auth WHERE EXISTS (SELECT spouseAuthor FROM Author spouseAuthor WHERE spouseAuthor = auth.spouse) @@ -2802,7 +2804,10 @@ <para> The argument to an aggregate function may be preceded by the keyword <literal> DISTINCT</literal> to specify that duplicate values are to be eliminated before -the aggregate function is applied. Null values are eliminated before the +the aggregate function is applied. +It is legal to specify <literal>DISTINCT</literal> with <literal>MAX</literal> +or <literal>MIN</literal>, but it does not affect the result. +Null values are eliminated before the aggregate function is applied, regardless of whether the keyword <literal> DISTINCT</literal> is specified. </para> @@ -2813,7 +2818,7 @@ <para> The following query returns the average price of all magazines: <programlisting>SELECT AVG(mag.price) FROM Magazine mag</programlisting> The -following query returns the sum total cost of all the prices from all the +following query returns the sum of all the prices from all the magazines published by 'Larry': <programlisting>SELECT SUM(mag.price) FROM Publisher pub JOIN pub.magazines mag WHERE pub.firstName = 'Larry' </programlisting> The following query returns the total number of magazines: <programlisting>SELECT COUNT(mag) FROM Magazine mag</programlisting> @@ -2843,16 +2848,12 @@ </itemizedlist> </para> <para> -It is legal to specify <literal>DISTINCT</literal> with <literal>MAX</literal> -or <literal>MIN</literal>, but it does not affect the result. - </para> - <para> When the <literal>ORDER BY</literal> clause is used in a query, each element of the <literal>SELECT</literal> clause of the query must be one of the following: an identification variable x, optionally denoted as <literal>OBJECT(x)</literal> , a single_valued_association_path_expression, or a state_field_path_expression. For example: <programlisting> -SELECT pub FROM Publisher pub JOIN pub.magazines mag ORDER BY o.revenue, o.name +SELECT pub FROM Publisher pub ORDER BY pub.revenue, pub.name </programlisting> If more than one orderby_item is specified, the left-to-right sequence of the orderby_item elements determines the precedence, whereby the leftmost orderby_item has highest precedence. The keyword <literal>ASC</literal> Modified: openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml?rev=696350&r1=696349&r2=696350&view=diff ============================================================================== --- openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml (original) +++ openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml Wed Sep 17 09:05:10 2008 @@ -3471,7 +3471,7 @@ </para> <para> The <link linkend="openjpa.jdbc.DBDictionary"><literal> -openjpa.jdbc.DBDictionary</literal></link> plugin accepts the the <literal> +openjpa.jdbc.DBDictionary</literal></link> plugin accepts the <literal> JoinSyntax</literal> property to set the system's default syntax. The available values are: </para> Modified: openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_pc.xml URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_pc.xml?rev=696350&r1=696349&r2=696350&view=diff ============================================================================== --- openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_pc.xml (original) +++ openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_pc.xml Wed Sep 17 09:05:10 2008 @@ -634,9 +634,9 @@ Finding an Entity with an Entity Identity Field -public Delivery createDelivery(EntityManager em, Order order) { +public Delivery createDelivery(Order order) { Delivery delivery = new Delivery(); - delivery.setId(o); + delivery.setId(order); delivery.setDelivered(new Date()); return delivery; } Modified: openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_remote.xml URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_remote.xml?rev=696350&r1=696349&r2=696350&view=diff ============================================================================== --- openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_remote.xml (original) +++ openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_remote.xml Wed Sep 17 09:05:10 2008 @@ -570,6 +570,15 @@ To configure a factory to use the JMS provider, your properties might look like the following: + + + JMS Remote Commit Provider Configuration + + +<property name="openjpa.RemoteCommitProvider" + value="jms(ExceptionReconnectAttempts=5)"/> + + Because of the nature of JMS, it is important that you invoke @@ -631,7 +640,7 @@ NumBroadcastThreads: The number of threads to create for the purpose of transmitting events to peers. You sould increase this value as the number of concurrent transactions increases. The maximum number of concurrent -transactions is a function of the size of the connection pool. See the the +transactions is a function of the size of the connection pool. See the MaxActive property of openjpa.ConnectionFactoryProperties in . Setting a value of 0 will @@ -709,6 +718,15 @@ To transmit persisted object ids in our remote commit events using the JMS provider, we modify the previous example as follows: + + + JMS Remote Commit Provider transmitting Persisted Object Ids + + +<property name="openjpa.RemoteCommitProvider" + value="jms(ExceptionReconnectAttempts=5, TransmitPersistedObjectIds=true)"/> + +
Modified: openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_slice.xml URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_slice.xml?rev=696350&r1=696349&r2=696350&view=diff ============================================================================== --- openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_slice.xml (original) +++ openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_slice.xml Wed Sep 17 09:05:10 2008 @@ -174,13 +174,13 @@
Distributed Transaction The database slices participate in a global transaction provided - each slice is configured with a XA-complaint JDBC driver, even + each slice is configured with a XA-compliant JDBC driver, even when the persistence unit is configured for RESOURCE_LOCAL transaction. - If any of the configured slices is not XA-complaint and + If any of the configured slices is not XA-compliant and the persistence unit is configured for RESOURCE_LOCAL transaction then each slice is committed without any two-phase commit protocol. If commit on any slice fails, then atomic nature of @@ -512,13 +512,13 @@ or rolls back transaction on individual slices using a two-phase commit protocol. The prerequisite to use this scheme is, of course, that all the slices must be configured to use - XA-complaint JDBC driver. + XA-compliant JDBC driver. The jndi policy employs a Transaction Manager by looking up the JNDI context. The prerequisite to use this transaction manager is, of course, that all the slices must be configured to use - XA-complaint JDBC driver. + XA-compliant JDBC driver. This JNDI based policy is not available currently.
Modified: openjpa/trunk/openjpa-project/src/doc/manual/supported_databases.xml URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/src/doc/manual/supported_databases.xml?rev=696350&r1=696349&r2=696350&view=diff ============================================================================== --- openjpa/trunk/openjpa-project/src/doc/manual/supported_databases.xml (original) +++ openjpa/trunk/openjpa-project/src/doc/manual/supported_databases.xml Wed Sep 17 09:05:10 2008 @@ -839,7 +839,7 @@ Oracle has support for "query hints", which are formatted comments embedded in SQL that provide some hint for how the query should be executed. These hints are usually designed to provide suggestions to the Oracle query optimizer for how to -efficiently perform a certainly query, and aren't typically needed for any but +efficiently perform a certain query, and aren't typically needed for any but the most intensive queries. From commits-return-3388-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Wed Sep 17 16:20:14 2008 Return-Path: Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 70003 invoked from network); 17 Sep 2008 16:20:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Sep 2008 16:20:14 -0000 Received: (qmail 73375 invoked by uid 500); 17 Sep 2008 16:20:11 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 73344 invoked by uid 500); 17 Sep 2008 16:20:11 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 73335 invoked by uid 99); 17 Sep 2008 16:20:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 09:20:11 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 16:19:13 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 525822388A10; Wed, 17 Sep 2008 09:19:16 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r696360 - in /openjpa/branches/1.2.x/openjpa-project/src/doc/manual: jpa_overview_mapping.xml jpa_overview_query.xml ref_guide_dbsetup.xml ref_guide_pc.xml ref_guide_remote.xml ref_guide_slice.xml supported_databases.xml Date: Wed, 17 Sep 2008 16:19:15 -0000 To: commits@openjpa.apache.org From: mikedd@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080917161916.525822388A10@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mikedd Date: Wed Sep 17 09:19:15 2008 New Revision: 696360 URL: http://svn.apache.org/viewvc?rev=696360&view=rev Log: OPENJPA-724 committing patch provided by Milosz Tylenda. Merging revision 696350 to 1.2.x branch Modified: openjpa/branches/1.2.x/openjpa-project/src/doc/manual/jpa_overview_mapping.xml openjpa/branches/1.2.x/openjpa-project/src/doc/manual/jpa_overview_query.xml openjpa/branches/1.2.x/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml openjpa/branches/1.2.x/openjpa-project/src/doc/manual/ref_guide_pc.xml openjpa/branches/1.2.x/openjpa-project/src/doc/manual/ref_guide_remote.xml openjpa/branches/1.2.x/openjpa-project/src/doc/manual/ref_guide_slice.xml openjpa/branches/1.2.x/openjpa-project/src/doc/manual/supported_databases.xml Modified: openjpa/branches/1.2.x/openjpa-project/src/doc/manual/jpa_overview_mapping.xml URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-project/src/doc/manual/jpa_overview_mapping.xml?rev=696360&r1=696359&r2=696360&view=diff ============================================================================== --- openjpa/branches/1.2.x/openjpa-project/src/doc/manual/jpa_overview_mapping.xml (original) +++ openjpa/branches/1.2.x/openjpa-project/src/doc/manual/jpa_overview_mapping.xml Wed Sep 17 09:19:15 2008 @@ -4115,6 +4115,7 @@ <join-table name="MAG_ARTS"> <join-column name="MAG_ISBN" referenced-column-name="ISBN"/> <join-column name="MAG_TITLE" referenced-column-name="TITLE"/> + <inverse-join-column name="ART_ID" referenced-column-name="ID"/> </join-table> </one-to-many> ... @@ -4124,12 +4125,15 @@ <table name="ART"/> <attributes> <id name="id"/> - <many-to-many name="articles"> + <many-to-many name="authors"> <order-by>lastName, firstName</order-by> <join-table name="ART_AUTHS"> <join-column name="ART_ID" referenced-column-name="ID"/> <inverse-join-column name="AUTH_ID" referenced-column-name="AID"/> </join-table> + <cascade> + <cascade-persist/> + </cascade> </many-to-many> ... </attributes> @@ -4170,7 +4174,7 @@ -Magazine.publisher and Company.ags. +Magazine.publisher and Company.mags. @@ -4264,9 +4268,9 @@ ... <one-to-many name="items"> <map-key name="num"> - <join-table name="MAG_ARTS"> - <join-column name="MAG_ISBN" referenced-column-name="ISBN"/> - <join-column name="MAG_TITLE" referenced-column-name="TITLE"/> + <join-table name="SUB_ITEMS" schema="CNTRCT"> + <join-column name="SUB_ID"/> + <inverse-join-column name="ITEM_ID"/> </join-table> <cascade> <cascade-persist/> Modified: openjpa/branches/1.2.x/openjpa-project/src/doc/manual/jpa_overview_query.xml URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-project/src/doc/manual/jpa_overview_query.xml?rev=696360&r1=696359&r2=696360&view=diff ============================================================================== --- openjpa/branches/1.2.x/openjpa-project/src/doc/manual/jpa_overview_query.xml (original) +++ openjpa/branches/1.2.x/openjpa-project/src/doc/manual/jpa_overview_query.xml Wed Sep 17 09:19:15 2008 @@ -130,7 +130,7 @@ member names are not. For example, the expression above could also be expressed as: -SELECT x FROM Magazine x WHERE x.title = 'JDJ' +select x from Magazine x where x.title = 'JDJ' But it could not be expressed as: @@ -175,18 +175,18 @@ example: -SELECT x FROM Magazine x WHERE (x.price > 3.00 AND x.price <= 5.00) OR x.price = 7.00 +SELECT x FROM Magazine x WHERE (x.price > 3.00 AND x.price <= 5.00) OR x.price < 7.00 -This expression would match magazines whose price is 4.00, 5.00, or 7.00, but -not 6.00. Alternately: +This expression would match magazines whose price is less than 7.00. +Alternately: -SELECT x FROM Magazine x WHERE x.price > 3.00 AND (x.price <= 5.00 OR x.price = 7.00) +SELECT x FROM Magazine x WHERE x.price > 3.00 AND (x.price <= 5.00 OR x.price < 7.00) -This expression will magazines whose price is 5.00 or 7.00, but not 4.00 or -6.00. +This expression would match magazines whose price is 4.00, 5.00 or 6.00, but not +1.00, 2.00 or 3.00. JPQL also includes the following conditionals: @@ -2247,7 +2247,7 @@ address.phone NOT LIKE '12%3' is false for -'123' and '12993' and true for '1234' If the value of the string_expression or +'123' and '12993' and true for '1234'. If the value of the string_expression or pattern_value is NULL or unknown, the value of the LIKE expression is unknown. If the escape_character is specified and is NULL, the value of the LIKE expression @@ -2301,8 +2301,10 @@ JPQL Collection Member Expressions -The use of the comparison collection_member_expression is as follows: syntax for -the operator MEMBER OF in an +The use of the comparison collection_member_expression is as follows: + + + collection_member_expression ::= entity_expression [NOT] MEMBER [OF] collection_valued_path_expression @@ -2331,6 +2333,9 @@ expression is NULL or unknown, the value of the collection member expression is unknown. + +The use of the reserved word OF is optional in this expression. +
@@ -2346,9 +2351,6 @@ </itemizedlist> </para> <para> -The use of the reserved word OF is optional in this expression. - </para> - <para> Example: <programlisting>SELECT DISTINCT auth FROM Author auth WHERE EXISTS (SELECT spouseAuthor FROM Author spouseAuthor WHERE spouseAuthor = auth.spouse) @@ -2802,7 +2804,10 @@ <para> The argument to an aggregate function may be preceded by the keyword <literal> DISTINCT</literal> to specify that duplicate values are to be eliminated before -the aggregate function is applied. Null values are eliminated before the +the aggregate function is applied. +It is legal to specify <literal>DISTINCT</literal> with <literal>MAX</literal> +or <literal>MIN</literal>, but it does not affect the result. +Null values are eliminated before the aggregate function is applied, regardless of whether the keyword <literal> DISTINCT</literal> is specified. </para> @@ -2813,7 +2818,7 @@ <para> The following query returns the average price of all magazines: <programlisting>SELECT AVG(mag.price) FROM Magazine mag</programlisting> The -following query returns the sum total cost of all the prices from all the +following query returns the sum of all the prices from all the magazines published by 'Larry': <programlisting>SELECT SUM(mag.price) FROM Publisher pub JOIN pub.magazines mag pub.firstName = 'Larry' </programlisting> The following query returns the total number of magazines: <programlisting>SELECT COUNT(mag) FROM Magazine mag</programlisting> @@ -2843,16 +2848,12 @@ </itemizedlist> </para> <para> -It is legal to specify <literal>DISTINCT</literal> with <literal>MAX</literal> -or <literal>MIN</literal>, but it does not affect the result. - </para> - <para> When the <literal>ORDER BY</literal> clause is used in a query, each element of the <literal>SELECT</literal> clause of the query must be one of the following: an identification variable x, optionally denoted as <literal>OBJECT(x)</literal> , a single_valued_association_path_expression, or a state_field_path_expression. For example: <programlisting> -SELECT pub FROM Publisher pub JOIN pub.magazines mag ORDER BY o.revenue, o.name +SELECT pub FROM Publisher pub ORDER BY pub.revenue, pub.name </programlisting> If more than one orderby_item is specified, the left-to-right sequence of the orderby_item elements determines the precedence, whereby the leftmost orderby_item has highest precedence. The keyword <literal>ASC</literal> Modified: openjpa/branches/1.2.x/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml?rev=696360&r1=696359&r2=696360&view=diff ============================================================================== --- openjpa/branches/1.2.x/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml (original) +++ openjpa/branches/1.2.x/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml Wed Sep 17 09:19:15 2008 @@ -3471,7 +3471,7 @@ </para> <para> The <link linkend="openjpa.jdbc.DBDictionary"><literal> -openjpa.jdbc.DBDictionary</literal></link> plugin accepts the the <literal> +openjpa.jdbc.DBDictionary</literal></link> plugin accepts the <literal> JoinSyntax</literal> property to set the system's default syntax. The available values are: </para> Modified: openjpa/branches/1.2.x/openjpa-project/src/doc/manual/ref_guide_pc.xml URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-project/src/doc/manual/ref_guide_pc.xml?rev=696360&r1=696359&r2=696360&view=diff ============================================================================== --- openjpa/branches/1.2.x/openjpa-project/src/doc/manual/ref_guide_pc.xml (original) +++ openjpa/branches/1.2.x/openjpa-project/src/doc/manual/ref_guide_pc.xml Wed Sep 17 09:19:15 2008 @@ -634,9 +634,9 @@ Finding an Entity with an Entity Identity Field -public Delivery createDelivery(EntityManager em, Order order) { +public Delivery createDelivery(Order order) { Delivery delivery = new Delivery(); - delivery.setId(o); + delivery.setId(order); delivery.setDelivered(new Date()); return delivery; } Modified: openjpa/branches/1.2.x/openjpa-project/src/doc/manual/ref_guide_remote.xml URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-project/src/doc/manual/ref_guide_remote.xml?rev=696360&r1=696359&r2=696360&view=diff ============================================================================== --- openjpa/branches/1.2.x/openjpa-project/src/doc/manual/ref_guide_remote.xml (original) +++ openjpa/branches/1.2.x/openjpa-project/src/doc/manual/ref_guide_remote.xml Wed Sep 17 09:19:15 2008 @@ -570,6 +570,15 @@ To configure a factory to use the JMS provider, your properties might look like the following: + + + JMS Remote Commit Provider Configuration + + +<property name="openjpa.RemoteCommitProvider" + value="jms(ExceptionReconnectAttempts=5)"/> + + Because of the nature of JMS, it is important that you invoke @@ -631,7 +640,7 @@ NumBroadcastThreads: The number of threads to create for the purpose of transmitting events to peers. You sould increase this value as the number of concurrent transactions increases. The maximum number of concurrent -transactions is a function of the size of the connection pool. See the the +transactions is a function of the size of the connection pool. See the MaxActive property of openjpa.ConnectionFactoryProperties in . Setting a value of 0 will @@ -709,6 +718,15 @@ To transmit persisted object ids in our remote commit events using the JMS provider, we modify the previous example as follows: + + + JMS Remote Commit Provider transmitting Persisted Object Ids + + +<property name="openjpa.RemoteCommitProvider" + value="jms(ExceptionReconnectAttempts=5, TransmitPersistedObjectIds=true)"/> + +
Modified: openjpa/branches/1.2.x/openjpa-project/src/doc/manual/ref_guide_slice.xml URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-project/src/doc/manual/ref_guide_slice.xml?rev=696360&r1=696359&r2=696360&view=diff ============================================================================== --- openjpa/branches/1.2.x/openjpa-project/src/doc/manual/ref_guide_slice.xml (original) +++ openjpa/branches/1.2.x/openjpa-project/src/doc/manual/ref_guide_slice.xml Wed Sep 17 09:19:15 2008 @@ -174,13 +174,13 @@
Distributed Transaction The database slices participate in a global transaction provided - each slice is configured with a XA-complaint JDBC driver, even + each slice is configured with a XA-compliant JDBC driver, even when the persistence unit is configured for RESOURCE_LOCAL transaction. - If any of the configured slices is not XA-complaint and + If any of the configured slices is not XA-compliant and the persistence unit is configured for RESOURCE_LOCAL transaction then each slice is committed without any two-phase commit protocol. If commit on any slice fails, then atomic nature of @@ -512,13 +512,13 @@ or rolls back transaction on individual slices using a two-phase commit protocol. The prerequisite to use this scheme is, of course, that all the slices must be configured to use - XA-complaint JDBC driver. + XA-compliant JDBC driver. The jndi policy employs a Transaction Manager by looking up the JNDI context. The prerequisite to use this transaction manager is, of course, that all the slices must be configured to use - XA-complaint JDBC driver. + XA-compliant JDBC driver. This JNDI based policy is not available currently.
Modified: openjpa/branches/1.2.x/openjpa-project/src/doc/manual/supported_databases.xml URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-project/src/doc/manual/supported_databases.xml?rev=696360&r1=696359&r2=696360&view=diff ============================================================================== --- openjpa/branches/1.2.x/openjpa-project/src/doc/manual/supported_databases.xml (original) +++ openjpa/branches/1.2.x/openjpa-project/src/doc/manual/supported_databases.xml Wed Sep 17 09:19:15 2008 @@ -839,7 +839,7 @@ Oracle has support for "query hints", which are formatted comments embedded in SQL that provide some hint for how the query should be executed. These hints are usually designed to provide suggestions to the Oracle query optimizer for how to -efficiently perform a certainly query, and aren't typically needed for any but +efficiently perform a certain query, and aren't typically needed for any but the most intensive queries. From commits-return-3389-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Wed Sep 17 16:22:36 2008 Return-Path: Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 71753 invoked from network); 17 Sep 2008 16:22:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Sep 2008 16:22:36 -0000 Received: (qmail 77601 invoked by uid 500); 17 Sep 2008 16:22:33 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 77589 invoked by uid 500); 17 Sep 2008 16:22:33 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 77580 invoked by uid 99); 17 Sep 2008 16:22:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 09:22:33 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 16:21:36 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 9ABC9238896D; Wed, 17 Sep 2008 09:21:38 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r696361 - in /openjpa/branches/1.0.x/openjpa-project/src/doc/manual: jpa_overview_mapping.xml jpa_overview_query.xml ref_guide_dbsetup.xml ref_guide_pc.xml ref_guide_remote.xml supported_databases.xml Date: Wed, 17 Sep 2008 16:21:37 -0000 To: commits@openjpa.apache.org From: mikedd@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080917162138.9ABC9238896D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mikedd Date: Wed Sep 17 09:21:35 2008 New Revision: 696361 URL: http://svn.apache.org/viewvc?rev=696361&view=rev Log: OPENJPA-724 committing patch provided by Milosz Tylenda. Merging revision 696350 to 1.0.x branch Modified: openjpa/branches/1.0.x/openjpa-project/src/doc/manual/jpa_overview_mapping.xml openjpa/branches/1.0.x/openjpa-project/src/doc/manual/jpa_overview_query.xml openjpa/branches/1.0.x/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml openjpa/branches/1.0.x/openjpa-project/src/doc/manual/ref_guide_pc.xml openjpa/branches/1.0.x/openjpa-project/src/doc/manual/ref_guide_remote.xml openjpa/branches/1.0.x/openjpa-project/src/doc/manual/supported_databases.xml Modified: openjpa/branches/1.0.x/openjpa-project/src/doc/manual/jpa_overview_mapping.xml URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-project/src/doc/manual/jpa_overview_mapping.xml?rev=696361&r1=696360&r2=696361&view=diff ============================================================================== --- openjpa/branches/1.0.x/openjpa-project/src/doc/manual/jpa_overview_mapping.xml (original) +++ openjpa/branches/1.0.x/openjpa-project/src/doc/manual/jpa_overview_mapping.xml Wed Sep 17 09:21:35 2008 @@ -4115,6 +4115,7 @@ <join-table name="MAG_ARTS"> <join-column name="MAG_ISBN" referenced-column-name="ISBN"/> <join-column name="MAG_TITLE" referenced-column-name="TITLE"/> + <inverse-join-column name="ART_ID" referenced-column-name="ID"/> </join-table> </one-to-many> ... @@ -4124,12 +4125,15 @@ <table name="ART"/> <attributes> <id name="id"/> - <many-to-many name="articles"> + <many-to-many name="authors"> <order-by>lastName, firstName</order-by> <join-table name="ART_AUTHS"> <join-column name="ART_ID" referenced-column-name="ID"/> <inverse-join-column name="AUTH_ID" referenced-column-name="AID"/> </join-table> + <cascade> + <cascade-persist/> + </cascade> </many-to-many> ... </attributes> @@ -4170,7 +4174,7 @@ -Magazine.publisher and Company.ags. +Magazine.publisher and Company.mags. @@ -4264,9 +4268,9 @@ ... <one-to-many name="items"> <map-key name="num"> - <join-table name="MAG_ARTS"> - <join-column name="MAG_ISBN" referenced-column-name="ISBN"/> - <join-column name="MAG_TITLE" referenced-column-name="TITLE"/> + <join-table name="SUB_ITEMS" schema="CNTRCT"> + <join-column name="SUB_ID"/> + <inverse-join-column name="ITEM_ID"/> </join-table> <cascade> <cascade-persist/> Modified: openjpa/branches/1.0.x/openjpa-project/src/doc/manual/jpa_overview_query.xml URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-project/src/doc/manual/jpa_overview_query.xml?rev=696361&r1=696360&r2=696361&view=diff ============================================================================== --- openjpa/branches/1.0.x/openjpa-project/src/doc/manual/jpa_overview_query.xml (original) +++ openjpa/branches/1.0.x/openjpa-project/src/doc/manual/jpa_overview_query.xml Wed Sep 17 09:21:35 2008 @@ -130,7 +130,7 @@ member names are not. For example, the expression above could also be expressed as: -SELECT x FROM Magazine x WHERE x.title = 'JDJ' +select x from Magazine x where x.title = 'JDJ' But it could not be expressed as: @@ -175,18 +175,18 @@ example: -SELECT x FROM Magazine x WHERE (x.price > 3.00 AND x.price <= 5.00) OR x.price = 7.00 +SELECT x FROM Magazine x WHERE (x.price > 3.00 AND x.price <= 5.00) OR x.price < 7.00 -This expression would match magazines whose price is 4.00, 5.00, or 7.00, but -not 6.00. Alternately: +This expression would match magazines whose price is less than 7.00. +Alternately: -SELECT x FROM Magazine x WHERE x.price > 3.00 AND (x.price <= 5.00 OR x.price = 7.00) +SELECT x FROM Magazine x WHERE x.price > 3.00 AND (x.price <= 5.00 OR x.price < 7.00) -This expression will magazines whose price is 5.00 or 7.00, but not 4.00 or -6.00. +This expression would match magazines whose price is 4.00, 5.00 or 6.00, but not +1.00, 2.00 or 3.00. JPQL also includes the following conditionals: @@ -2247,7 +2247,7 @@ address.phone NOT LIKE '12%3' is false for -'123' and '12993' and true for '1234' If the value of the string_expression or +'123' and '12993' and true for '1234'. If the value of the string_expression or pattern_value is NULL or unknown, the value of the LIKE expression is unknown. If the escape_character is specified and is NULL, the value of the LIKE expression @@ -2301,8 +2301,10 @@ JPQL Collection Member Expressions -The use of the comparison collection_member_expression is as follows: syntax for -the operator MEMBER OF in an +The use of the comparison collection_member_expression is as follows: + + + collection_member_expression ::= entity_expression [NOT] MEMBER [OF] collection_valued_path_expression @@ -2331,6 +2333,9 @@ expression is NULL or unknown, the value of the collection member expression is unknown. + +The use of the reserved word OF is optional in this expression. +
@@ -2346,9 +2351,6 @@ </itemizedlist> </para> <para> -The use of the reserved word OF is optional in this expression. - </para> - <para> Example: <programlisting>SELECT DISTINCT auth FROM Author auth WHERE EXISTS (SELECT spouseAuthor FROM Author spouseAuthor WHERE spouseAuthor = auth.spouse) @@ -2802,7 +2804,10 @@ <para> The argument to an aggregate function may be preceded by the keyword <literal> DISTINCT</literal> to specify that duplicate values are to be eliminated before -the aggregate function is applied. Null values are eliminated before the +the aggregate function is applied. +It is legal to specify <literal>DISTINCT</literal> with <literal>MAX</literal> +or <literal>MIN</literal>, but it does not affect the result. +Null values are eliminated before the aggregate function is applied, regardless of whether the keyword <literal> DISTINCT</literal> is specified. </para> @@ -2813,7 +2818,7 @@ <para> Examples The following query returns the average price of all magazines: <programlisting>SELECT AVG(mag.price) FROM Magazine mag</programlisting> The -following query returns the sum total cost of all the prices from all the +following query returns the sum of all the prices from all the magazines published by 'Larry': <programlisting>SELECT SUM(mag.price) FROM Publisher pub JOIN pub.magazines mag pub.firstName = 'Larry' </programlisting> The following query returns the total number of magazines: <programlisting>SELECT COUNT(mag) FROM Magazine mag</programlisting> @@ -2843,16 +2848,12 @@ </itemizedlist> </para> <para> -It is legal to specify <literal>DISTINCT</literal> with <literal>MAX</literal> -or <literal>MIN</literal>, but it does not affect the result. - </para> - <para> When the <literal>ORDER BY</literal> clause is used in a query, each element of the <literal>SELECT</literal> clause of the query must be one of the following: an identification variable x, optionally denoted as <literal>OBJECT(x)</literal> , a single_valued_association_path_expression, or a state_field_path_expression. For example: <programlisting> -SELECT pub FROM Publisher pub JOIN pub.magazines mag ORDER BY o.revenue, o.name +SELECT pub FROM Publisher pub ORDER BY pub.revenue, pub.name </programlisting> If more than one orderby_item is specified, the left-to-right sequence of the orderby_item elements determines the precedence, whereby the leftmost orderby_item has highest precedence. The keyword <literal>ASC</literal> Modified: openjpa/branches/1.0.x/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml?rev=696361&r1=696360&r2=696361&view=diff ============================================================================== --- openjpa/branches/1.0.x/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml (original) +++ openjpa/branches/1.0.x/openjpa-project/src/doc/manual/ref_guide_dbsetup.xml Wed Sep 17 09:21:35 2008 @@ -2741,7 +2741,7 @@ </para> <para> The <link linkend="openjpa.jdbc.DBDictionary"><literal> -openjpa.jdbc.DBDictionary</literal></link> plugin accepts the the <literal> +openjpa.jdbc.DBDictionary</literal></link> plugin accepts the <literal> JoinSyntax</literal> property to set the system's default syntax. The available values are: </para> Modified: openjpa/branches/1.0.x/openjpa-project/src/doc/manual/ref_guide_pc.xml URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-project/src/doc/manual/ref_guide_pc.xml?rev=696361&r1=696360&r2=696361&view=diff ============================================================================== --- openjpa/branches/1.0.x/openjpa-project/src/doc/manual/ref_guide_pc.xml (original) +++ openjpa/branches/1.0.x/openjpa-project/src/doc/manual/ref_guide_pc.xml Wed Sep 17 09:21:35 2008 @@ -592,9 +592,9 @@ Finding an Entity with an Entity Identity Field -public Delivery createDelivery(EntityManager em, Order order) { +public Delivery createDelivery(Order order) { Delivery delivery = new Delivery(); - delivery.setId(o); + delivery.setId(order); delivery.setDelivered(new Date()); return delivery; } Modified: openjpa/branches/1.0.x/openjpa-project/src/doc/manual/ref_guide_remote.xml URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-project/src/doc/manual/ref_guide_remote.xml?rev=696361&r1=696360&r2=696361&view=diff ============================================================================== --- openjpa/branches/1.0.x/openjpa-project/src/doc/manual/ref_guide_remote.xml (original) +++ openjpa/branches/1.0.x/openjpa-project/src/doc/manual/ref_guide_remote.xml Wed Sep 17 09:21:35 2008 @@ -563,6 +563,15 @@ To configure a factory to use the JMS provider, your properties might look like the following: + + + JMS Remote Commit Provider Configuration + + +<property name="openjpa.RemoteCommitProvider" + value="jms(ExceptionReconnectAttempts=5)"/> + + Because of the nature of JMS, it is important that you invoke @@ -624,7 +633,7 @@ NumBroadcastThreads: The number of threads to create for the purpose of transmitting events to peers. You sould increase this value as the number of concurrent transactions increases. The maximum number of concurrent -transactions is a function of the size of the connection pool. See the the +transactions is a function of the size of the connection pool. See the MaxActive property of openjpa.ConnectionFactoryProperties in . Setting a value of 0 will @@ -702,6 +711,15 @@ To transmit persisted object ids in our remote commit events using the JMS provider, we modify the previous example as follows: + + + JMS Remote Commit Provider transmitting Persisted Object Ids + + +<property name="openjpa.RemoteCommitProvider" + value="jms(ExceptionReconnectAttempts=5, TransmitPersistedObjectIds=true)"/> + +
Modified: openjpa/branches/1.0.x/openjpa-project/src/doc/manual/supported_databases.xml URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-project/src/doc/manual/supported_databases.xml?rev=696361&r1=696360&r2=696361&view=diff ============================================================================== --- openjpa/branches/1.0.x/openjpa-project/src/doc/manual/supported_databases.xml (original) +++ openjpa/branches/1.0.x/openjpa-project/src/doc/manual/supported_databases.xml Wed Sep 17 09:21:35 2008 @@ -815,7 +815,7 @@ Oracle has support for "query hints", which are formatted comments embedded in SQL that provide some hint for how the query should be executed. These hints are usually designed to provide suggestions to the Oracle query optimizer for how to -efficiently perform a certainly query, and aren't typically needed for any but +efficiently perform a certain query, and aren't typically needed for any but the most intensive queries. From commits-return-3390-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Wed Sep 17 23:20:08 2008 Return-Path: Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 96721 invoked from network); 17 Sep 2008 23:20:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Sep 2008 23:20:08 -0000 Received: (qmail 35910 invoked by uid 500); 17 Sep 2008 23:20:05 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 35897 invoked by uid 500); 17 Sep 2008 23:20:05 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 35886 invoked by uid 99); 17 Sep 2008 23:20:05 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 16:20:04 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 23:19:14 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 34CBD238896F; Wed, 17 Sep 2008 16:19:17 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r696510 - in /openjpa/branches/1.2.x/openjpa-project/src/doc/manual: ref_guide_conf.xml ref_guide_pc.xml Date: Wed, 17 Sep 2008 23:19:17 -0000 To: commits@openjpa.apache.org From: mikedd@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080917231917.34CBD238896F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mikedd Date: Wed Sep 17 16:19:16 2008 New Revision: 696510 URL: http://svn.apache.org/viewvc?rev=696510&view=rev Log: OPENJPA-650 adding documentation for openjpa.RuntimeUnenhancedClasses Modified: openjpa/branches/1.2.x/openjpa-project/src/doc/manual/ref_guide_conf.xml openjpa/branches/1.2.x/openjpa-project/src/doc/manual/ref_guide_pc.xml Modified: openjpa/branches/1.2.x/openjpa-project/src/doc/manual/ref_guide_conf.xml URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-project/src/doc/manual/ref_guide_conf.xml?rev=696510&r1=696509&r2=696510&view=diff ============================================================================== --- openjpa/branches/1.2.x/openjpa-project/src/doc/manual/ref_guide_conf.xml (original) +++ openjpa/branches/1.2.x/openjpa-project/src/doc/manual/ref_guide_conf.xml Wed Sep 17 16:19:16 2008 @@ -2753,6 +2753,50 @@ serious problems.
+
+ openjpa.RuntimeUnenhancedClasses + + Property name: + openjpa.RuntimeUnenhancedClasses + + + Configuration API: + org.apache.openjpa.conf.OpenJPAConfiguration.getRuntimeUnenhancedClasses + + + Resource adaptor config property: + RuntimeUnenhancedClasses + + + Default: + supported + + + + Possible values: + supported, + unsupported, + warn + + + Description: + The RuntimeUnenhancedClasses property controls how OpenJPA + handles classes that have not been enhanced byt the PCEnhancer + tool or automatically by a javaagent. If RuntimeUnenhanced is + set to supported OpenJPA will automatically + create subclasses for unenhanced entity classes. If set to + unsupportedOpenJPA will not create subclasses + for unenhanced entity classes and will throw an exception when + they are detected. If set to warn OpenJPA + will not create subclasses for unenhanced entity classes + but will log a warning message. + + + See the reference guide section on unenhanced types for more + information + + +
openjpa.SavepointManager Modified: openjpa/branches/1.2.x/openjpa-project/src/doc/manual/ref_guide_pc.xml URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-project/src/doc/manual/ref_guide_pc.xml?rev=696510&r1=696509&r2=696510&view=diff ============================================================================== --- openjpa/branches/1.2.x/openjpa-project/src/doc/manual/ref_guide_pc.xml (original) +++ openjpa/branches/1.2.x/openjpa-project/src/doc/manual/ref_guide_pc.xml Wed Sep 17 16:19:16 2008 @@ -436,13 +436,23 @@ runtime enhancement process for some reason. </para></listitem> <listitem><para> -<emphasis>state comparison and subclassing</emphasis>: if you are running +<emphasis>Runtime Unenhanced Classes</emphasis>: AKA statte comparison and +subclassing. If you are running in a Java 5 environment without a javaagent, or in a Java 6 environment that does not support class retransformation, OpenJPA will still create subclasses as outlined above. However, in some cases, OpenJPA may not be able to receive notifications when you read or write persistent data. </para> <para> + <note> +Runtime Unenhanced Classes has some known limitations which are discussed below +and documented in JIRA issues on the OpenJPA website. Support for this method +of automatic enhancement may be enabled or disabled via the +<xref linkend="openjpa.RuntimeUnenhancedClasses"> +openjpa.RuntimeUnenhancedClasses configuration </xref>option. + </note> + </para> + <para> If you are using <emphasis>property access</emphasis> for your persistent data, then OpenJPA will be able to track all accesses for instances that you load from the database, but not for instances that you create. This is because From commits-return-3391-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Wed Sep 17 23:21:47 2008 Return-Path: <commits-return-3391-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 98690 invoked from network); 17 Sep 2008 23:21:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Sep 2008 23:21:46 -0000 Received: (qmail 37948 invoked by uid 500); 17 Sep 2008 23:21:43 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 37890 invoked by uid 500); 17 Sep 2008 23:21:43 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 37881 invoked by uid 99); 17 Sep 2008 23:21:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 16:21:43 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 23:20:53 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 4A80D23889A0; Wed, 17 Sep 2008 16:21:26 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r696512 - /openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCConfigurationImpl.java Date: Wed, 17 Sep 2008 23:21:26 -0000 To: commits@openjpa.apache.org From: ppoddar@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080917232126.4A80D23889A0@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ppoddar Date: Wed Sep 17 16:21:25 2008 New Revision: 696512 URL: http://svn.apache.org/viewvc?rev=696512&view=rev Log: Use username/password for triall connection to slices. Modified: openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCConfigurationImpl.java Modified: openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCConfigurationImpl.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCConfigurationImpl.java?rev=696512&r1=696511&r2=696512&view=diff ============================================================================== --- openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCConfigurationImpl.java (original) +++ openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCConfigurationImpl.java Wed Sep 17 16:21:25 2008 @@ -218,7 +218,7 @@ DecoratingDataSource dds = new DecoratingDataSource(ds); ds = DataSourceFactory.installDBDictionary( conf.getDBDictionaryInstance(), dds, conf, false); - if (verifyDataSource(slice, ds)) { + if (verifyDataSource(slice, ds, conf)) { dataSources.add(ds); isXA &= isXACompliant(ds); } @@ -254,10 +254,12 @@ * Verify that a connection can be established to the given slice. If * connection can not be established then slice is set to INACTIVE state. */ - private boolean verifyDataSource(Slice slice, DataSource ds) { + private boolean verifyDataSource(Slice slice, DataSource ds, + JDBCConfiguration conf) { Connection con = null; try { - con = ds.getConnection(); + con = ds.getConnection(conf.getConnectionUserName(), + conf.getConnectionPassword()); slice.setStatus(Slice.Status.ACTIVE); if (con == null) { slice.setStatus(Slice.Status.INACTIVE); From commits-return-3392-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Wed Sep 17 23:21:48 2008 Return-Path: <commits-return-3392-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 98716 invoked from network); 17 Sep 2008 23:21:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Sep 2008 23:21:48 -0000 Received: (qmail 38002 invoked by uid 500); 17 Sep 2008 23:21:44 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 37962 invoked by uid 500); 17 Sep 2008 23:21:44 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 37953 invoked by uid 99); 17 Sep 2008 23:21:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 16:21:44 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 23:20:54 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 3F64D238896F; Wed, 17 Sep 2008 16:20:57 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r696511 - in /openjpa/trunk/openjpa-project/src/doc/manual: ref_guide_conf.xml ref_guide_pc.xml Date: Wed, 17 Sep 2008 23:20:57 -0000 To: commits@openjpa.apache.org From: mikedd@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080917232057.3F64D238896F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mikedd Date: Wed Sep 17 16:20:56 2008 New Revision: 696511 URL: http://svn.apache.org/viewvc?rev=696511&view=rev Log: OPENJPA-650 adding documentation for openjpa.RuntimeUnenhancedClasses. Merging revision 696510 to trunk Modified: openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_conf.xml openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_pc.xml Modified: openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_conf.xml URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_conf.xml?rev=696511&r1=696510&r2=696511&view=diff ============================================================================== --- openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_conf.xml (original) +++ openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_conf.xml Wed Sep 17 16:20:56 2008 @@ -2806,6 +2806,50 @@ serious problems. </para> </section> + <section id="openjpa.RuntimeUnenhancedClasses"> + <title>openjpa.RuntimeUnenhancedClasses + + Property name: + openjpa.RuntimeUnenhancedClasses + + + Configuration API: + org.apache.openjpa.conf.OpenJPAConfiguration.getRuntimeUnenhancedClasses + + + Resource adaptor config property: + RuntimeUnenhancedClasses + + + Default: + supported + + + + Possible values: + supported, + unsupported, + warn + + + Description: + The RuntimeUnenhancedClasses property controls how OpenJPA + handles classes that have not been enhanced byt the PCEnhancer + tool or automatically by a javaagent. If RuntimeUnenhanced is + set to supported OpenJPA will automatically + create subclasses for unenhanced entity classes. If set to + unsupportedOpenJPA will not create subclasses + for unenhanced entity classes and will throw an exception when + they are detected. If set to warn OpenJPA + will not create subclasses for unenhanced entity classes + but will log a warning message. + + + See the reference guide section on unenhanced types for more + information + + +
openjpa.SavepointManager Modified: openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_pc.xml URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_pc.xml?rev=696511&r1=696510&r2=696511&view=diff ============================================================================== --- openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_pc.xml (original) +++ openjpa/trunk/openjpa-project/src/doc/manual/ref_guide_pc.xml Wed Sep 17 16:20:56 2008 @@ -436,13 +436,23 @@ runtime enhancement process for some reason. </para></listitem> <listitem><para> -<emphasis>state comparison and subclassing</emphasis>: if you are running +<emphasis>Runtime Unenhanced Classes</emphasis>: AKA statte comparison and +subclassing. If you are running in a Java 5 environment without a javaagent, or in a Java 6 environment that does not support class retransformation, OpenJPA will still create subclasses as outlined above. However, in some cases, OpenJPA may not be able to receive notifications when you read or write persistent data. </para> <para> + <note> +Runtime Unenhanced Classes has some known limitations which are discussed below +and documented in JIRA issues on the OpenJPA website. Support for this method +of automatic enhancement may be enabled or disabled via the +<xref linkend="openjpa.RuntimeUnenhancedClasses"> +openjpa.RuntimeUnenhancedClasses configuration </xref>option. + </note> + </para> + <para> If you are using <emphasis>property access</emphasis> for your persistent data, then OpenJPA will be able to track all accesses for instances that you load from the database, but not for instances that you create. This is because From commits-return-3393-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Wed Sep 17 23:21:52 2008 Return-Path: <commits-return-3393-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 98800 invoked from network); 17 Sep 2008 23:21:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 17 Sep 2008 23:21:52 -0000 Received: (qmail 38059 invoked by uid 500); 17 Sep 2008 23:21:49 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 38044 invoked by uid 500); 17 Sep 2008 23:21:48 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 38035 invoked by uid 99); 17 Sep 2008 23:21:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 16:21:48 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Sep 2008 23:20:58 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 6110E2388A02; Wed, 17 Sep 2008 16:21:31 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r696513 - in /openjpa/branches/1.0.x/openjpa-project/src/doc/manual: ref_guide_conf.xml ref_guide_pc.xml Date: Wed, 17 Sep 2008 23:21:31 -0000 To: commits@openjpa.apache.org From: mikedd@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080917232131.6110E2388A02@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mikedd Date: Wed Sep 17 16:21:30 2008 New Revision: 696513 URL: http://svn.apache.org/viewvc?rev=696513&view=rev Log: OPENJPA-650 adding documentation for openjpa.RuntimeUnenhancedClasses. Merging revision 696510 to 1.0.x Modified: openjpa/branches/1.0.x/openjpa-project/src/doc/manual/ref_guide_conf.xml openjpa/branches/1.0.x/openjpa-project/src/doc/manual/ref_guide_pc.xml Modified: openjpa/branches/1.0.x/openjpa-project/src/doc/manual/ref_guide_conf.xml URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-project/src/doc/manual/ref_guide_conf.xml?rev=696513&r1=696512&r2=696513&view=diff ============================================================================== --- openjpa/branches/1.0.x/openjpa-project/src/doc/manual/ref_guide_conf.xml (original) +++ openjpa/branches/1.0.x/openjpa-project/src/doc/manual/ref_guide_conf.xml Wed Sep 17 16:21:30 2008 @@ -2741,6 +2741,50 @@ serious problems. </para> </section> + <section id="openjpa.RuntimeUnenhancedClasses"> + <title>openjpa.RuntimeUnenhancedClasses + + Property name: + openjpa.RuntimeUnenhancedClasses + + + Configuration API: + org.apache.openjpa.conf.OpenJPAConfiguration.getRuntimeUnenhancedClasses + + + Resource adaptor config property: + RuntimeUnenhancedClasses + + + Default: + supported + + + + Possible values: + supported, + unsupported, + warn + + + Description: + The RuntimeUnenhancedClasses property controls how OpenJPA + handles classes that have not been enhanced byt the PCEnhancer + tool or automatically by a javaagent. If RuntimeUnenhanced is + set to supported OpenJPA will automatically + create subclasses for unenhanced entity classes. If set to + unsupportedOpenJPA will not create subclasses + for unenhanced entity classes and will throw an exception when + they are detected. If set to warn OpenJPA + will not create subclasses for unenhanced entity classes + but will log a warning message. + + + See the reference guide section on unenhanced types for more + information + + +
openjpa.SavepointManager Modified: openjpa/branches/1.0.x/openjpa-project/src/doc/manual/ref_guide_pc.xml URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-project/src/doc/manual/ref_guide_pc.xml?rev=696513&r1=696512&r2=696513&view=diff ============================================================================== --- openjpa/branches/1.0.x/openjpa-project/src/doc/manual/ref_guide_pc.xml (original) +++ openjpa/branches/1.0.x/openjpa-project/src/doc/manual/ref_guide_pc.xml Wed Sep 17 16:21:30 2008 @@ -431,13 +431,23 @@ runtime enhancement process for some reason. </para></listitem> <listitem><para> -<emphasis>state comparison and subclassing</emphasis>: if you are running +<emphasis>Runtime Unenhanced Classes</emphasis>: AKA statte comparison and +subclassing. If you are running in a Java 5 environment without a javaagent, or in a Java 6 environment that does not support class retransformation, OpenJPA will still create subclasses as outlined above. However, in some cases, OpenJPA may not be able to receive notifications when you read or write persistent data. </para> <para> + <note> +Runtime Unenhanced Classes has some known limitations which are discussed below +and documented in JIRA issues on the OpenJPA website. Support for this method +of automatic enhancement may be enabled or disabled via the +<xref linkend="openjpa.RuntimeUnenhancedClasses"> +openjpa.RuntimeUnenhancedClasses configuration </xref>option. + </note> + </para> + <para> If you are using <emphasis>property access</emphasis> for your persistent data, then OpenJPA will be able to track all accesses for instances that you load from the database, but not for instances that you create. This is because From commits-return-3394-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Thu Sep 18 07:58:42 2008 Return-Path: <commits-return-3394-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 90797 invoked from network); 18 Sep 2008 07:58:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Sep 2008 07:58:42 -0000 Received: (qmail 28371 invoked by uid 500); 18 Sep 2008 07:58:39 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 28358 invoked by uid 500); 18 Sep 2008 07:58:39 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 28346 invoked by uid 99); 18 Sep 2008 07:58:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Sep 2008 00:58:39 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Sep 2008 07:57:48 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 9D4432388988; Thu, 18 Sep 2008 00:57:51 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r696590 - /openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java Date: Thu, 18 Sep 2008 07:57:51 -0000 To: commits@openjpa.apache.org From: ppoddar@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080918075751.9D4432388988@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ppoddar Date: Thu Sep 18 00:57:51 2008 New Revision: 696590 URL: http://svn.apache.org/viewvc?rev=696590&view=rev Log: OPENJPA-704: Add field names of path-like syntax Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java?rev=696590&r1=696589&r2=696590&view=diff ============================================================================== --- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java (original) +++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/FetchConfigurationImpl.java Thu Sep 18 00:57:51 2008 @@ -594,7 +594,9 @@ || (fmd.isInDefaultFetchGroup() && hasFetchGroupDefault()) || hasField(fmd.getFullName(false)) - || hasField(fmd.getRealName())) // OPENJPA-704 + || hasField(fmd.getRealName()) // OPENJPA-704 + || (_fromField != null + && hasField(_fromField + "." + fmd.getName()))) return true; String[] fgs = fmd.getCustomFetchGroups(); for (int i = 0; i < fgs.length; i++) From commits-return-3395-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Thu Sep 18 15:32:29 2008 Return-Path: <commits-return-3395-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 81521 invoked from network); 18 Sep 2008 15:32:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Sep 2008 15:32:29 -0000 Received: (qmail 89205 invoked by uid 500); 18 Sep 2008 15:32:26 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 89190 invoked by uid 500); 18 Sep 2008 15:32:26 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 89181 invoked by uid 99); 18 Sep 2008 15:32:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Sep 2008 08:32:26 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Sep 2008 15:31:35 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 05A2A238896D; Thu, 18 Sep 2008 08:31:38 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r696676 - in /openjpa/branches/1.0.x: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/ openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ Date: Thu, 18 Sep 2008 15:31:37 -0000 To: commits@openjpa.apache.org From: kwsutter@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080918153138.05A2A238896D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: kwsutter Date: Thu Sep 18 08:31:37 2008 New Revision: 696676 URL: http://svn.apache.org/viewvc?rev=696676&view=rev Log: OPENJPA-715. Migrating the change to the 1.0.x service stream. This was requested from a user via a private e-mail exchange. I verified the problem existed in 1.0.x, applied the changes, and verified that the problem was resolved. Added: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityA.java (with props) openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityB.java (with props) openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityC.java (with props) openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestChainEntities.java (with props) Modified: openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java openjpa/branches/1.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java openjpa/branches/1.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java Modified: openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java?rev=696676&r1=696675&r2=696676&view=diff ============================================================================== --- openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java (original) +++ openjpa/branches/1.0.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java Thu Sep 18 08:31:37 2008 @@ -327,7 +327,7 @@ } /** - * Return the primary key value for the given class. + * Return the primary key value for the sequence table for the given class. */ protected Object getPrimaryKey(ClassMapping mapping) { return Numbers.valueOf(0); Modified: openjpa/branches/1.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java?rev=696676&r1=696675&r2=696676&view=diff ============================================================================== --- openjpa/branches/1.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java (original) +++ openjpa/branches/1.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/SingleFieldManager.java Thu Sep 18 08:31:37 2008 @@ -756,8 +756,12 @@ setFailedObject(obj); } else { sm = _broker.getStateManager(obj); - if (sm == null || !sm.isProvisional()) + if (sm == null || !sm.isProvisional()) { sm = _broker.persist(obj, null, true, call); + // ensure generated IDs get assigned properly + if (!logical) + ((StateManagerImpl)sm).assignObjectId(false, true); + } } if (sm != null) { Modified: openjpa/branches/1.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java?rev=696676&r1=696675&r2=696676&view=diff ============================================================================== --- openjpa/branches/1.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java (original) +++ openjpa/branches/1.0.x/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java Thu Sep 18 08:31:37 2008 @@ -494,7 +494,7 @@ * Ask store manager to assign our oid, optionally flushing and * optionally recaching on the new oid. */ - private boolean assignObjectId(boolean flush, boolean preFlushing) { + boolean assignObjectId(boolean flush, boolean preFlushing) { if (_oid != null || isEmbedded() || !isPersistent()) return true; Added: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityA.java URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityA.java?rev=696676&view=auto ============================================================================== --- openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityA.java (added) +++ openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityA.java Thu Sep 18 08:31:37 2008 @@ -0,0 +1,79 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.persistence.relations; + +import java.util.Collection; +import java.util.LinkedHashSet; +import java.util.Set; + +import javax.persistence.CascadeType; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.ManyToMany; +import javax.persistence.Version; + +@Entity +public class ChainEntityA { + + @Id + @GeneratedValue + private long aId; + + @Version + private Integer optLock; + + @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER) + protected Set<ChainEntityB> chainEntityBSet; + + public ChainEntityA () { + super (); + } + + public void addChildEntityB (ChainEntityB bean) { + if (null == chainEntityBSet) + chainEntityBSet = new LinkedHashSet<ChainEntityB> (); + chainEntityBSet.add (bean); + } + + public Collection<ChainEntityB> getChildren () { + if (null == chainEntityBSet) + chainEntityBSet = new LinkedHashSet<ChainEntityB> (); + return chainEntityBSet; + } + + private String name; + + public String getName () { + return name; + } + + public void setName (String name) { + this.name = name; + } + + public long getId () { + return aId; + } + + public void setId (long id) { + this.aId = id; + } +} Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityA.java ------------------------------------------------------------------------------ svn:eol-style = native Added: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityB.java URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityB.java?rev=696676&view=auto ============================================================================== --- openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityB.java (added) +++ openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityB.java Thu Sep 18 08:31:37 2008 @@ -0,0 +1,78 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.persistence.relations; + +import java.util.Collection; +import java.util.LinkedHashSet; +import java.util.Set; + +import javax.persistence.CascadeType; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.OneToMany; +import javax.persistence.Version; + +@Entity +public class ChainEntityB { + + @Id + @GeneratedValue + private long bId; + + @Version + private Integer optLock; + + //cascade = CascadeType.ALL, + @OneToMany(cascade=CascadeType.ALL, fetch = FetchType.EAGER, mappedBy = "chainEntityB") + protected Set<ChainEntityC> chainEntityCSet = null; + + public void addChainEntityC (ChainEntityC bean) { + if (null == chainEntityCSet) + chainEntityCSet = new LinkedHashSet<ChainEntityC> (); + chainEntityCSet.add (bean); + bean.setChainEntityB (this); + } + + public Collection<ChainEntityC> getChainEntityCSet () { + if (null == chainEntityCSet) + chainEntityCSet = new LinkedHashSet<ChainEntityC> (); + return chainEntityCSet; + } + + private String name; + + public String getName () { + return name; + } + + public void setName (String name) { + this.name = name; + } + + public long getId () { + return bId; + } + + public void setId (long id) { + this.bId = id; + } + +} Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityB.java ------------------------------------------------------------------------------ svn:eol-style = native Added: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityC.java URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityC.java?rev=696676&view=auto ============================================================================== --- openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityC.java (added) +++ openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityC.java Thu Sep 18 08:31:37 2008 @@ -0,0 +1,69 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.persistence.relations; + +import javax.persistence.Basic; +import javax.persistence.CascadeType; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.ManyToOne; +import javax.persistence.Version; + +@Entity +public class ChainEntityC { + + @Id + @GeneratedValue + private long cId; + + @Version + private Integer optLock; + + @ManyToOne(fetch = FetchType.EAGER, cascade=CascadeType.ALL) + protected ChainEntityB chainEntityB; + + @Basic + protected long chainEntityBId; + + public void setChainEntityB (ChainEntityB b) { + this.chainEntityB = b; +// this.chainEntityBId = null == b ? 0 : b.getId (); + } + + private String name; + + public String getName () { + return name; + } + + public void setName (String name) { + this.name = name; + } + + public long getId () { + return cId; + } + + public void setId (long id) { + this.cId = id; + } + +} Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ChainEntityC.java ------------------------------------------------------------------------------ svn:eol-style = native Added: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestChainEntities.java URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestChainEntities.java?rev=696676&view=auto ============================================================================== --- openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestChainEntities.java (added) +++ openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestChainEntities.java Thu Sep 18 08:31:37 2008 @@ -0,0 +1,117 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.persistence.relations; + +import javax.persistence.EntityManager; + +import org.apache.openjpa.persistence.test.SingleEMFTestCase; + +public class TestChainEntities extends SingleEMFTestCase { + + /* + * Set this magical number to 3 or less to avoid the error. + */ + private static final int MAGICAL_NUMBER = 50; + + long aid; + + public void setUp () { + setUp (ChainEntityA.class, ChainEntityB.class, ChainEntityC.class); + // Create A + ChainEntityA a = new ChainEntityA (); + a.setName ("TEST_A"); + // Persist A + EntityManager em = emf.createEntityManager (); + em.getTransaction ().begin (); + em.persist (a); + aid = a.getId (); + em.getTransaction ().commit (); + em.close (); + System.out.println ("ChainEntityA id = " + aid); + } + + public void testChainEntities () { + chainUpdate (); + } + + protected void chainUpdate () { + // Get A + ChainEntityA a = getA (); + // Create B + ChainEntityB b = new ChainEntityB (); + b.setName ("Test_B_"); + ChainEntityC c; + /* + * Create and add C to B. Increasing the number of iterations (number of + * ChainEntityC) increases the probability to get the unique key + * constraint violation error. + */ + for (int i = 1; i <= MAGICAL_NUMBER; i++) { + c = new ChainEntityC (); + c.setName ("Test_C_" + i); + b.addChainEntityC (c); + } + a.addChildEntityB (b); + // dump (a); // debug + // Merge A + EntityManager em = emf.createEntityManager (); + em.getTransaction ().begin (); + a = em.merge (a); + /* + * workaround: Uncommenting following line is a workaround. If we + * retrive Ids of ChainEntityC objects after merge but before commit we + * don't get the error. + */ + //dump (a); + em.getTransaction ().commit (); + em.close (); + // dump (getA ()); // debug + } + + /** + * Get created ChainEntityA using aid field. + * + * @return + */ + protected ChainEntityA getA () { + EntityManager em = emf.createEntityManager (); + ChainEntityA a = em.find (ChainEntityA.class, aid); + em.close (); + return a; + } + + /** + * Print the object graph of given ChainEntityA to System.out + * + * @param testA + */ + protected void dump (ChainEntityA testA) { + System.out.println ("-------"); + System.out.println (testA.getName () + "[" + testA.getId () + "]"); + for (ChainEntityB testB : testA.getChildren ()) { + System.out.println (testB.getName () + "[" + testB.getId () + "]"); + for (ChainEntityC testC : testB.getChainEntityCSet ()) { + System.out.println (testC.getName () + "[" + testC.getId () + + "]"); + } + } + System.out.println ("-------"); + } + +} Propchange: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TestChainEntities.java ------------------------------------------------------------------------------ svn:eol-style = native From commits-return-3396-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Thu Sep 18 21:27:31 2008 Return-Path: <commits-return-3396-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 37409 invoked from network); 18 Sep 2008 21:27:31 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Sep 2008 21:27:31 -0000 Received: (qmail 4006 invoked by uid 500); 18 Sep 2008 21:27:28 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 3997 invoked by uid 500); 18 Sep 2008 21:27:27 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 3988 invoked by uid 99); 18 Sep 2008 21:27:27 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Sep 2008 14:27:27 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 18 Sep 2008 21:26:37 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 3A04C2388A1B; Thu, 18 Sep 2008 14:26:40 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r696818 - /openjpa/branches/1.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StoreCollectionFieldStrategy.java Date: Thu, 18 Sep 2008 21:26:40 -0000 To: commits@openjpa.apache.org From: ppoddar@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080918212640.3A04C2388A1B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ppoddar Date: Thu Sep 18 14:26:39 2008 New Revision: 696818 URL: http://svn.apache.org/viewvc?rev=696818&view=rev Log: OPENJPA-710: Merge to 1.2.x Modified: openjpa/branches/1.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StoreCollectionFieldStrategy.java Modified: openjpa/branches/1.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StoreCollectionFieldStrategy.java URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StoreCollectionFieldStrategy.java?rev=696818&r1=696817&r2=696818&view=diff ============================================================================== --- openjpa/branches/1.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StoreCollectionFieldStrategy.java (original) +++ openjpa/branches/1.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/meta/strats/StoreCollectionFieldStrategy.java Thu Sep 18 14:26:39 2008 @@ -226,7 +226,11 @@ joins = sel.outer(joins); if (!selectOid) { Column[] refs = getJoinForeignKey(elem).getColumns(); - sel.orderBy(refs, true, joins, true); + if (requiresOrderBy()) { + sel.orderBy(refs, true, joins, true); + } else { + sel.select(refs, joins); + } } field.orderLocal(sel, elem, joins); } @@ -662,4 +666,8 @@ protected ForeignKey getJoinForeignKey() { return getJoinForeignKey(getDefaultElementMapping(false)); } + + boolean requiresOrderBy() { + return List.class.isAssignableFrom(field.getProxyType()); + } } From commits-return-3397-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Mon Sep 22 19:27:27 2008 Return-Path: <commits-return-3397-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 34474 invoked from network); 22 Sep 2008 19:27:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Sep 2008 19:27:27 -0000 Received: (qmail 29190 invoked by uid 500); 22 Sep 2008 19:27:24 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 29181 invoked by uid 500); 22 Sep 2008 19:27:24 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 29172 invoked by uid 99); 22 Sep 2008 19:27:23 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Sep 2008 12:27:23 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Sep 2008 19:26:32 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id B92CE238889E; Mon, 22 Sep 2008 12:26:35 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r697955 - in /openjpa/trunk: openjpa-examples/pom.xml openjpa-persistence-jdbc/src/main/ant/enhancer.xml openjpa-slice/src/main/ant/enhancer.xml Date: Mon, 22 Sep 2008 19:26:35 -0000 To: commits@openjpa.apache.org From: mikedd@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080922192635.B92CE238889E@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mikedd Date: Mon Sep 22 12:26:35 2008 New Revision: 697955 URL: http://svn.apache.org/viewvc?rev=697955&view=rev Log: OPENJPA-685. Removing references to maven.compile.classpath and maven.dependency.classpath from enhancer ant task Modified: openjpa/trunk/openjpa-examples/pom.xml openjpa/trunk/openjpa-persistence-jdbc/src/main/ant/enhancer.xml openjpa/trunk/openjpa-slice/src/main/ant/enhancer.xml Modified: openjpa/trunk/openjpa-examples/pom.xml URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-examples/pom.xml?rev=697955&r1=697954&r2=697955&view=diff ============================================================================== --- openjpa/trunk/openjpa-examples/pom.xml (original) +++ openjpa/trunk/openjpa-examples/pom.xml Mon Sep 22 12:26:35 2008 @@ -74,38 +74,6 @@ </excludes> </configuration> </plugin> - <!-- ### - <plugin> - <artifactId>maven-antrun-plugin</artifactId> - <executions> - <execution> - <phase>test-compile</phase> - <configuration> - <tasks> - <path id="cp"> - <path refid="maven.test.classpath" /> - <path refid="maven.compile.classpath" /> - <path refid="maven.dependency.classpath" /> - </path> - <taskdef name="openjpac" classname= "org.apache.openjpa.ant.PCEnhancerTask"> - <classpath refid="cp" /> - </taskdef> - <fileset id="enhance.path.ref" dir="${project.build.testOutputDirectory}"> - <include name="**/*.class" /> - </fileset> - <openjpac> - <classpath refid="cp" /> - <fileset refid="enhance.path.ref" /> - </openjpac> - </tasks> - </configuration> - <goals> - <goal>run</goal> - </goals> - </execution> - </executions> - </plugin> - --> </plugins> </build> </project> Modified: openjpa/trunk/openjpa-persistence-jdbc/src/main/ant/enhancer.xml URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/main/ant/enhancer.xml?rev=697955&r1=697954&r2=697955&view=diff ============================================================================== --- openjpa/trunk/openjpa-persistence-jdbc/src/main/ant/enhancer.xml (original) +++ openjpa/trunk/openjpa-persistence-jdbc/src/main/ant/enhancer.xml Mon Sep 22 12:26:35 2008 @@ -59,8 +59,6 @@ --> <path id="cp"> <path refid="maven.test.classpath" /> - <path refid="maven.compile.classpath" /> - <path refid="maven.dependency.classpath" /> </path> <taskdef name="openjpac" Modified: openjpa/trunk/openjpa-slice/src/main/ant/enhancer.xml URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/main/ant/enhancer.xml?rev=697955&r1=697954&r2=697955&view=diff ============================================================================== --- openjpa/trunk/openjpa-slice/src/main/ant/enhancer.xml (original) +++ openjpa/trunk/openjpa-slice/src/main/ant/enhancer.xml Mon Sep 22 12:26:35 2008 @@ -59,8 +59,6 @@ --> <path id="cp"> <path refid="maven.test.classpath" /> - <path refid="maven.compile.classpath" /> - <path refid="maven.dependency.classpath" /> </path> <taskdef name="openjpac" From commits-return-3398-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Mon Sep 22 19:35:13 2008 Return-Path: <commits-return-3398-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 40988 invoked from network); 22 Sep 2008 19:35:12 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Sep 2008 19:35:12 -0000 Received: (qmail 52322 invoked by uid 500); 22 Sep 2008 19:35:10 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 52264 invoked by uid 500); 22 Sep 2008 19:35:10 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 52255 invoked by uid 99); 22 Sep 2008 19:35:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Sep 2008 12:35:10 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Sep 2008 19:34:18 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 1819B238889E; Mon, 22 Sep 2008 12:34:52 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r697959 - in /openjpa/branches/1.2.x: openjpa-examples/pom.xml openjpa-persistence-jdbc/src/main/ant/enhancer.xml openjpa-slice/src/main/ant/enhancer.xml Date: Mon, 22 Sep 2008 19:34:51 -0000 To: commits@openjpa.apache.org From: mikedd@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080922193452.1819B238889E@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mikedd Date: Mon Sep 22 12:34:51 2008 New Revision: 697959 URL: http://svn.apache.org/viewvc?rev=697959&view=rev Log: OPENJPA-685. Removing references to maven.compile.classpath and maven.dependency.classpath from enhancer ant task. Merge to 1.2.x branch Modified: openjpa/branches/1.2.x/openjpa-examples/pom.xml openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/main/ant/enhancer.xml openjpa/branches/1.2.x/openjpa-slice/src/main/ant/enhancer.xml Modified: openjpa/branches/1.2.x/openjpa-examples/pom.xml URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-examples/pom.xml?rev=697959&r1=697958&r2=697959&view=diff ============================================================================== --- openjpa/branches/1.2.x/openjpa-examples/pom.xml (original) +++ openjpa/branches/1.2.x/openjpa-examples/pom.xml Mon Sep 22 12:34:51 2008 @@ -74,38 +74,6 @@ </excludes> </configuration> </plugin> - <!-- ### - <plugin> - <artifactId>maven-antrun-plugin</artifactId> - <executions> - <execution> - <phase>test-compile</phase> - <configuration> - <tasks> - <path id="cp"> - <path refid="maven.test.classpath" /> - <path refid="maven.compile.classpath" /> - <path refid="maven.dependency.classpath" /> - </path> - <taskdef name="openjpac" classname= "org.apache.openjpa.ant.PCEnhancerTask"> - <classpath refid="cp" /> - </taskdef> - <fileset id="enhance.path.ref" dir="${project.build.testOutputDirectory}"> - <include name="**/*.class" /> - </fileset> - <openjpac> - <classpath refid="cp" /> - <fileset refid="enhance.path.ref" /> - </openjpac> - </tasks> - </configuration> - <goals> - <goal>run</goal> - </goals> - </execution> - </executions> - </plugin> - --> </plugins> </build> </project> Modified: openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/main/ant/enhancer.xml URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/main/ant/enhancer.xml?rev=697959&r1=697958&r2=697959&view=diff ============================================================================== --- openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/main/ant/enhancer.xml (original) +++ openjpa/branches/1.2.x/openjpa-persistence-jdbc/src/main/ant/enhancer.xml Mon Sep 22 12:34:51 2008 @@ -59,8 +59,6 @@ --> <path id="cp"> <path refid="maven.test.classpath" /> - <path refid="maven.compile.classpath" /> - <path refid="maven.dependency.classpath" /> </path> <taskdef name="openjpac" Modified: openjpa/branches/1.2.x/openjpa-slice/src/main/ant/enhancer.xml URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-slice/src/main/ant/enhancer.xml?rev=697959&r1=697958&r2=697959&view=diff ============================================================================== --- openjpa/branches/1.2.x/openjpa-slice/src/main/ant/enhancer.xml (original) +++ openjpa/branches/1.2.x/openjpa-slice/src/main/ant/enhancer.xml Mon Sep 22 12:34:51 2008 @@ -59,8 +59,6 @@ --> <path id="cp"> <path refid="maven.test.classpath" /> - <path refid="maven.compile.classpath" /> - <path refid="maven.dependency.classpath" /> </path> <taskdef name="openjpac" From commits-return-3399-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Mon Sep 22 19:35:46 2008 Return-Path: <commits-return-3399-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 41317 invoked from network); 22 Sep 2008 19:35:46 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 22 Sep 2008 19:35:46 -0000 Received: (qmail 53925 invoked by uid 500); 22 Sep 2008 19:35:43 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 53906 invoked by uid 500); 22 Sep 2008 19:35:43 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 53897 invoked by uid 99); 22 Sep 2008 19:35:43 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Sep 2008 12:35:43 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Sep 2008 19:34:52 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 89512238896D; Mon, 22 Sep 2008 12:35:25 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r697960 - in /openjpa/branches/1.0.x: openjpa-examples/pom.xml openjpa-persistence-jdbc/src/main/ant/enhancer.xml Date: Mon, 22 Sep 2008 19:35:25 -0000 To: commits@openjpa.apache.org From: mikedd@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080922193525.89512238896D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mikedd Date: Mon Sep 22 12:35:25 2008 New Revision: 697960 URL: http://svn.apache.org/viewvc?rev=697960&view=rev Log: OPENJPA-685. Removing references to maven.compile.classpath and maven.dependency.classpath from enhancer ant task. Merge to 1.0.x branch Modified: openjpa/branches/1.0.x/openjpa-examples/pom.xml openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/main/ant/enhancer.xml Modified: openjpa/branches/1.0.x/openjpa-examples/pom.xml URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-examples/pom.xml?rev=697960&r1=697959&r2=697960&view=diff ============================================================================== --- openjpa/branches/1.0.x/openjpa-examples/pom.xml (original) +++ openjpa/branches/1.0.x/openjpa-examples/pom.xml Mon Sep 22 12:35:25 2008 @@ -76,38 +76,6 @@ </excludes> </configuration> </plugin> - <!-- ### - <plugin> - <artifactId>maven-antrun-plugin</artifactId> - <executions> - <execution> - <phase>test-compile</phase> - <configuration> - <tasks> - <path id="cp"> - <path refid="maven.test.classpath" /> - <path refid="maven.compile.classpath" /> - <path refid="maven.dependency.classpath" /> - </path> - <taskdef name="openjpac" classname= "org.apache.openjpa.ant.PCEnhancerTask"> - <classpath refid="cp" /> - </taskdef> - <fileset id="enhance.path.ref" dir="${project.build.testOutputDirectory}"> - <include name="**/*.class" /> - </fileset> - <openjpac> - <classpath refid="cp" /> - <fileset refid="enhance.path.ref" /> - </openjpac> - </tasks> - </configuration> - <goals> - <goal>run</goal> - </goals> - </execution> - </executions> - </plugin> - --> </plugins> </build> </project> Modified: openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/main/ant/enhancer.xml URL: http://svn.apache.org/viewvc/openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/main/ant/enhancer.xml?rev=697960&r1=697959&r2=697960&view=diff ============================================================================== --- openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/main/ant/enhancer.xml (original) +++ openjpa/branches/1.0.x/openjpa-persistence-jdbc/src/main/ant/enhancer.xml Mon Sep 22 12:35:25 2008 @@ -59,8 +59,6 @@ --> <path id="cp"> <path refid="maven.test.classpath" /> - <path refid="maven.compile.classpath" /> - <path refid="maven.dependency.classpath" /> </path> <taskdef name="openjpac" From commits-return-3400-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Tue Sep 23 15:09:32 2008 Return-Path: <commits-return-3400-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 78648 invoked from network); 23 Sep 2008 15:09:32 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Sep 2008 15:09:32 -0000 Received: (qmail 27121 invoked by uid 500); 23 Sep 2008 15:09:30 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 27109 invoked by uid 500); 23 Sep 2008 15:09:29 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 27100 invoked by uid 99); 23 Sep 2008 15:09:29 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Sep 2008 08:09:29 -0700 X-ASF-Spam-Status: No, hits=-1996.3 required=10.0 tests=ALL_TRUSTED,HTML_MESSAGE,MIME_HTML_ONLY X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Sep 2008 15:08:26 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 0AE74234C1DF for <commits@openjpa.apache.org>; Tue, 23 Sep 2008 08:09:00 -0700 (PDT) Message-ID: <2074939782.1222182540019.JavaMail.www-data@brutus> Date: Tue, 23 Sep 2008 08:09:00 -0700 (PDT) From: confluence@apache.org To: commits@openjpa.apache.org Subject: [CONF] OpenJPA: Downloads (page edited) MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org <html> <head> <base href=3D"http://cwiki.apache.org/confluence" /> <style type=3D"text/css"> <!-- body, p, td, table, tr, .bodytext, .stepfield { =09font-family: Verdana, arial, sans-serif; =09font-size: 11px; =09line-height: 16px; =09color: #000000; =09font-weight: normal; } #PageContent { =09text-align: left; =09background-color: #fff; =09padding: 0px; =09margin: 0px; padding-bottom:20px; } /* ** when this stylesheet is used for the Tiny MCE Wysiwyg editor's edit area= , we can't ** use an id=3DPageContent or class=3Dwiki-content, so we must ** set the body style to that used for PageContent, and p to that used for = wiki-content. */ body { =09margin: 0px; =09padding: 0px; =09text-align: center; background-color: #f0f0f0; } @media print { body { background-color: #fff; } } .monospaceInput { font:12px monospace } .wiki-content p, .commentblock p { margin: 16px 0px 16px 0px; padding: 0px; } .wiki-content-preview { padding: 5px; border-left: 1px solid #3c78b5; border-right: 1px solid #3c78b5; } ul, ol { margin-top: 2px; margin-bottom: 2px; padding-top: 0px; padding-bottom: 0px; } pre { padding: 0px; margin-top: 5px; margin-left: 15px; margin-bottom: 5px; margin-right: 5px; text-align: left; } .helpheading { font-weight: bold; background-color: #D0D9BD; border-bottom: 1px solid #3c78b5; padding: 4px 4px 4px 4px; margin: 0px; margin-top: 10px; } .helpcontent { padding: 4px 4px 20px 4px; background-color: #f5f7f1; } .code { =09border: 1px dashed #3c78b5; font-size: 11px; =09font-family: Courier; margin: 10px; =09line-height: 13px; } .focusedComment { background: #ffffce; } .commentBox, .focusedComment { padding: 10px; margin: 5px 0 5px 0; border: 1px #bbb solid; } .codeHeader { background-color: #f0f0f0; =09border-bottom: 1px dashed #3c78b5; padding: 3px; =09text-align: center; } .codeContent { text-align: left; background-color: #f0f0f0; padding: 3px; } .preformatted { =09border: 1px dashed #3c78b5; font-size: 11px; =09font-family: Courier; margin: 10px; =09line-height: 13px; } .preformattedHeader { background-color: #f0f0f0; =09border-bottom: 1px dashed #3c78b5; padding: 3px; =09text-align: center; } .preformattedContent { background-color: #f0f0f0; padding: 3px; } .panel { =09border: 1px dashed #3c78b5; margin: 10px; margin-top: 0px; } .panelHeader { background-color: #f0f0f0; =09border-bottom: 1px dashed #3c78b5; padding: 3px; =09text-align: center; } .panelContent { background-color: #f0f0f0; padding: 5px; } .anonymousAlert { background-color: #f0f0f0; =09border: 1px dashed red; font-size: 11px; padding: 10px 5px 10px 5px; margin: 4px; =09line-height: 13px; } .lockAlert { background-color: #f0f0f0; width: 50%; =09border: 1px dashed red; font-size: 11px; padding: 10px 5px 10px 5px; margin: 4px; =09line-height: 13px; } .code-keyword { color: #000091; background-color: inherit; } .code-object { color: #910091; background-color: inherit; } .code-quote { color: #009100; background-color: inherit; } .code-comment { color: #808080; background-color: inherit; } .code-xml .code-keyword { color: inherit; font-weight: bold; } .code-tag { color: #000091; background-color: inherit; } .breadcrumbs { background-color: #f0f0f0; =09border-color: #3c78b5; =09border-width: 1px 0px 1px 0px; =09border-style: solid; font-size: 11px; padding: 3px 0px 3px 0px; } .navmenu { border: 1px solid #ccc; } .menuheading { font-weight: bold; background-color: #f0f0f0; =09border-bottom: 1px solid #3c78b5; =09padding: 4px 4px 2px 4px; } .menuitems { =09padding: 4px 4px 20px 4px; } .rightpanel { border-left: 1px solid #ccc; border-bottom: 1px solid #ccc; } #helpheading { text-align: left; font-weight: bold; background-color: #D0D9BD; =09border-bottom: 1px solid #3c78b5; =09padding: 4px 4px 4px 4px; =09margin: 0px; } #helpcontent { =09padding: 4px 4px 4px 4px; background-color: #f5f7f1; } .helptab-unselected { font-weight: bold; =09padding: 5px; background-color: #f5f7f1; } .helptab-selected { font-weight: bold; background-color: #D0D9BD; =09padding: 5px; } .helptabs { margin: 0px; background-color: #f5f7f1; =09padding: 5px; } .infopanel-heading { font-weight: bold; =09padding: 4px 0px 2px 0px; } .pagebody { } .pageheader { =09padding: 5px 5px 5px 0px; =09border-bottom: 1px solid #3c78b5; } .pagetitle { =09font-size: 22px; =09font-weight: bold; =09font-family: Arial, sans-serif; =09color: #003366; } .newpagetitle { color: #ccc !important; } .steptitle { =09font-size: 18px; =09font-weight: bold; =09font-family: Arial, sans-serif; =09color: #003366; =09margin-bottom: 7px; } .substeptitle { font-size: 12px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; margin: 2px 4px 4px 4px; padding: 2px 4px 1px 4px; } .stepdesc { font-family: Verdana, arial, sans-serif; =09font-size: 11px; =09line-height: 16px; =09font-weight: normal; color: #666666; margin-top: 7px; margin-bottom: 7px; } .steplabel { font-weight: bold; margin-right: 4px; color: black; float: left; width: 15%; text-align: right; } .stepfield { background: #f0f0f0; padding: 5px; } .submitButtons{ margin-top:5px; text-align:right; } .formtitle { =09font-size: 12px; =09font-weight: bold; =09font-family: Arial, sans-serif; =09color: #003366; } .sectionbottom { border-bottom: 1px solid #3c78b5; } .topRow { border-top: 2px solid #3c78b5; } .tabletitle { =09font-size: 14px; =09font-weight: bold; =09font-family: Arial, sans-serif; padding: 3px 0px 2px 0px; margin: 8px 4px 2px 0px; =09color: #003366; =09border-bottom: 2px solid #3c78b5; } .pagesubheading { color: #666666; font-size: 10px; padding: 0px 0px 5px 0px; } HR { =09color: 3c78b5; =09height: 1; } A:link, A:visited, A:active, A:hover { =09color: #003366; } h1 A:link, h1 A:visited, h1 A:active { =09text-decoration: none; } h1 A:hover { border-bottom: 1px dotted #003366; } .wiki-content > :first-child, .commentblock > :first-child { margin-top: 3px; } .logocell { padding: 10px; } input { =09font-family: verdana, geneva, arial, sans-serif; =09font-size: 11px; =09color: #000000; } textarea, textarea.editor { =09font-family: verdana, geneva, arial, sans-serif; =09font-size: 11px; =09color: #333333; } /* use logoSpaceLink instead. .spacenametitle { =09font: 21px/31px Impact, Arial, Helvetica; font-weight: 100; color: #999999; =09margin: 0px; } .spacenametitle img { margin: 0 0 -4px 0; } .spacenametitle a { text-decoration: none; color: #999999; } .spacenametitle a:visited { text-decoration: none; color: #999999; }*/ .spacenametitle-printable { =09font: 20px/25px Impact, Arial, Helvetica; font-weight: 100; color: #999999; =09margin: 0px; } .spacenametitle-printable a { text-decoration: none; color: #999999; } .spacenametitle-printable a:visited { text-decoration: none; color: #999999; } .blogDate { =09font-weight: bold; =09text-decoration: none; =09color: black; } .blogSurtitle { background: #f0f0f0; =09border: 1px solid #ddd; =09padding: 3px; =09margin: 1px 1px 10px 1px; } .blogHeading { font-size: 20px; line-height: normal; font-weight: bold; padding: 0px; margin: 0px; } .blogHeading a { text-decoration: none; color: black; } .endsection { =09align: right; =09color: #666666; =09margin-top: 10px; } .endsectionleftnav { =09align: right; =09color: #666666; =09margin-top: 10px; } h1 { =09font-size: 24px; =09line-height: normal; =09font-weight: bold; =09background-color: #f0f0f0; =09color: #003366; =09border-bottom: 1px solid #3c78b5; =09padding: 2px; =09margin: 36px 0px 4px 0px; } h2 { =09font-size: 18px; =09line-height: normal; =09font-weight: bold; =09background-color: #f0f0f0; =09border-bottom: 1px solid #3c78b5; =09padding: 2px; =09margin: 27px 0px 4px 0px; } h3 { =09font-size: 14px; =09line-height: normal; =09font-weight: bold; =09background-color: #f0f0f0; =09padding: 2px; =09margin: 21px 0px 4px 0px; } h4 { =09font-size: 12px; =09line-height: normal; =09font-weight: bold; =09background-color: #f0f0f0; =09padding: 2px; =09margin: 18px 0px 4px 0px; } h4.search { =09font-size: 12px; =09line-height: normal; =09font-weight: normal; =09background-color: #f0f0f0; =09padding: 4px; =09margin: 18px 0px 4px 0px; } h5 { =09font-size: 10px; =09line-height: normal; =09font-weight: bold; =09background-color: #f0f0f0; =09padding: 2px; =09margin: 14px 0px 4px 0px; } h6 { =09font-size: 8px; =09line-height: normal; =09font-weight: bold; =09background-color: #f0f0f0; =09padding: 2px; =09margin: 14px 0px 4px 0px; } .smallfont { font-size: 10px; } .descfont { font-size: 10px; color: #666666; } .smallerfont { font-size: 9px; } .smalltext { color: #666666; font-size: 10px; } .smalltext a { color: #666666; } .smalltext-blue { color: #3c78b5; font-size: 10px; } .surtitle { margin-left: 1px; margin-bottom: 5px; font-size: 14px; color: #666666; } /* css hack found here: http://www.fo3nix.pwp.blueyonder.co.uk/tutorials/c= ss/hacks/ */ .navItemOver { font-size: 10px; font-weight: bold; color: #ffffff; backgrou= nd-color: #003366; cursor: hand; voice-family: '\'}\''; voice-family:inheri= t; cursor: pointer;} .navItemOver a { color: #ffffff; background-color:#003366; text-decoration:= none; } .navItemOver a:visited { color: #ffffff; background-color:#003366; text-dec= oration: none; } .navItemOver a:hover { color: #ffffff; background-color:#003366; text-decor= ation: none; } .navItem { font-size: 10px; font-weight: bold; color: #ffffff; background-c= olor: #3c78b5; } .navItem a { color: #ffffff; text-decoration: none; } .navItem a:hover { color: #ffffff; text-decoration: none; } .navItem a:visited { color: #ffffff; text-decoration: none; } div.padded { padding: 4px; } div.thickPadded { padding: 10px; } h3.macrolibrariestitle { margin: 0px 0px 0px 0px; } div.centered { text-align: center; margin: 10px; } div.centered table {margin: 0px auto; text-align: left; } .tableview table { margin: 0; } .tableview th { text-align: left; color: #003366; font-size: 12px; padding: 5px 0px 0px 5px; border-bottom: 2px solid #3c78b5; } .tableview td { text-align: left; border-color: #ccc; border-width: 0px 0px 1px 0px; border-style: solid; margin: 0; padding: 4px 10px 4px 5px; } .grid { margin: 2px 0px 5px 0px; border-collapse: collapse; } .grid th { border: 1px solid #ccc; padding: 2px 4px 2px 4px; background: #f0f0f0; text-align: center; } .grid td { border: 1px solid #ccc; padding: 3px 4px 3px 4px; } .gridHover { =09background-color: #f9f9f9; } td.infocell { background-color: #f0f0f0; } .label { =09font-weight: bold; =09color: #003366; } label { =09font-weight: bold; =09color: #003366; } .error { =09background-color: #fcc; } .errorBox { =09background-color: #fcc; border: 1px solid #c00; padding: 5px; margin: 5px; } .errorMessage { =09color: #c00; } .success { =09background-color: #dfd; } .successBox { =09background-color: #dfd; border: 1px solid #090; padding: 5px; margin-top:5px; margin-bottom:5px; } blockquote { =09padding-left: 10px; =09padding-right: 10px; =09margin-left: 5px; =09margin-right: 0px; =09border-left: 1px solid #3c78b5; } table.confluenceTable { margin: 5px; border-collapse: collapse; } /* Added as a temporary fix for CONF-4223. The table elements appear to be = inheriting the border: none attribute from the sectionMacro class */ table.confluenceTable td.confluenceTd { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; } /* Added as a temporary fix for CONF-4223. The table elements appear to be = inheriting the border: none attribute from the sectionMacro class */ table.confluenceTable th.confluenceTh { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; background-color: #f0f0f0; text-align: center; } td.confluenceTd { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; } th.confluenceTh { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; background-color: #f0f0f0; text-align: center; } DIV.small { =09font-size: 9px; } H1.pagename { =09margin-top: 0px; } IMG.inline {} .loginform { margin: 5px; border: 1px solid #ccc; } /* The text how the "This is a preview" comment should be shown. */ .previewnote { text-align: center; font-size: 11px; color: red; } /* How the preview content should be shown */ .previewcontent { background: #E0E0E0; } /* How the system messages should be shown (DisplayMessage.jsp) */ .messagecontent { background: #E0E0E0; } /* How the "This page has been modified..." -comment should be shown. */ .conflictnote { } .createlink { color: maroon; } a.createlink { color: maroon; } .templateparameter { font-size: 9px; color: darkblue; } .diffadded { background: #ddffdd; padding: 1px 1px 1px 4px; =09border-left: 4px solid darkgreen; } .diffdeleted { color: #999; background: #ffdddd; padding: 1px 1px 1px 4px; =09border-left: 4px solid darkred; } .diffnochange { padding: 1px 1px 1px 4px; =09border-left: 4px solid lightgrey; } .differror { background: brown; } .diff { font-family: lucida console, courier new, fixed-width; =09font-size: 12px; =09line-height: 14px; } .diffaddedchars { background-color:#99ff99; font-weight:bolder; } .diffremovedchars { background-color:#ff9999; text-decoration: line-through; font-weight:bolder; } .greybackground { background: #f0f0f0 } .greybox { =09border: 1px solid #ddd; =09padding: 3px; =09margin: 1px 1px 10px 1px; } .borderedGreyBox { border: 1px solid #cccccc; background-color: #f0f0f0; padding: 10px; } .greyboxfilled { =09border: 1px solid #ddd; background: #f0f0f0; padding: 3px; =09margin: 1px 1px 10px 1px; } .navBackgroundBox { padding: 5px 5px 5px 5px; font-size: 22px; =09font-weight: bold; =09font-family: Arial, sans-serif; =09color: white; background: #3c78b5; text-decoration: none; } .previewBoxTop { =09background-color: #f0f0f0; border-width: 1px 1px 0px 1px; border-style: solid; border-color: #3c78b5; padding: 5px; margin: 5px 0px 0px 0px; text-align: center; } .previewContent { background-color: #fff; =09border-color: #3c78b5; =09border-width: 0px 1px 0px 1px; =09border-style: solid; =09padding: 10px; =09margin: 0px; } .previewBoxBottom { =09background-color: #f0f0f0; border-width: 0px 1px 1px 1px; border-style: solid; border-color: #3c78b5; padding: 5px; margin: 0px 0px 5px 0px; text-align: center; } .functionbox { background-color: #f0f0f0; =09border: 1px solid #3c78b5; =09padding: 3px; =09margin: 1px 1px 10px 1px; } .functionbox-greyborder { background-color: #f0f0f0; =09border: 1px solid #ddd; =09padding: 3px; =09margin: 1px 1px 10px 1px; } .search-highlight { background-color: #ffffcc; } /* normal (white) background */ .rowNormal { background-color: #ffffff; } /* alternate (pale yellow) background */ .rowAlternate { background-color: #f7f7f7; } /* used in the list attachments table */ .rowAlternateNoBottomColor { background-color: #f7f7f7; } .rowAlternateNoBottomNoColor { } .rowAlternateNoBottomColor td { border-bottom: 0px; } .rowAlternateNoBottomNoColor td { border-bottom: 0px; } /* row highlight (grey) background */ .rowHighlight { background-color: #f0f0f0; } TD.greenbar {FONT-SIZE: 2px; BACKGROUND: #00df00; BORDER: 1px solid #9c9c9c= ; PADDING: 0px; } TD.redbar {FONT-SIZE: 2px; BACKGROUND: #df0000; BORDER: 1px solid #9c9c9c; = PADDING: 0px; } TD.darkredbar {FONT-SIZE: 2px; BACKGROUND: #af0000; BORDER: 1px solid #9c9c= 9c; PADDING: 0px; } TR.testpassed {FONT-SIZE: 2px; BACKGROUND: #ddffdd; PADDING: 0px; } TR.testfailed {FONT-SIZE: 2px; BACKGROUND: #ffdddd; PADDING: 0px; } .toolbar { margin: 0px; border-collapse: collapse; } .toolbar td { border: 1px solid #ccc; padding: 2px 2px 2px 2px; color: #ccc; } td.noformatting { border-width: 0px; border-style: none; text-align: center; =09padding: 0px; } .commentblock { margin: 12px 0 12px 0; } /* * Divs displaying the license information, if necessary. */ .license-eval, .license-none, .license-nonprofit { border-top: 1px solid #bbbbbb; text-align: center; font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; } .license-eval, .license-none { background-color: #ffcccc; } .license-eval b, .license-none b { color: #990000 } .license-nonprofit { background-color: #ffffff; } /* * The shadow at the bottom of the page between the main content and the * "powered by" section. */ .bottomshadow { height: 12px; background-image: url("$req.contextPath/images/border/border_bottom.gif= "); background-repeat: repeat-x; } /* * Styling of the operations box */ .navmenu .operations li, .navmenu .operations ul { list-style: none; margin-left: 0; padding-left: 0; } .navmenu .operations ul { margin-bottom: 9px; } .navmenu .label { font-weight: inherit; } /* * Styling of ops as a toolbar */ .toolbar div { display: none; } .toolbar .label { display: none; } .toolbar .operations { display: block; } .toolbar .operations ul { display: inline; list-style: none; margin-left: 10px; padding-left: 0; } .toolbar .operations li { list-style: none; display: inline; } /* list page navigational tabs */ #foldertab { padding: 3px 0px 3px 8px; margin-left: 0; border-bottom: 1px solid #3c78b5; font: bold 11px Verdana, sans-serif; } #foldertab li { list-style: none; margin: 0; display: inline; } #foldertab li a { padding: 3px 0.5em; margin-left: 3px; border: 1px solid #3c78b5; border-bottom: none; background: #3c78b5; text-decoration: none; } #foldertab li a:link { color: #ffffff; } #foldertab li a:visited { color: #ffffff; } #foldertab li a:hover { color: #ffffff; background: #003366; border-color: #003366; } #foldertab li a.current { background: white; border-bottom: 1px solid white; color: black; } #foldertab li a.current:link { color: black; } #foldertab li a.current:visited { color: black; } #foldertab li a.current:hover { background: white; border-bottom: 1px solid white; color: black; } /* alphabet list */ ul#squaretab { margin-left: 0; padding-left: 0; white-space: nowrap; font: bold 8px Verdana, sans-serif; } #squaretab li { display: inline; list-style-type: none; } #squaretab a { padding: 2px 6px; border: 1px solid #3c78b5; } #squaretab a:link, #squaretab a:visited { color: #fff; background-color: #3c78b5; text-decoration: none; } #squaretab a:hover { color: #ffffff; background-color: #003366; border-color: #003366; text-decoration: none; } #squaretab li a#current { background: white; color: black; } .blogcalendar * { font-family:verdana, arial, sans-serif; font-size:x-small; font-weight:normal; line-height:140%; padding:2px; } table.blogcalendar { border: 1px solid #3c78b5; } .blogcalendar th.calendarhead, a.calendarhead { font-size:x-small; font-weight:bold; padding:2px; text-transform:uppercase; background-color: #3c78b5; color: #ffffff; letter-spacing: .3em; text-transform: uppercase; } .calendarhead:visited {color: white;} .calendarhead:active {color: white;} .calendarhead:hover {color: white;} .blogcalendar th { font-size:x-small; font-weight:bold; padding:2px; background-color:#f0f0f0; } .blogcalendar td { font-size:x-small; font-weight:normal; } .searchGroup { padding: 0 0 10px 0; background: #f0f0f0; } .searchGroupHeading { font-size: 10px; font-weight: bold; color: #ffffff; b= ackground-color: #3c78b5; padding: 2px 4px 1px 4px; } .searchItem { padding: 1px 4px 1px 4px; } .searchItemSelected { padding: 1px 4px 1px 4px; font-weight: bold; backgrou= nd: #ddd; } /* permissions page styles */ .permissionHeading { border-bottom: #bbb; border-width: 0 0 1px 0; border-style: solid; font= -size: 16px; text-align: left; } .permissionTab { border-width: 0 0 0 1px; border-style: solid; background: #3c78b5; colo= r: #ffffff; font-size: 10px; } .permissionSuperTab { border-width: 0 0 0 1px; border-style: solid; background: #003366; colo= r: #ffffff; } .permissionCell { border-left: #bbb; border-width: 0 0 0 1px; border-style: solid; } /* warning panel */ .warningPanel { background: #FFFFCE; border:#F0C000 1px solid; padding: 8px= ; margin: 10px; } /* alert panel */ .alertPanel { background: #FFCCCC; border:#C00 1px solid; padding: 8px; mar= gin: 10px; } /* info panel */ .infoPanel { background: #D8E4F1; border:#3c78b5 1px solid; padding: 8px; m= argin: 10px; } /* side menu highlighting (e.g. space content screen) */ .optionPadded { padding: 2px; } .optionSelected { background-color: #ffffcc; padding: 2px; border: 1px soli= d #ddd; margin: -1px; } .optionSelected a { font-weight: bold; text-decoration: none; color: black;= } /* information macros */ .noteMacro { border-style: solid; border-width: 1px; border-color: #F0C000;= background-color: #FFFFCE; text-align:left; margin-top: 5px; margin-bottom= : 5px} .warningMacro { border-style: solid; border-width: 1px; border-color: #c00;= background-color: #fcc; text-align:left; margin-top: 5px; margin-bottom: 5= px} .infoMacro { border-style: solid; border-width: 1px; border-color: #3c78b5;= background-color: #D8E4F1; text-align:left; margin-top: 5px; margin-bottom= : 5px} .tipMacro { border-style: solid; border-width: 1px; border-color: #090; bac= kground-color: #dfd; text-align:left; margin-top: 5px; margin-bottom: 5px} .informationMacroPadding { padding: 5px 0 0 5px; } table.infoMacro td, table.warningMacro td, table.tipMacro td, table.noteMac= ro td, table.sectionMacro td { border: none; } table.sectionMacroWithBorder td.columnMacro { border-style: dashed; border-= width: 1px; border-color: #cccccc;} .pagecontent { padding: 10px; text-align: left; } /* styles for links in the top bar */ .topBarDiv a:link {color: #ffffff;} .topBarDiv a:visited {color: #ffffff;} .topBarDiv a:active {color: #ffffff;} .topBarDiv a:hover {color: #ffffff;} .topBarDiv {color: #ffffff;} .topBar { background-color: #003366; } /* styles for extended operations */ .greyLinks a:link {color: #666666; text-decoration:underline;} .greyLinks a:visited {color: #666666; text-decoration:underline;} .greyLinks a:active {color: #666666; text-decoration:underline;} .greyLinks a:hover {color: #666666; text-decoration:underline;} .greyLinks {color: #666666; display:block; padding: 10px} .logoSpaceLink {color: #999999; text-decoration: none} .logoSpaceLink a:link {color: #999999; text-decoration: none} .logoSpaceLink a:visited {color: #999999; text-decoration: none} .logoSpaceLink a:active {color: #999999; text-decoration: none} .logoSpaceLink a:hover {color: #003366; text-decoration: none} /* basic panel (basicpanel.vmd) style */ .basicPanelContainer {border: 1px solid #3c78b5; margin-top: 2px; margin-bo= ttom: 8px; width: 100%} .basicPanelTitle {padding: 5px; margin: 0px; background-color: #f0f0f0; col= or: black; font-weight: bold;} .basicPanelBody {padding: 5px; margin: 0px} .separatorLinks a:link {color: white} .separatorLinks a:visited {color: white} .separatorLinks a:active {color: white} .greynavbar {background-color: #f0f0f0; border-top: 1px solid #3c78b5; marg= in-top: 2px} div.headerField { float: left; width: auto; height: 100%; } .headerFloat { margin-left: auto; width: 50%; } .headerFloatLeft { float: left; margin-right: 20px; margin-bottom: 10px; } #headerRow { padding: 10px; } div.license-personal { background-color: #003366; color: #ffffff; } div.license-personal a { color: #ffffff; } .greyFormBox { border: 1px solid #cccccc; padding: 5px; } /* IE automatically adds a margin before and after form tags. Use this styl= e to remove that */ .marginlessForm { margin: 0px; } .openPageHighlight { background-color: #ffffcc; padding: 2px; border: 1px solid #ddd; } .editPageInsertLinks, .editPageInsertLinks a { color: #666666; font-weight: bold; font-size: 10px; } /* Style for label heatmap. */ .top10 a { font-weight: bold; font-size: 2em; color: #003366; } .top25 a { font-weight: bold; font-size: 1.6em; color: #003366; } .top50 a { font-size: 1.4em; color: #003366; } .top100 a { font-size: 1.2em; color: #003366; } .heatmap { list-style:none; width: 95%; margin: 0px auto; } .heatmap a { text-decoration:none; } .heatmap a:hover { text-decoration:underline; } .heatmap li { display: inline; } .minitab { padding: 3px 0px 3px 8px; margin-left: 0; margin-top: 1px; margin-bottom: 0px; border-bottom: 1px solid #3c78b5; font: bold 9px Verdana, sans-serif; text-decoration: none; float:none; } .selectedminitab { padding: 3px 0.5em; margin-left: 3px; margin-top: 1px; border: 1px solid #3c78b5; background: white; border-bottom: 1px solid white; color: #000000; text-decoration: none; } .unselectedminitab { padding: 3px 0.5em; margin-left: 3px; margin-top: 1px; border: 1px solid #3c78b5; border-bottom: none; background: #3c78b5; color: #ffffff; text-decoration: none; } a.unselectedminitab:hover { color: #ffffff; background: #003366; border-color: #003366; } a.unselectedminitab:link { color: white; } a.unselectedminitab:visited { color: white; } a.selectedminitab:link { color: black; } a.selectedminitab:visited { color: black; } .linkerror { background-color: #fcc;} a.labelOperationLink:link {text-decoration: underline} a.labelOperationLink:active {text-decoration: underline} a.labelOperationLink:visited {text-decoration: underline} a.labelOperationLink:hover {text-decoration: underline} a.newLabel:link {background-color: #ddffdd} a.newLabel:active {background-color: #ddffdd} a.newLabel:visited {background-color: #ddffdd} a.newLabel:hover {background-color: #ddffdd} ul.square {list-style-type: square} .inline-control-link { background: #ffc; font-size: 9px; color: #666; padding: 2px; text-transform: uppercase; text-decoration: none; } .inline-control-link a:link {text-decoration: none} .inline-control-link a:active {text-decoration: none} .inline-control-link a:visited {text-decoration: none} .inline-control-link a:hover {text-decoration: none} .inline-control-link { background: #ffc; font-size: 9px; color: #666; padding: 2px; text-transform: uppercase; text-decoration: none; cursor: pointer; } div.auto_complete { width: 350px; background: #fff; } div.auto_complete ul { border: 1px solid #888; margin: 0; padding: 0; width: 100%; list-style-type: none; } div.auto_complete ul li { margin: 0; padding: 3px; } div.auto_complete ul li.selected { background-color: #ffb; } div.auto_complete ul strong.highlight { color: #800; margin: 0; padding: 0; } /******* Edit Page Styles *******/ .toogleFormDiv{ border:1px solid #A7A6AA; background-color:white; padding:5px; margin-top: 5px; } .toogleInfoDiv{ border:1px solid #A7A6AA; background-color:white; display:none; padding:5px; margin-top: 10px; } .inputSection{ margin-bottom:20px; } #editBox{ border:1px solid lightgray; background-color:#F0F0F0; } /******* Left Navigation Theme Styles ********/ .leftnav li a { text-decoration:none; color:white; margin:0px; display:block; padding:2px; padding-left:5px; background-color: #3c78b5; border-top:1px solid #3c78b5; } .leftnav li a:active {color:white;} .leftnav li a:visited {color:white;} .leftnav li a:hover {background-color: #003366; color:white;} /* Added by Shaun during i18n */ .replaced { background-color: #33CC66; } .topPadding { margin-top: 20px; } /* new form style */ .form-block { padding: 6px; } .form-error-block { padding: 6px; background: #fcc; border-top: #f0f0f0 1px solid; border-bottom: #f0f0f0 1px solid; margin-bottom: 6px; padding: 0 12px 0 12px; } .form-element-large { font-size: 16px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; } .form-element-small { font-size: 12px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; } .form-header { background: lightyellow; border-top: #f0f0f0 1px solid; border-bottom: #f0f0f0 1px solid; margin-bottom: 6px; padding: 0 12px 0 12px; } .form-header p, .form-block p, .form-error-block p { line-height: normal; margin: 12px 0 12px 0; } .form-example { color: #888; font-size: 11px; } .form-divider { border-bottom: #ccc 1px solid; margin-bottom: 6px; } .form-buttons { margin-top: 6px; border-top: #ccc 1px solid; border-bottom: #ccc 1px solid; background: #f0f0f0; padding: 10px; text-align: center; } .form-buttons input { width: 100px; } .form-block .error { padding: 6px; margin-bottom: 6px; } --> </style> </head> <body> <div id=3D"PageContent"> <table class=3D"pagecontent" border=3D"0" cellpadding=3D"0" cellspacing=3D"= 0" width=3D"100%"><tr> <td valign=3D"top" class=3D"pagebody"> <div class=3D"pageheader"> <span class=3D"pagetitle"> Page Edited : <a href=3D"http://cwiki.apache.org/confluence/display/openjpa">= openjpa</a> : <a href=3D"http://cwiki.apache.org/confluence/display/openjpa/D= ownloads">Downloads</a> </span> </div> <p> <a href=3D"http://cwiki.apache.org/confluence/display/openjpa/Downl= oads">Downloads</a> has been edited by <a href=3D"http://cwiki.apache.org/c= onfluence/display/~michael.d.dick@gmail.com">Michael Dick</a> <span class=3D"smallfont">(Sep 23, 2008)</span>. </p> =20 <p> <a href=3D"http://cwiki.apache.org/confluence/pages/diffpa= gesbyversion.action?pageId=3D23613&originalVersion=3D42&revisedVersion=3D43= ">(View changes)</a> </p> <span class=3D"label">Content:</span><br/> <div class=3D"greybox wiki-content"> <h1><a name=3D"Downloads-OpenJPADownloads"></a>OpenJPA Downloads</h1> <p>Use the links below to download a distribution of Apache OpenJPA. It is = good practice to <a href=3D"#Downloads-VerifyingReleases" title=3D"Verifyin= g Releases on Downloads">verify the integrity</a> of the distribution files= .</p> <p>For information on obtaining OpenJPA binaries, see the <a href=3D"/confl= uence/display/openjpa/Obtaining" title=3D"Obtaining">Obtaining</a> page. Fo= r information on building OpenJPA from source, see the <a href=3D"/confluen= ce/display/openjpa/Building+OpenJPA" title=3D"Building OpenJPA">Building Op= enJPA</a> page.</p> <h2><a name=3D"Downloads-OfficialReleases"></a>Official Releases</h2> <h3><a name=3D"Downloads-1.2.xReleases"></a>1.2.x Releases</h3> <table class=3D'confluenceTable'><tbody> <tr> <th class=3D'confluenceTh'> </th> <th class=3D'confluenceTh'> Download </th> <th class=3D'confluenceTh'> Release Date </th> <th class=3D'confluenceTh'> Signatures </th> <th class=3D'confluenceTh'> Release Notes </th> </tr> <tr> <td class=3D'confluenceTd'> OpenJPA 1.2.0 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dyn/closer.cgi/openjpa/1.2.0/apache-openjpa-1.2.0-binary.zip" title= =3D"Visit page outside Confluence" rel=3D"nofollow">apache-openjpa-1.2.0-bi= nary.zip<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/link= ext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0= "/></sup></a></span> </td> <td class=3D'confluenceTd'> 14 Aug 2008 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dist/openjpa/1.2.0/apache-openjpa-1.2.0-binary.zip.asc" title=3D"Vis= it page outside Confluence" rel=3D"nofollow">PGP<sup><img class=3D"renderic= on" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"7" = align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://openjpa.= apache.org/builds/1.2.0/apache-openjpa-1.2.0/RELEASE-NOTES.html" title=3D"V= isit page outside Confluence" rel=3D"nofollow">Release Notes<sup><img class= =3D"rendericon" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" = width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </= td> </tr> <tr> <td class=3D'confluenceTd'> OpenJPA 1.2.0 Source Code </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dyn/closer.cgi/openjpa/1.2.0/apache-openjpa-1.2.0-source.zip" title= =3D"Visit page outside Confluence" rel=3D"nofollow">apache-openjpa-1.2.0-so= urce.zip<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/link= ext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0= "/></sup></a></span> </td> <td class=3D'confluenceTd'> 14 Aug 2008 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dist/openjpa/1.2.0/apache-openjpa-1.2.0-source.zip.asc" title=3D"Vis= it page outside Confluence" rel=3D"nofollow">PGP<sup><img class=3D"renderic= on" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"7" = align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> </td> </tr> </tbody></table> <h3><a name=3D"Downloads-1.1.xReleases"></a>1.1.x Releases</h3> <table class=3D'confluenceTable'><tbody> <tr> <th class=3D'confluenceTh'> </th> <th class=3D'confluenceTh'> Download </th> <th class=3D'confluenceTh'> Release Date </th> <th class=3D'confluenceTh'> Signatures </th> <th class=3D'confluenceTh'> Release Notes </th> </tr> <tr> <td class=3D'confluenceTd'> OpenJPA 1.1.0 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dyn/closer.cgi/openjpa/1.1.0/apache-openjpa-1.1.0-binary.zip" title= =3D"Visit page outside Confluence" rel=3D"nofollow">apache-openjpa-1.1.0-bi= nary.zip<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/link= ext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0= "/></sup></a></span> </td> <td class=3D'confluenceTd'> 22 May 2008 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dist/openjpa/1.1.0/apache-openjpa-1.1.0-binary.zip.asc" title=3D"Vis= it page outside Confluence" rel=3D"nofollow">PGP<sup><img class=3D"renderic= on" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"7" = align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://openjpa.= apache.org/builds/1.1.0/apache-openjpa-1.1.0/RELEASE-NOTES.html" title=3D"V= isit page outside Confluence" rel=3D"nofollow">Release Notes<sup><img class= =3D"rendericon" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" = width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </= td> </tr> <tr> <td class=3D'confluenceTd'> OpenJPA 1.1.0 Source Code </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dyn/closer.cgi/openjpa/1.1.0/apache-openjpa-1.1.0-source.zip" title= =3D"Visit page outside Confluence" rel=3D"nofollow">apache-openjpa-1.1.0-so= urce.zip<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/link= ext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0= "/></sup></a></span> </td> <td class=3D'confluenceTd'> 22 May 2008 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dist/openjpa/1.1.0/apache-openjpa-1.1.0-source.zip.asc" title=3D"Vis= it page outside Confluence" rel=3D"nofollow">PGP<sup><img class=3D"renderic= on" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"7" = align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> </td> </tr> </tbody></table> <h3><a name=3D"Downloads-1.0.xReleases"></a>1.0.x Releases</h3> <table class=3D'confluenceTable'><tbody> <tr> <th class=3D'confluenceTh'> </th> <th class=3D'confluenceTh'> Download </th> <th class=3D'confluenceTh'> Release Date </th> <th class=3D'confluenceTh'> Signatures </th> <th class=3D'confluenceTh'> Release Notes </th> </tr> <tr> <td class=3D'confluenceTd'> OpenJPA 1.0.3 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dyn/closer.cgi/openjpa/1.0.3/apache-openjpa-1.0.3-binary.zip" title= =3D"Visit page outside Confluence" rel=3D"nofollow">apache-openjpa-1.0.3-bi= nary.zip<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/link= ext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0= "/></sup></a></span> </td> <td class=3D'confluenceTd'> 25 Jul 2008 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dist/openjpa/1.0.3/apache-openjpa-1.0.3-binary.zip.asc" title=3D"Vis= it page outside Confluence" rel=3D"nofollow">PGP<sup><img class=3D"renderic= on" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"7" = align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://openjpa.= apache.org/builds/1.0.3/apache-openjpa-1.0.3/RELEASE-NOTES.html" title=3D"V= isit page outside Confluence" rel=3D"nofollow">Release Notes<sup><img class= =3D"rendericon" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" = width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </= td> </tr> <tr> <td class=3D'confluenceTd'> OpenJPA 1.0.3 Source Code </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dyn/closer.cgi/openjpa/1.0.3/apache-openjpa-1.0.3-source.zip" title= =3D"Visit page outside Confluence" rel=3D"nofollow">apache-openjpa-1.0.3-so= urce.zip<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/link= ext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0= "/></sup></a></span> </td> <td class=3D'confluenceTd'> 25 Jul 2008 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dist/openjpa/1.0.3/apache-openjpa-1.0.3-source.zip.asc" title=3D"Vis= it page outside Confluence" rel=3D"nofollow">PGP<sup><img class=3D"renderic= on" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"7" = align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> </td> </tr> <tr> <td class=3D'confluenceTd'> OpenJPA 1.0.2 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dyn/closer.cgi/openjpa/1.0.2/apache-openjpa-1.0.2-binary.zip" title= =3D"Visit page outside Confluence" rel=3D"nofollow">apache-openjpa-1.0.2-bi= nary.zip<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/link= ext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0= "/></sup></a></span> </td> <td class=3D'confluenceTd'> 18 Feb 2008 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dist/openjpa/1.0.2/apache-openjpa-1.0.2-binary.zip.asc" title=3D"Vis= it page outside Confluence" rel=3D"nofollow">PGP<sup><img class=3D"renderic= on" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"7" = align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://openjpa.= apache.org/builds/1.0.2/apache-openjpa-1.0.2/RELEASE-NOTES.html" title=3D"V= isit page outside Confluence" rel=3D"nofollow">Release Notes<sup><img class= =3D"rendericon" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" = width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </= td> </tr> <tr> <td class=3D'confluenceTd'> OpenJPA 1.0.2 Source Code </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dyn/closer.cgi/openjpa/1.0.2/apache-openjpa-1.0.2-source.zip" title= =3D"Visit page outside Confluence" rel=3D"nofollow">apache-openjpa-1.0.2-so= urce.zip<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/link= ext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0= "/></sup></a></span> </td> <td class=3D'confluenceTd'> 18 Feb 2008 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dist/openjpa/1.0.2/apache-openjpa-1.0.2-source.zip.asc" title=3D"Vis= it page outside Confluence" rel=3D"nofollow">PGP<sup><img class=3D"renderic= on" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"7" = align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> </td> </tr> <tr> <td class=3D'confluenceTd'> OpenJPA 1.0.1 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dyn/closer.cgi/openjpa/1.0.1/apache-openjpa-1.0.1-binary.zip" title= =3D"Visit page outside Confluence" rel=3D"nofollow">apache-openjpa-1.0.1-bi= nary.zip<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/link= ext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0= "/></sup></a></span> </td> <td class=3D'confluenceTd'> 9 Nov 2007 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dist/openjpa/1.0.1/apache-openjpa-1.0.1-binary.zip.asc" title=3D"Vis= it page outside Confluence" rel=3D"nofollow">PGP<sup><img class=3D"renderic= on" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"7" = align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://openjpa.= apache.org/builds/1.0.1/apache-openjpa-1.0.1/RELEASE-NOTES.html" title=3D"V= isit page outside Confluence" rel=3D"nofollow">Release Notes<sup><img class= =3D"rendericon" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" = width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </= td> </tr> <tr> <td class=3D'confluenceTd'> OpenJPA 1.0.1 Source Code </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dyn/closer.cgi/openjpa/1.0.1/apache-openjpa-1.0.1-source.zip" title= =3D"Visit page outside Confluence" rel=3D"nofollow">apache-openjpa-1.0.1-so= urce.zip<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/link= ext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0= "/></sup></a></span> </td> <td class=3D'confluenceTd'> 9 Nov 2007 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dist/openjpa/1.0.1/apache-openjpa-1.0.1-source.zip.asc" title=3D"Vis= it page outside Confluence" rel=3D"nofollow">PGP<sup><img class=3D"renderic= on" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"7" = align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> </td> </tr> <tr> <td class=3D'confluenceTd'> OpenJPA 1.0.0 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dyn/closer.cgi/openjpa/1.0.0/apache-openjpa-1.0.0-binary.zip" title= =3D"Visit page outside Confluence" rel=3D"nofollow">apache-openjpa-1.0.0-bi= nary.zip<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/link= ext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0= "/></sup></a></span> </td> <td class=3D'confluenceTd'> 28 Aug 2007 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dist/openjpa/1.0.0/apache-openjpa-1.0.0-binary.zip.asc" title=3D"Vis= it page outside Confluence" rel=3D"nofollow">PGP<sup><img class=3D"renderic= on" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"7" = align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://openjpa.= apache.org/builds/1.0.0/apache-openjpa-1.0.0/RELEASE-NOTES.html" title=3D"V= isit page outside Confluence" rel=3D"nofollow">Release Notes<sup><img class= =3D"rendericon" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" = width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </= td> </tr> <tr> <td class=3D'confluenceTd'> OpenJPA 1.0.0 Source Code </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dyn/closer.cgi/openjpa/1.0.0/apache-openjpa-1.0.0-source.zip" title= =3D"Visit page outside Confluence" rel=3D"nofollow">apache-openjpa-1.0.0-so= urce.zip<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/link= ext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0= "/></sup></a></span> </td> <td class=3D'confluenceTd'> 28 Au 2007 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://www.apac= he.org/dist/openjpa/1.0.0/apache-openjpa-1.0.0-source.zip.asc" title=3D"Vis= it page outside Confluence" rel=3D"nofollow">PGP<sup><img class=3D"renderic= on" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"7" = align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> </td> </tr> </tbody></table> <h2><a name=3D"Downloads-OlderincubatingReleases"></a>Older incubating Rele= ases</h2> <table class=3D'confluenceTable'><tbody> <tr> <th class=3D'confluenceTh'> </th> <th class=3D'confluenceTh'> Download </th> <th class=3D'confluenceTh'> Release Date </th> <th class=3D'confluenceTh'> Signatures </th> </tr> <tr> <td class=3D'confluenceTd'> OpenJPA 0.9.7 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://people.a= pache.org/repo/m2-incubating-repository/org/apache/openjpa/openjpa-project/= 0.9.7-incubating/openjpa-project-0.9.7-incubating-binary.zip" title=3D"Visi= t page outside Confluence" rel=3D"nofollow">openjpa-project-0.9.7-incubatin= g-binary.zip<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/= linkext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border= =3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> 27 April 2007 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://people.a= pache.org/repo/m2-incubating-repository/org/apache/openjpa/openjpa-project/= 0.9.7-incubating/openjpa-project-0.9.7-incubating-binary.zip.md5" title=3D"= Visit page outside Confluence" rel=3D"nofollow">MD5<sup><img class=3D"rende= ricon" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"= 7" align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> <span class= =3D"nobr"><a href=3D"http://people.apache.org/repo/m2-incubating-repository= /org/apache/openjpa/openjpa-project/0.9.7-incubating/openjpa-project-0.9.7-= incubating-binary.zip.asc" title=3D"Visit page outside Confluence" rel=3D"n= ofollow">PGP<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/= linkext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border= =3D"0"/></sup></a></span> </td> </tr> <tr> <td class=3D'confluenceTd'> OpenJPA 0.9.7 Source Code </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://people.a= pache.org/repo/m2-incubating-repository/org/apache/openjpa/openjpa-project/= 0.9.7-incubating/openjpa-project-0.9.7-incubating-source.zip" title=3D"Visi= t page outside Confluence" rel=3D"nofollow">openjpa-project-0.9.7-incubatin= g-source.zip<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/= linkext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border= =3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> 27 April 2007 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://people.a= pache.org/repo/m2-incubating-repository/org/apache/openjpa/openjpa-project/= 0.9.7-incubating/openjpa-project-0.9.7-incubating-source.zip.md5" title=3D"= Visit page outside Confluence" rel=3D"nofollow">MD5<sup><img class=3D"rende= ricon" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"= 7" align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> <span class= =3D"nobr"><a href=3D"http://people.apache.org/repo/m2-incubating-repository= /org/apache/openjpa/openjpa-project/0.9.7-incubating/openjpa-project-0.9.7-= incubating-source.zip.asc" title=3D"Visit page outside Confluence" rel=3D"n= ofollow">PGP<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/= linkext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border= =3D"0"/></sup></a></span> </td> </tr> <tr> <td class=3D'confluenceTd'> OpenJPA 0.9.6 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://people.a= pache.org/repo/m2-incubating-repository/org/apache/openjpa/openjpa-project/= 0.9.6-incubating/openjpa-project-0.9.6-incubating-binary.zip" title=3D"Visi= t page outside Confluence" rel=3D"nofollow">openjpa-project-0.9.6-incubatin= g-binary.zip <sup><img class=3D"rendericon" src=3D"/confluence/images/icons= /linkext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border= =3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> 29 November 2006 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://people.a= pache.org/repo/m2-incubating-repository/org/apache/openjpa/openjpa-project/= 0.9.6-incubating/openjpa-project-0.9.6-incubating-binary.zip.md5" title=3D"= Visit page outside Confluence" rel=3D"nofollow">MD5<sup><img class=3D"rende= ricon" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"= 7" align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> <span class= =3D"nobr"><a href=3D"http://people.apache.org/repo/m2-incubating-repository= /org/apache/openjpa/openjpa-project/0.9.6-incubating/openjpa-project-0.9.6-= incubating-binary.zip.asc" title=3D"Visit page outside Confluence" rel=3D"n= ofollow">PGP<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/= linkext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border= =3D"0"/></sup></a></span> </td> </tr> <tr> <td class=3D'confluenceTd'> OpenJPA 0.9.6 Source Code </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://people.a= pache.org/repo/m2-incubating-repository/org/apache/openjpa/openjpa-project/= 0.9.6-incubating/openjpa-project-0.9.6-incubating-source.zip" title=3D"Visi= t page outside Confluence" rel=3D"nofollow">openjpa-project-0.9.6-incubatin= g-source.zip <sup><img class=3D"rendericon" src=3D"/confluence/images/icons= /linkext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border= =3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> 29 November 2006 </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://people.a= pache.org/repo/m2-incubating-repository/org/apache/openjpa/openjpa-project/= 0.9.6-incubating/openjpa-project-0.9.6-incubating-source.zip.md5" title=3D"= Visit page outside Confluence" rel=3D"nofollow">MD5<sup><img class=3D"rende= ricon" src=3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"= 7" align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span> <span class= =3D"nobr"><a href=3D"http://people.apache.org/repo/m2-incubating-repository= /org/apache/openjpa/openjpa-project/0.9.6-incubating/openjpa-project-0.9.6-= incubating-source.zip.asc" title=3D"Visit page outside Confluence" rel=3D"n= ofollow">PGP<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/= linkext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border= =3D"0"/></sup></a></span> </td> </tr> </tbody></table> <h2><a name=3D"Downloads-NightlySnapshots"></a>Nightly Snapshots</h2> <p>These distributions are built and deployed nightly, and contain up-to-da= te fixes and improvements. However, their stability cannot be guaranteed. U= se at your own risk.</p> <table class=3D'confluenceTable'><tbody> <tr> <th class=3D'confluenceTh'> </th> <th class=3D'confluenceTh'> Download </th> <th class=3D'confluenceTh'> Signatures </th> </tr> <tr> <td class=3D'confluenceTd'> Nightly build<br clear=3D"all" /> </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://openjpa.= apache.org/builds/latest/downloads/apache-openjpa-1.3.0-SNAPSHOT-binary.zip= " title=3D"Visit page outside Confluence" rel=3D"nofollow">apache-openjpa-1= .3.0-SNAPSHOT-binary.zip<sup><img class=3D"rendericon" src=3D"/confluence/i= mages/icons/linkext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt= =3D"" border=3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://openjpa.= apache.org/builds/latest/downloads/apache-openjpa-1.3.0-SNAPSHOT-binary.zip= .MD5" title=3D"Visit page outside Confluence" rel=3D"nofollow">MD5<sup><img= class=3D"rendericon" src=3D"/confluence/images/icons/linkext7.gif" height= =3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></s= pan> </td> </tr> <tr> <td class=3D'confluenceTd'> Nightly build Source Code<br clear=3D"all" /> <= /td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://openjpa.= apache.org/builds/latest/downloads/apache-openjpa-1.3.0-SNAPSHOT-source.zip= " title=3D"Visit page outside Confluence" rel=3D"nofollow">apache-openjpa-1= .3.0-SNAPSHOT-source.zip<sup><img class=3D"rendericon" src=3D"/confluence/i= mages/icons/linkext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt= =3D"" border=3D"0"/></sup></a></span> </td> <td class=3D'confluenceTd'> <span class=3D"nobr"><a href=3D"http://openjpa.= apache.org/builds/latest/downloads/apache-openjpa-1.3.0-SNAPSHOT-source.zip= .MD5" title=3D"Visit page outside Confluence" rel=3D"nofollow">MD5<sup><img= class=3D"rendericon" src=3D"/confluence/images/icons/linkext7.gif" height= =3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></s= pan> </td> </tr> </tbody></table> <p>OpenJPA jar is self-describing and after downloading a nightly snapshot,= you can find out the latest revision number included in the build by</p> <div class=3D"code"><div class=3D"codeHeader"><b>Determining Revision numbe= r included in a particular build</b></div><div class=3D"codeContent"> <pre class=3D"code-none">% java -jar you/path/to/openjpa.jar | grep revisio= n</pre> </div></div> <p>will print the revision numbers, for example, as</p> <div class=3D"code"><div class=3D"codeContent"> <pre class=3D"code-none">Apache svn revision: 422266:686421</pre> </div></div> <p>which designates that the nightly build includes Apache SVN revision <tt= >686421</tt> as the latest.</p> <h2><a name=3D"Downloads-VerifyingReleases"></a>Verifying Releases</h2> <p>We strongly recommend you verify the integrity of the downloaded files w= ith both PGP and MD5. The PGP signatures can be verified using <span class= =3D"nobr"><a href=3D"http://www.pgpi.org/" title=3D"Visit page outside Conf= luence" rel=3D"nofollow">PGP<sup><img class=3D"rendericon" src=3D"/confluen= ce/images/icons/linkext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" = alt=3D"" border=3D"0"/></sup></a></span> or <span class=3D"nobr"><a href=3D= "http://www.gnupg.org/" title=3D"Visit page outside Confluence" rel=3D"nofo= llow">GPG<sup><img class=3D"rendericon" src=3D"/confluence/images/icons/lin= kext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"= 0"/></sup></a></span>. First download the <span class=3D"nobr"><a href=3D"h= ttp://apache.org/dist/openjpa/KEYS" title=3D"Visit page outside Confluence"= rel=3D"nofollow">KEYS<sup><img class=3D"rendericon" src=3D"/confluence/ima= ges/icons/linkext7.gif" height=3D"7" width=3D"7" align=3D"absmiddle" alt=3D= "" border=3D"0"/></sup></a></span> as well as the <tt>*.asc</tt> signat= ure file for the particular distribution. Make sure you get these files fro= m the main distribution directory, rather than from a mirror. Then verify t= he signatures using one of the following sets of commands:</p> <div class=3D"code"><div class=3D"codeHeader"><b>Verifying Release Files us= ing the pgpk Utility</b></div><div class=3D"codeContent"> <pre class=3D"code-none">% pgpk -a KEYS % pgpv openjpa-*.zip.asc</pre> </div></div> <div class=3D"code"><div class=3D"codeHeader"><b>Verifying Release Files us= ing the pgp Utility</b></div><div class=3D"codeContent"> <pre class=3D"code-none">% pgp -ka KEYS % pgp openjpa-*.zip.asc</pre> </div></div> <div class=3D"code"><div class=3D"codeHeader"><b>Verifying Release Files us= ing the gpg Utility</b></div><div class=3D"codeContent"> <pre class=3D"code-none">% gpg --import KEYS % gpg --verify openjpa-*.zip.asc</pre> </div></div> <p>Alternatively, you can verify the checksums on the files. Unix programs = called <b>md5</b>/<b>sha1</b> or <b>md5sum</b>/<b>sha1sum</b> are included = in many unix distributions. *sum is also available as part of <span cla= ss=3D"nobr"><a href=3D"http://www.gnu.org/software/textutils/textutils.html= " title=3D"Visit page outside Confluence" rel=3D"nofollow">GNU Textutils<su= p><img class=3D"rendericon" src=3D"/confluence/images/icons/linkext7.gif" h= eight=3D"7" width=3D"7" align=3D"absmiddle" alt=3D"" border=3D"0"/></sup></= a></span>. Windows users can get binary md5 programs from <span class=3D"no= br"><a href=3D"http://www.fourmilab.ch/md5/" title=3D"Visit page outside Co= nfluence" rel=3D"nofollow">here<sup><img class=3D"rendericon" src=3D"/confl= uence/images/icons/linkext7.gif" height=3D"7" width=3D"7" align=3D"absmiddl= e" alt=3D"" border=3D"0"/></sup></a></span> or <span class=3D"nobr"><a href= =3D"http://www.pc-tools.net/win32/freeware/console/" title=3D"Visit page ou= tside Confluence" rel=3D"nofollow">here<sup><img class=3D"rendericon" src= =3D"/confluence/images/icons/linkext7.gif" height=3D"7" width=3D"7" align= =3D"absmiddle" alt=3D"" border=3D"0"/></sup></a></span>. <span class=3D"nob= r"><a href=3D"http://www.slavasoft.com/fsum/" title=3D"Visit page outside C= onfluence" rel=3D"nofollow">fsum<sup><img class=3D"rendericon" src=3D"/conf= luence/images/icons/linkext7.gif" height=3D"7" width=3D"7" align=3D"absmidd= le" alt=3D"" border=3D"0"/></sup></a></span> supports MD5 and SHA1.</p></di= v> </td></tr></table></div> <p> <table border=3D"0" cellpadding=3D"0" cellspacing=3D"0" width=3D"100%"> <tr> <td height=3D"12" background=3D"http://cwiki.apache.org/confluence/= images/border/border_bottom.gif"><img src=3D"http://cwiki.apache.org/conflu= ence/images/border/spacer.gif" width=3D"1" height=3D"1" border=3D"0"/></td> </tr> </table> <div class=3D"smalltext"> Powered by <a href=3D"http://www.atlassian.com/software/confluence/default.jsp?cli= cked=3Dfooter" class=3D"smalltext">Atlassian Confluence</a> (Version: 2.2.9 Build:#527 Sep 07, 2006) - <a href=3D"http://jira.atlassian.com/secure/BrowseProject.jspa?id=3D104= 70" class=3D"smalltext">Bug/feature request</a><br/> <br> <a href=3D"http://cwiki.apache.org/confluence/users/viewnotifications.a= ction">Unsubscribe or edit your notifications preferences</a> </div> </body> </html> From commits-return-3401-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Tue Sep 23 18:58:53 2008 Return-Path: <commits-return-3401-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 50142 invoked from network); 23 Sep 2008 18:58:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 23 Sep 2008 18:58:53 -0000 Received: (qmail 2716 invoked by uid 500); 23 Sep 2008 18:58:51 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 2704 invoked by uid 500); 23 Sep 2008 18:58:51 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 2695 invoked by uid 99); 23 Sep 2008 18:58:51 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Sep 2008 11:58:51 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Sep 2008 18:57:58 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id EC3912388970; Tue, 23 Sep 2008 11:58:01 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r698284 - in /openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/meta/ openjpa-persistence/src/main/java/org/apache/openjpa/persistence/ openjpa-slice/src/main/java/org/apache/openjpa/slice/ openjpa-slice/src/main/java/org/apach... Date: Tue, 23 Sep 2008 18:58:01 -0000 To: commits@openjpa.apache.org From: ppoddar@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080923185801.EC3912388970@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ppoddar Date: Tue Sep 23 11:58:00 2008 New Revision: 698284 URL: http://svn.apache.org/viewvc?rev=698284&view=rev Log: Introduces notion of @Replicated entity. This feature allows to relax collocation constraint for quasi-stationary master data. A replicated entity is stored as identical copies across multiple slices. The ReplicationStrategy works similar to DistributionStrategy for replicated entity. The slice association cardinality has uniformly changed to array of slices from a single slice name both for replicated and non-replicated entity. The non-replicated entities can refer to replicated entities but not vice versa. The query operation (especially the ones with aggregate function) is aware of replicated data and queries only one of the slices to avoid duplication. Added: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/Replicated.java openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/ReplicationPolicy.java openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/SliceImplHelper.java openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/Country.java Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/MetaDataTag.java openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/DistributedBrokerImpl.java openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/DistributedConfiguration.java openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/DistributionPolicy.java openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/ProductDerivation.java openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/SlicePersistence.java openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCConfigurationImpl.java openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedStoreManager.java openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedStoreQuery.java openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/Address.java openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/TestBasic.java openjpa/trunk/openjpa-slice/src/test/resources/META-INF/persistence.xml Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java?rev=698284&r1=698283&r2=698284&view=diff ============================================================================== --- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java (original) +++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/meta/ClassMetaData.java Tue Sep 23 11:58:00 2008 @@ -164,7 +164,8 @@ private int _identity = ID_UNKNOWN; private int _idStrategy = ValueStrategies.NONE; private int _accessType = ACCESS_UNKNOWN; - + private boolean _replicated = false; + private String _seqName = DEFAULT_STRING; private SequenceMetaData _seqMeta = null; private String _cacheName = DEFAULT_STRING; @@ -2401,4 +2402,20 @@ Collections.sort(result); return result.toArray(new String[result.size()]); } + + /** + * Affirms the persistence instances of this receiver is replicated across + * multiple databases. + */ + public boolean isReplicated() { + return _replicated; + } + + /** + * Sets the persistence instances of this receiver to be replicated across + * multiple databases. + */ + public void setReplicated(boolean flag) { + _replicated = flag; + } } Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java?rev=698284&r1=698283&r2=698284&view=diff ============================================================================== --- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java (original) +++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/AnnotationPersistenceMetaDataParser.java Tue Sep 23 11:58:00 2008 @@ -175,6 +175,7 @@ _tags.put(ManagedInterface.class, MANAGED_INTERFACE); _tags.put(ReadOnly.class, READ_ONLY); _tags.put(Type.class, TYPE); + _tags.put(Replicated.class, REPLICATED); } private final OpenJPAConfiguration _conf; @@ -577,6 +578,9 @@ if (isMetaDataMode()) parseManagedInterface(meta, (ManagedInterface) anno); break; + case REPLICATED: + meta.setReplicated(true); + break; default: throw new UnsupportedException(_loc.get("unsupported", _cls, anno.toString())); Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/MetaDataTag.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/MetaDataTag.java?rev=698284&r1=698283&r2=698284&view=diff ============================================================================== --- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/MetaDataTag.java (original) +++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/MetaDataTag.java Tue Sep 23 11:58:00 2008 @@ -80,4 +80,5 @@ MANAGED_INTERFACE, READ_ONLY, TYPE, + REPLICATED } Added: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/Replicated.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/Replicated.java?rev=698284&view=auto ============================================================================== --- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/Replicated.java (added) +++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/Replicated.java Tue Sep 23 11:58:00 2008 @@ -0,0 +1,44 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.persistence; + +import static java.lang.annotation.ElementType.TYPE; +import static java.lang.annotation.RetentionPolicy.RUNTIME; + +import java.lang.annotation.Retention; +import java.lang.annotation.Target; + +/** + * Annotation to specify the instance of the annotated entity be + * replicated across more than one <em>slices</em>. The actual slices where an + * instance of the annotated entity will be replicated is determined by + * the return value of user-specified + * {@link ReplicationPolicy#replicate(Object, java.util.List, Object)} + * method. + * + * @see ReplicationPolicy + * + * @author Pinaki Poddar + * + */ +@Target({ TYPE }) +@Retention(RUNTIME) +public @interface Replicated { + +} Modified: openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/DistributedBrokerImpl.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/DistributedBrokerImpl.java?rev=698284&r1=698283&r2=698284&view=diff ============================================================================== --- openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/DistributedBrokerImpl.java (original) +++ openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/DistributedBrokerImpl.java Tue Sep 23 11:58:00 2008 @@ -22,7 +22,6 @@ import org.apache.openjpa.kernel.OpCallbacks; import org.apache.openjpa.kernel.OpenJPAStateManager; import org.apache.openjpa.lib.util.Localizer; -import org.apache.openjpa.util.UserException; /** * A specialized Broker to associate slice identifiers with the StateManagers as @@ -36,11 +35,17 @@ */ @SuppressWarnings("serial") public class DistributedBrokerImpl extends FinalizingBrokerImpl { - private transient String slice; - + private transient String _rootSlice; + private transient DistributedConfiguration _conf; private static final Localizer _loc = Localizer.forPackage(DistributedBrokerImpl.class); + public DistributedConfiguration getConfiguration() { + if (_conf == null) { + _conf = (DistributedConfiguration)super.getConfiguration(); + } + return _conf; + } /** * Assigns slice identifier to the resultant StateManager as initialized by * the super class implementation. The slice identifier is decided by @@ -54,32 +59,28 @@ public OpenJPAStateManager persist(Object pc, Object id, boolean explicit, OpCallbacks call) { OpenJPAStateManager sm = getStateManager(pc); + String[] targets = null; + boolean replicated = SliceImplHelper.isReplicated(sm); if (getOperatingSet().isEmpty() - && (sm == null || sm.getImplData() == null)) { - slice = getSlice(pc); + && (sm == null || sm.getImplData() == null)) { + targets = SliceImplHelper.getSlicesByPolicy(pc, getConfiguration(), + this); + if (!replicated) { + _rootSlice = targets[0]; + } } sm = super.persist(pc, id, explicit, call); - if (sm.getImplData() == null) - sm.setImplData(slice, true); - + if (sm.getImplData() == null) { + if (targets == null) { + targets = replicated + ? SliceImplHelper.getSlicesByPolicy(pc, getConfiguration(), this) + : new String[]{_rootSlice}; + } + sm.setImplData(targets, true); + } return sm; } - /** - * Gets the slice by the user-defined distribution policy. - */ - String getSlice(Object pc) { - DistributedConfiguration conf = - (DistributedConfiguration) getConfiguration(); - String slice = - (conf.getDistributionPolicyInstance().distribute(pc, conf - .getActiveSliceNames(), this)); - if (!conf.getActiveSliceNames().contains(slice)) - throw new UserException(_loc.get("bad-policy-slice", new Object[] { - conf.getDistributionPolicyInstance().getClass().getName(), - slice, pc, conf.getActiveSliceNames() })); - return slice; - } @Override public boolean endOperation() { Modified: openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/DistributedConfiguration.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/DistributedConfiguration.java?rev=698284&r1=698283&r2=698284&view=diff ============================================================================== --- openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/DistributedConfiguration.java (original) +++ openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/DistributedConfiguration.java Tue Sep 23 11:58:00 2008 @@ -75,4 +75,10 @@ * the available slices. */ DistributionPolicy getDistributionPolicyInstance(); + + /** + * Gets the policy that governs how new replicated instances will be + * replicated across the available slices. + */ + ReplicationPolicy getReplicationPolicyInstance(); } Modified: openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/DistributionPolicy.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/DistributionPolicy.java?rev=698284&r1=698283&r2=698284&view=diff ============================================================================== --- openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/DistributionPolicy.java (original) +++ openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/DistributionPolicy.java Tue Sep 23 11:58:00 2008 @@ -19,6 +19,7 @@ package org.apache.openjpa.slice; import java.util.List; +import java.util.Random; /** @@ -44,4 +45,16 @@ * @see DistributedConfiguration#getActiveSliceNames() */ String distribute(Object pc, List<String> slices, Object context); + + /** + * Implements a default distribution policy to store the given + * instance to a randomly selected available slice. + * + */ + public static class Default implements DistributionPolicy { + private static Random RNG = new Random(); + public String distribute(Object pc, List<String> slices, Object ctx) { + return slices.get(RNG.nextInt(slices.size())); + } + } } Modified: openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/ProductDerivation.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/ProductDerivation.java?rev=698284&r1=698283&r2=698284&view=diff ============================================================================== --- openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/ProductDerivation.java (original) +++ openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/ProductDerivation.java Tue Sep 23 11:58:00 2008 @@ -22,7 +22,9 @@ import org.apache.openjpa.conf.OpenJPAProductDerivation; import org.apache.openjpa.lib.conf.AbstractProductDerivation; +import org.apache.openjpa.lib.conf.Configuration; import org.apache.openjpa.slice.jdbc.DistributedJDBCBrokerFactory; +import org.apache.openjpa.slice.jdbc.DistributedJDBCConfigurationImpl; /** * Derives configuration for Slice. @@ -58,6 +60,28 @@ } public int getType() { - return TYPE_FEATURE; + return TYPE_STORE; } + + /** + * Sets the {@link DistributionPolicy} and {@link ReplicationPolicy} to + * their respective defaults if not set by the user. + */ + @Override + public boolean afterSpecificationSet(Configuration c) { + if (!(c instanceof DistributedJDBCConfigurationImpl)) + return false; + DistributedJDBCConfigurationImpl conf = + (DistributedJDBCConfigurationImpl)c; + boolean modified = false; + if (conf.getDistributionPolicyInstance() == null) { + conf.distributionPolicyPlugin.setString("random"); + modified = true; + } + if (conf.getReplicationPolicyInstance() == null) { + conf.replicationPolicyPlugin.setString("all"); + modified = true; + } + return modified; + } } Added: openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/ReplicationPolicy.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/ReplicationPolicy.java?rev=698284&view=auto ============================================================================== --- openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/ReplicationPolicy.java (added) +++ openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/ReplicationPolicy.java Tue Sep 23 11:58:00 2008 @@ -0,0 +1,60 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.slice; + +import java.util.List; + + +/** + * Policy to select one of the physical databases referred as <em>slice</em> + * in which a given persistent instance will be replicated. + * + * @author Pinaki Poddar + * + */ +public interface ReplicationPolicy { + /** + * Gets the name of the slices where a given instance will be replicated. + * + * @param pc The newly persistent or to-be-merged object. + * @param slices list of names of the active slices. The ordering of + * the list is either explicit <code>openjpa.slice.Names</code> property + * or implicit i.e. alphabetic order of available identifiers if + * <code>openjpa.slice.Names</code> is unspecified. + * @param context generic persistence context managing the given instance. + * + * @return identifier of the slices. This names must match one of the + * given slice names. Return null or empty list to imply all active slices. + * + * @see DistributedConfiguration#getActiveSliceNames() + */ + String[] replicate(Object pc, List<String> slices, Object context); + + /** + * Implements a default replication policy to replicate the given + * instance across all available slices. + * + */ + public static class Default implements ReplicationPolicy { + public String[] replicate(Object pc, List<String> slices, + Object context) { + return null; + } + } +} Added: openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/SliceImplHelper.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/SliceImplHelper.java?rev=698284&view=auto ============================================================================== --- openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/SliceImplHelper.java (added) +++ openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/SliceImplHelper.java Tue Sep 23 11:58:00 2008 @@ -0,0 +1,88 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.slice; + +import java.util.List; + +import org.apache.openjpa.conf.OpenJPAConfiguration; +import org.apache.openjpa.kernel.OpenJPAStateManager; +import org.apache.openjpa.lib.util.Localizer; +import org.apache.openjpa.meta.ClassMetaData; +import org.apache.openjpa.util.UserException; + +/** + * Utility methods to determine the target slices for a persistence capable + * instance by calling back to user-specified distribution policy. + * + * @author Pinaki Poddar + * + */ +public class SliceImplHelper { + private static final Localizer _loc = + Localizer.forPackage(SliceImplHelper.class); + + /** + * Gets the target slices by calling user-specified + * {@link DistributionPolicy} or {@link ReplicationPolicy} + * depending on whether the given instance is {@link Replicated replicated}. + */ + public static String[] getSlicesByPolicy(Object pc, + DistributedConfiguration conf, Object ctx) { + List<String> availables = conf.getActiveSliceNames(); + Object policy = null; + String[] targets = null; + if (isReplicated(pc, conf)) { + policy = conf.getReplicationPolicyInstance(); + targets = ((ReplicationPolicy)policy).replicate + (pc, availables, ctx); + if (targets == null || targets.length == 0) + targets = availables.toArray(new String[availables.size()]); + } else { + policy = conf.getDistributionPolicyInstance(); + String slice = ((DistributionPolicy)policy).distribute + (pc, availables, ctx); + targets = new String[]{slice}; + } + for (String target : targets) + if (!availables.contains(target)) + throw new UserException(_loc.get("bad-policy-slice", new Object[] { + policy.getClass().getName(), target, pc, availables})); + return targets; + } + + /** + * Affirms if the given instance be replicated to multiple slices. + */ + public static boolean isReplicated(Object pc, OpenJPAConfiguration conf) { + if (pc == null) + return false; + ClassMetaData meta = conf.getMetaDataRepositoryInstance() + .getMetaData(pc.getClass(), null, false); + return (meta == null) ? false : meta.isReplicated(); + } + + /** + * Affirms if the given instance be replicated to multiple slices. + */ + public static boolean isReplicated(OpenJPAStateManager sm) { + if (sm == null) + return false; + return sm.getMetaData().isReplicated(); + } +} Modified: openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/SlicePersistence.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/SlicePersistence.java?rev=698284&r1=698283&r2=698284&view=diff ============================================================================== --- openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/SlicePersistence.java (original) +++ openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/SlicePersistence.java Tue Sep 23 11:58:00 2008 @@ -18,6 +18,8 @@ */ package org.apache.openjpa.slice; +import java.util.Arrays; + import org.apache.openjpa.enhance.PersistenceCapable; import org.apache.openjpa.kernel.StateManagerImpl; import org.apache.openjpa.util.ImplHelper; @@ -32,6 +34,8 @@ /** * Get the slice identifier for the given instance if it is a managed * instance and has been assigned to a slice. + * If the given instance is replicated across multiple slices then returns + * comma-separated list of slice names. * * @return name of the slice, if any. null otherwise. */ @@ -45,6 +49,13 @@ if (sm == null) return null; Object slice = sm.getImplData(); - return (slice instanceof String) ? (String)slice : null; + if (slice instanceof String[]) { + if (((String[])slice).length == 1) { + return ((String[])slice)[0]; + } else { + return Arrays.toString(((String[])slice)); + } + } + return null; } } Modified: openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCConfigurationImpl.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCConfigurationImpl.java?rev=698284&r1=698283&r2=698284&view=diff ============================================================================== --- openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCConfigurationImpl.java (original) +++ openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedJDBCConfigurationImpl.java Tue Sep 23 11:58:00 2008 @@ -49,6 +49,7 @@ import org.apache.openjpa.slice.DistributionPolicy; import org.apache.openjpa.slice.ExecutorServiceValue; import org.apache.openjpa.slice.ProductDerivation; +import org.apache.openjpa.slice.ReplicationPolicy; import org.apache.openjpa.slice.Slice; import org.apache.openjpa.util.UserException; @@ -73,11 +74,13 @@ protected StringValue masterPlugin; protected StringListValue namesPlugin; protected ExecutorServiceValue executorServicePlugin; - protected PluginValue distributionPolicyPlugin; + public PluginValue distributionPolicyPlugin; + public PluginValue replicationPolicyPlugin; public static final String DOT = "."; public static final String REGEX_DOT = "\\."; - public static final String PREFIX_SLICE = ProductDerivation.PREFIX_SLICE + DOT; + public static final String PREFIX_SLICE = ProductDerivation.PREFIX_SLICE + + DOT; public static final String PREFIX_OPENJPA = "openjpa."; private static Localizer _loc = Localizer.forPackage(DistributedJDBCConfigurationImpl.class); @@ -95,8 +98,18 @@ brokerPlugin.setString(DistributedBrokerImpl.class.getName()); distributionPolicyPlugin = addPlugin("DistributionPolicy", true); + distributionPolicyPlugin.setAlias("random", + DistributionPolicy.Default.class.getName()); + distributionPolicyPlugin.setDefault("random"); distributionPolicyPlugin.setDynamic(true); + replicationPolicyPlugin = addPlugin + ("ReplicatedDistributionPolicy", true); + replicationPolicyPlugin.setAlias("all", + ReplicationPolicy.Default.class.getName()); + replicationPolicyPlugin.setDefault("all"); + replicationPolicyPlugin.setDynamic(true); + lenientPlugin = addBoolean("Lenient"); masterPlugin = addString("Master"); @@ -185,6 +198,18 @@ } public void setDistributionPolicyInstance(String val) { + replicationPolicyPlugin.set(val); + } + + public ReplicationPolicy getReplicationPolicyInstance() { + if (replicationPolicyPlugin.get() == null) { + replicationPolicyPlugin.instantiate(ReplicationPolicy.class, + this, true); + } + return (ReplicationPolicy) replicationPolicyPlugin.get(); + } + + public void setReplicatedDistributionPolicyInstance(String val) { distributionPolicyPlugin.set(val); } Modified: openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedStoreManager.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedStoreManager.java?rev=698284&r1=698283&r2=698284&view=diff ============================================================================== --- openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedStoreManager.java (original) +++ openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedStoreManager.java Tue Sep 23 11:58:00 2008 @@ -18,6 +18,7 @@ */ package org.apache.openjpa.slice.jdbc; +import java.io.IOException; import java.sql.Connection; import java.sql.SQLException; import java.util.ArrayList; @@ -42,6 +43,7 @@ import org.apache.openjpa.kernel.FetchConfiguration; import org.apache.openjpa.kernel.OpenJPAStateManager; import org.apache.openjpa.kernel.PCState; +import org.apache.openjpa.kernel.QueryContext; import org.apache.openjpa.kernel.QueryLanguages; import org.apache.openjpa.kernel.Seq; import org.apache.openjpa.kernel.StoreContext; @@ -54,10 +56,15 @@ import org.apache.openjpa.meta.ClassMetaData; import org.apache.openjpa.meta.FieldMetaData; import org.apache.openjpa.slice.DistributionPolicy; +import org.apache.openjpa.slice.SliceImplHelper; import org.apache.openjpa.slice.ProductDerivation; +import org.apache.openjpa.slice.ReplicationPolicy; import org.apache.openjpa.util.InternalException; import org.apache.openjpa.util.StoreException; import org.apache.openjpa.util.UserException; +import org.apache.tools.ant.taskdefs.condition.IsReference; + +import sun.reflect.ReflectionFactory.GetReflectionFactoryAction; /** * A Store manager for multiple physical databases referred as <em>slice</em>. @@ -109,71 +116,70 @@ /** * Decides the index of the StoreManager by first looking at the - * implementation data. If not found then {@link DistributionPolicy - * DistributionPolicy} determines the target store for new instances and - * additional connection info is used to estimate for the existing - * instances. + * implementation data. If no implementation data is found, then estimates + * targets slices by using additional connection info. If no additional + * connection info then calls back to user-defined policy. */ - protected String findSliceName(OpenJPAStateManager sm, Object info) { - boolean hasIndex = hasSlice(sm); - if (hasIndex) - return sm.getImplData().toString(); - String slice = estimateSlice(sm, info); - if (slice == null) + protected String[] findSliceNames(OpenJPAStateManager sm, Object info) { + boolean hasImplData = sm.getImplData() != null; + if (hasImplData) + return (String[])sm.getImplData(); + String[] targets = estimateSlice(sm, info); + if (targets == null) return assignSlice(sm); - return slice; - } - - private boolean hasSlice(OpenJPAStateManager sm) { - return sm.getImplData() != null; + return targets; } - - private String assignSlice(OpenJPAStateManager sm) { - Object pc = sm.getPersistenceCapable(); - DistributionPolicy policy = _conf.getDistributionPolicyInstance(); - List<String> sliceNames = _conf.getActiveSliceNames(); - String slice =policy.distribute(pc, sliceNames, getContext()); - if (!sliceNames.contains(slice)) { - throw new UserException(_loc.get("bad-policy-slice", new Object[] { - policy.getClass().getName(), slice, pc, sliceNames })); - } - sm.setImplData(slice, true); - return slice; + + private String[] assignSlice(OpenJPAStateManager sm) { + Object pc = sm.getPersistenceCapable(); + String[] targets = SliceImplHelper.getSlicesByPolicy(pc, _conf, + getContext()); + sm.setImplData(targets, true); + return targets; } - + /** * The additional edata is used, if possible, to find the StoreManager * managing the given StateManager. If the additional data is unavailable * then return null. * */ - private String estimateSlice(OpenJPAStateManager sm, Object edata) { + private String[] estimateSlice(OpenJPAStateManager sm, Object edata) { if (edata == null || !(edata instanceof ConnectionInfo)) return null; + List<String> temps = null; Result result = ((ConnectionInfo) edata).result; if (result instanceof ResultSetResult) { JDBCStore store = ((ResultSetResult) result).getStore(); for (SliceStoreManager slice : _slices) { if (slice == store) { - String sliceId = slice.getName(); - sm.setImplData(sliceId, true); - return sliceId; + if (temps == null) + temps = new ArrayList<String>(); + temps.add(slice.getName()); } } } - return null; + if (temps != null) { + String[] targets = temps.toArray(new String[temps.size()]); + sm.setImplData(targets, true); + return targets; + } + return null; } /** - * Selects a child StoreManager where the given instance resides. + * Selects child StoreManager(s) where the given instance resides. */ private StoreManager selectStore(OpenJPAStateManager sm, Object edata) { - String name = findSliceName(sm, edata); - SliceStoreManager slice = lookup(name); - if (slice == null) - throw new InternalException(_loc.get("wrong-slice", name, sm)); - return slice; + String[] targets = findSliceNames(sm, edata); + for (String target : targets) { + SliceStoreManager slice = lookup(target); + if (slice == null) + throw new InternalException(_loc.get("wrong-slice", target, sm)); + return slice; + } + return null; } public boolean assignField(OpenJPAStateManager sm, int field, @@ -222,13 +228,16 @@ } public boolean exists(OpenJPAStateManager sm, Object edata) { + List<String> targets = null; for (SliceStoreManager slice : _slices) { if (slice.exists(sm, edata)) { - sm.setImplData(slice.getName(), true); - return true; + if (targets == null) + targets.add(slice.getName()); } } - return false; + if (targets != null) + sm.setImplData(targets.toArray(new String[targets.size()]), true); + return targets != null; } @@ -244,7 +253,11 @@ List<OpenJPAStateManager> subset = subsets.get(slice.getName()); if (subset.isEmpty()) continue; - futures.add(threadPool.submit(new Flusher(slice, subset))); + if (containsReplicated(subset)) { + slice.flush(subset); + } else { + futures.add(threadPool.submit(new Flusher(slice, subset))); + } } for (Future<Collection> future : futures) { Collection error; @@ -262,12 +275,16 @@ return exceptions; } + boolean containsReplicated(List<OpenJPAStateManager> sms) { + for (OpenJPAStateManager sm : sms) + if (sm.getMetaData().isReplicated()) + return true; + return false; + } + /** * Separate the given list of StateManagers in separate lists for each slice * by the associated slice identifier of each StateManager. - * @param sms - * @param edata - * @return */ private Map<String, List<OpenJPAStateManager>> bin( Collection/*<StateManage>*/ sms, Object edata) { @@ -277,8 +294,10 @@ subsets.put(slice.getName(), new ArrayList<OpenJPAStateManager>()); for (Object x : sms) { OpenJPAStateManager sm = (OpenJPAStateManager) x; - String slice = findSliceName(sm, edata); - subsets.get(slice).add(sm); + String[] targets = findSliceNames(sm, edata); + for (String slice : targets) { + subsets.get(slice).add(sm); + } } return subsets; } @@ -306,15 +325,15 @@ public boolean initialize(OpenJPAStateManager sm, PCState state, FetchConfiguration fetch, Object edata) { if (edata instanceof ConnectionInfo) { - String slice = findSliceName(sm, (ConnectionInfo) edata); - if (slice != null) - return lookup(slice).initialize(sm, state, fetch, edata); + String[] targets = findSliceNames(sm, (ConnectionInfo) edata); + if (targets != null || targets.length > 0) + return lookup(targets[0]).initialize(sm, state, fetch, edata); } // not a part of Query result load. Look into the slices till found List<SliceStoreManager> targets = getTargets(fetch); for (SliceStoreManager slice : targets) { if (slice.initialize(sm, state, fetch, edata)) { - sm.setImplData(slice.getName(), true); + sm.setImplData(new String[]{slice.getName()}, true); return true; } } @@ -381,7 +400,13 @@ } public boolean syncVersion(OpenJPAStateManager sm, Object edata) { - return selectStore(sm, edata).syncVersion(sm, edata); + String[] targets = findSliceNames(sm, edata); + boolean sync = true; + for (String replica : targets) { + SliceStoreManager slice = lookup(replica); + sync &= slice.syncVersion(sm, edata); + } + return sync; } @Override Modified: openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedStoreQuery.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedStoreQuery.java?rev=698284&r1=698283&r2=698284&view=diff ============================================================================== --- openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedStoreQuery.java (original) +++ openjpa/trunk/openjpa-slice/src/main/java/org/apache/openjpa/slice/jdbc/DistributedStoreQuery.java Tue Sep 23 11:58:00 2008 @@ -77,7 +77,7 @@ public void setContext(QueryContext ctx) { super.setContext(ctx); - for (StoreQuery q:_queries) + for (StoreQuery q : _queries) q.setContext(ctx); } @@ -124,6 +124,9 @@ StoreManager sm = owner.getDistributedStore().getSlice(i); if (!targets.contains(sm)) continue; + // if replicated, then execute only on single slice + if (i > 0 && containsReplicated(query.getContext())) + continue; QueryExecutor call = new QueryExecutor(); call.executor = executors.get(i); call.query = query; @@ -164,6 +167,27 @@ return result; } + /** + * Scans metadata to find out if a replicated class is the candidate. + **/ + boolean containsReplicated(QueryContext query) { + Class candidate = query.getCandidateType(); + if (candidate != null) { + ClassMetaData meta = query.getStoreContext().getConfiguration() + .getMetaDataRepositoryInstance() + .getMetaData(candidate, null, true); + if (meta != null && meta.isReplicated()) + return true; + } + ClassMetaData[] metas = query.getAccessPathMetaDatas(); + if (metas == null || metas.length < 1) + return false; + for (ClassMetaData type : metas) + if (type.isReplicated()) + return true; + return false; + } + public Number executeDelete(StoreQuery q, Object[] params) { Iterator<StoreQuery> qs = owner._queries.iterator(); final List<Future<Number>> futures = new ArrayList<Future<Number>>(); Modified: openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/Address.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/Address.java?rev=698284&r1=698283&r2=698284&view=diff ============================================================================== --- openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/Address.java (original) +++ openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/Address.java Tue Sep 23 11:58:00 2008 @@ -28,6 +28,9 @@ private String city; private int zip; + + @OneToOne + private Country country; @OneToOne(mappedBy = "address") Person owner; @@ -79,4 +82,12 @@ public String toString() { return city; } + + public Country getCountry() { + return country; + } + + public void setCountry(Country country) { + this.country = country; + } } Added: openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/Country.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/Country.java?rev=698284&view=auto ============================================================================== --- openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/Country.java (added) +++ openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/Country.java Tue Sep 23 11:58:00 2008 @@ -0,0 +1,56 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.slice; + +import javax.persistence.Entity; +import javax.persistence.Id; + +import org.apache.openjpa.persistence.Replicated; + +/** + * A persistence entity to be replicated across multiple databases. + * A non-replicated entity can refer to a replicated entity. + * + * @author Pinaki Poddar + * + */ +@Entity +@Replicated +public class Country { + @Id + private String name; + + private long population; + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public long getPopulation() { + return population; + } + + public void setPopulation(long population) { + this.population = population; + } +} Modified: openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/TestBasic.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/TestBasic.java?rev=698284&r1=698283&r2=698284&view=diff ============================================================================== --- openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/TestBasic.java (original) +++ openjpa/trunk/openjpa-slice/src/test/java/org/apache/openjpa/slice/TestBasic.java Tue Sep 23 11:58:00 2008 @@ -30,18 +30,22 @@ * */ public class TestBasic extends SliceTestCase { - + /** + * Specify persistence unit name as System property <code>-Dunit</code> or + * use the default value as <code>"slice"</code>. + */ protected String getPersistenceUnitName() { - return "slice"; + return System.getProperty("unit","slice"); } public void setUp() throws Exception { - super.setUp(PObject.class, Person.class, Address.class, CLEAR_TABLES); + super.setUp(PObject.class, Person.class, Address.class, Country.class, + CLEAR_TABLES); } /** - * Persist N objects. + * Persist N independent objects. */ List<PObject> create(int N) { List<PObject> pcs = new ArrayList<PObject>(); @@ -128,18 +132,25 @@ } public void testPersistConnectedObjectGraph() { + EntityManager em = emf.createEntityManager(); + em.getTransaction().begin(); Person p1 = new Person("A"); Person p2 = new Person("B"); Person p3 = new Person("C"); Address a1 = new Address("Rome", 12345); Address a2 = new Address("San Francisco", 23456); Address a3 = new Address("New York", 34567); + Country c1 = em.find(Country.class, "Italy"); + if (c1 == null) { + c1 = new Country(); + c1.setName("Italy"); + em.persist(c1); + } + a1.setCountry(c1); p1.setAddress(a1); p2.setAddress(a2); p3.setAddress(a3); - EntityManager em = emf.createEntityManager(); - em.getTransaction().begin(); em.persist(p1); em.persist(p2); em.persist(p3); @@ -185,5 +196,46 @@ assertEquals(pc.getId(), pc2.getId()); assertEquals(value + 1, pc2.getValue()); } + + public void testPersistReplicatedObjects() { + EntityManager em = emf.createEntityManager(); + em.getTransaction().begin(); + String[] names = {"USA", "India", "China"}; + for (String name : names) { + Country country = new Country(); + country.setName(name); + em.persist(country); + } + em.getTransaction().commit(); + assertEquals(names.length, count(Country.class)); + + Country india = em.find(Country.class, "India"); + assertNotNull(india); + assertEquals("India", india.getName()); + } + + public void testUpdateReplicatedObjects() { + EntityManager em = emf.createEntityManager(); + em.getTransaction().begin(); + String[] names = {"USA", "India", "China"}; + long[] population = {300,1200,1400}; + for (int i = 0; i < names.length; i++) { + Country country = new Country(); + country.setName(names[i]); + country.setPopulation(population[i]); + em.persist(country); + } + em.getTransaction().commit(); + + assertEquals(names.length, count(Country.class)); + Country india = em.find(Country.class, "India"); + + assertNotNull(india); + assertEquals("India", india.getName()); + india.setPopulation(1201); + em.getTransaction().begin(); + em.merge(india); + em.getTransaction().commit(); + } } Modified: openjpa/trunk/openjpa-slice/src/test/resources/META-INF/persistence.xml URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-slice/src/test/resources/META-INF/persistence.xml?rev=698284&r1=698283&r2=698284&view=diff ============================================================================== --- openjpa/trunk/openjpa-slice/src/test/resources/META-INF/persistence.xml (original) +++ openjpa/trunk/openjpa-slice/src/test/resources/META-INF/persistence.xml Tue Sep 23 11:58:00 2008 @@ -22,6 +22,7 @@ <class>org.apache.openjpa.slice.PObject</class> <class>org.apache.openjpa.slice.Person</class> <class>org.apache.openjpa.slice.Address</class> + <class>org.apache.openjpa.slice.Country</class> <properties> <property name="openjpa.Log" value="DefaultLevel=WARN, Enhance=TRACE"/> </properties> @@ -83,6 +84,7 @@ <class>org.apache.openjpa.slice.PObject</class> <class>org.apache.openjpa.slice.Person</class> <class>org.apache.openjpa.slice.Address</class> + <class>org.apache.openjpa.slice.Country</class> <properties> <property name="openjpa.BrokerFactory" value="slice"/> <property name="openjpa.ConnectionDriverName" value="org.apache.derby.jdbc.EmbeddedDriver"/> @@ -122,4 +124,28 @@ <property name="openjpa.jdbc.MappingDefaults" value="DefaultMissingInfo=true"/> </properties> </persistence-unit> + + <persistence-unit name="mysql"> + <properties> + <property name="openjpa.BrokerFactory" value="slice"/> + <property name="openjpa.ConnectionDriverName" value="com.mysql.jdbc.Driver"/> + + <property name="openjpa.slice.Names" value="One,Two"/> + <property name="openjpa.slice.DistributionPolicy" value="org.apache.openjpa.slice.policy.UserDistributionPolicy"/> + + <property name="openjpa.ConnectionUserName" value="root"/> + <property name="openjpa.ConnectionPassword" value=""/> + <property name="openjpa.slice.One.ConnectionDriverName" value="com.mysql.jdbc.Driver"/> + <property name="openjpa.slice.One.ConnectionURL" value="jdbc:mysql://localhost/slice1"/> + <property name="openjpa.slice.Two.ConnectionDriverName" value="com.mysql.jdbc.Driver"/> + <property name="openjpa.slice.Two.ConnectionURL" value="jdbc:mysql://localhost/slice2"/> + + <property name="openjpa.Multithreaded" value="false"/> + <property name="openjpa.Log" value="DefaultLevel=INFO, Enhance=TRACE, SQL=TRACE"/> + <property name="openjpa.jdbc.SynchronizeMappings" value="refresh"/> + <property name="openjpa.jdbc.MappingDefaults" value="DefaultMissingInfo=true"/> + <property name="openjpa.RuntimeUnenhancedClasses" value="supported"/> + </properties> + </persistence-unit> + </persistence> From commits-return-3402-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Wed Sep 24 20:22:44 2008 Return-Path: <commits-return-3402-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 65851 invoked from network); 24 Sep 2008 20:22:44 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Sep 2008 20:22:44 -0000 Received: (qmail 65003 invoked by uid 500); 24 Sep 2008 20:22:41 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 64990 invoked by uid 500); 24 Sep 2008 20:22:41 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 64981 invoked by uid 99); 24 Sep 2008 20:22:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Sep 2008 13:22:41 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Sep 2008 20:21:48 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 3599823888A0; Wed, 24 Sep 2008 13:21:52 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r698714 - /openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java Date: Wed, 24 Sep 2008 20:21:52 -0000 To: commits@openjpa.apache.org From: ppoddar@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080924202152.3599823888A0@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: ppoddar Date: Wed Sep 24 13:21:51 2008 New Revision: 698714 URL: http://svn.apache.org/viewvc?rev=698714&view=rev Log: Allows unrecognized hints (those not starting with openjpa.* as prefix) be stored opaquely - for extension plug-ins. Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java Modified: openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java?rev=698714&r1=698713&r2=698714&view=diff ============================================================================== --- openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java (original) +++ openjpa/trunk/openjpa-persistence/src/main/java/org/apache/openjpa/persistence/QueryImpl.java Wed Sep 24 13:21:51 2008 @@ -501,8 +501,12 @@ public OpenJPAQuery setHint(String key, Object value) { _em.assertNotCloseInvoked(); - if (key == null || !key.startsWith("openjpa.")) + if (key == null) return this; + if (!key.startsWith("openjpa.")) { + _query.getFetchConfiguration().setHint(key, value); + return this; + } String k = key.substring("openjpa.".length()); try { From commits-return-3403-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Wed Sep 24 23:14:29 2008 Return-Path: <commits-return-3403-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 69039 invoked from network); 24 Sep 2008 23:14:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 24 Sep 2008 23:14:29 -0000 Received: (qmail 59445 invoked by uid 500); 24 Sep 2008 23:14:26 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 59431 invoked by uid 500); 24 Sep 2008 23:14:26 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 59422 invoked by uid 99); 24 Sep 2008 23:14:26 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Sep 2008 16:14:26 -0700 X-ASF-Spam-Status: No, hits=-1996.3 required=10.0 tests=ALL_TRUSTED,HTML_MESSAGE,MIME_HTML_ONLY X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Sep 2008 23:13:26 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 09BA5234C1F7 for <commits@openjpa.apache.org>; Wed, 24 Sep 2008 16:14:00 -0700 (PDT) Message-ID: <177148524.1222298040015.JavaMail.www-data@brutus> Date: Wed, 24 Sep 2008 16:14:00 -0700 (PDT) From: confluence@apache.org To: commits@openjpa.apache.org Subject: [CONF] OpenJPA: JPA 2.0 Roadmap (page created) MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org <html> <head> <base href="http://cwiki.apache.org/confluence" /> <style type="text/css"> <!-- body, p, td, table, tr, .bodytext, .stepfield { font-family: Verdana, arial, sans-serif; font-size: 11px; line-height: 16px; color: #000000; font-weight: normal; } #PageContent { text-align: left; background-color: #fff; padding: 0px; margin: 0px; padding-bottom:20px; } /* ** when this stylesheet is used for the Tiny MCE Wysiwyg editor's edit area, we can't ** use an id=PageContent or class=wiki-content, so we must ** set the body style to that used for PageContent, and p to that used for wiki-content. */ body { margin: 0px; padding: 0px; text-align: center; background-color: #f0f0f0; } @media print { body { background-color: #fff; } } .monospaceInput { font:12px monospace } .wiki-content p, .commentblock p { margin: 16px 0px 16px 0px; padding: 0px; } .wiki-content-preview { padding: 5px; border-left: 1px solid #3c78b5; border-right: 1px solid #3c78b5; } ul, ol { margin-top: 2px; margin-bottom: 2px; padding-top: 0px; padding-bottom: 0px; } pre { padding: 0px; margin-top: 5px; margin-left: 15px; margin-bottom: 5px; margin-right: 5px; text-align: left; } .helpheading { font-weight: bold; background-color: #D0D9BD; border-bottom: 1px solid #3c78b5; padding: 4px 4px 4px 4px; margin: 0px; margin-top: 10px; } .helpcontent { padding: 4px 4px 20px 4px; background-color: #f5f7f1; } .code { border: 1px dashed #3c78b5; font-size: 11px; font-family: Courier; margin: 10px; line-height: 13px; } .focusedComment { background: #ffffce; } .commentBox, .focusedComment { padding: 10px; margin: 5px 0 5px 0; border: 1px #bbb solid; } .codeHeader { background-color: #f0f0f0; border-bottom: 1px dashed #3c78b5; padding: 3px; text-align: center; } .codeContent { text-align: left; background-color: #f0f0f0; padding: 3px; } .preformatted { border: 1px dashed #3c78b5; font-size: 11px; font-family: Courier; margin: 10px; line-height: 13px; } .preformattedHeader { background-color: #f0f0f0; border-bottom: 1px dashed #3c78b5; padding: 3px; text-align: center; } .preformattedContent { background-color: #f0f0f0; padding: 3px; } .panel { border: 1px dashed #3c78b5; margin: 10px; margin-top: 0px; } .panelHeader { background-color: #f0f0f0; border-bottom: 1px dashed #3c78b5; padding: 3px; text-align: center; } .panelContent { background-color: #f0f0f0; padding: 5px; } .anonymousAlert { background-color: #f0f0f0; border: 1px dashed red; font-size: 11px; padding: 10px 5px 10px 5px; margin: 4px; line-height: 13px; } .lockAlert { background-color: #f0f0f0; width: 50%; border: 1px dashed red; font-size: 11px; padding: 10px 5px 10px 5px; margin: 4px; line-height: 13px; } .code-keyword { color: #000091; background-color: inherit; } .code-object { color: #910091; background-color: inherit; } .code-quote { color: #009100; background-color: inherit; } .code-comment { color: #808080; background-color: inherit; } .code-xml .code-keyword { color: inherit; font-weight: bold; } .code-tag { color: #000091; background-color: inherit; } .breadcrumbs { background-color: #f0f0f0; border-color: #3c78b5; border-width: 1px 0px 1px 0px; border-style: solid; font-size: 11px; padding: 3px 0px 3px 0px; } .navmenu { border: 1px solid #ccc; } .menuheading { font-weight: bold; background-color: #f0f0f0; border-bottom: 1px solid #3c78b5; padding: 4px 4px 2px 4px; } .menuitems { padding: 4px 4px 20px 4px; } .rightpanel { border-left: 1px solid #ccc; border-bottom: 1px solid #ccc; } #helpheading { text-align: left; font-weight: bold; background-color: #D0D9BD; border-bottom: 1px solid #3c78b5; padding: 4px 4px 4px 4px; margin: 0px; } #helpcontent { padding: 4px 4px 4px 4px; background-color: #f5f7f1; } .helptab-unselected { font-weight: bold; padding: 5px; background-color: #f5f7f1; } .helptab-selected { font-weight: bold; background-color: #D0D9BD; padding: 5px; } .helptabs { margin: 0px; background-color: #f5f7f1; padding: 5px; } .infopanel-heading { font-weight: bold; padding: 4px 0px 2px 0px; } .pagebody { } .pageheader { padding: 5px 5px 5px 0px; border-bottom: 1px solid #3c78b5; } .pagetitle { font-size: 22px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; } .newpagetitle { color: #ccc !important; } .steptitle { font-size: 18px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; margin-bottom: 7px; } .substeptitle { font-size: 12px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; margin: 2px 4px 4px 4px; padding: 2px 4px 1px 4px; } .stepdesc { font-family: Verdana, arial, sans-serif; font-size: 11px; line-height: 16px; font-weight: normal; color: #666666; margin-top: 7px; margin-bottom: 7px; } .steplabel { font-weight: bold; margin-right: 4px; color: black; float: left; width: 15%; text-align: right; } .stepfield { background: #f0f0f0; padding: 5px; } .submitButtons{ margin-top:5px; text-align:right; } .formtitle { font-size: 12px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; } .sectionbottom { border-bottom: 1px solid #3c78b5; } .topRow { border-top: 2px solid #3c78b5; } .tabletitle { font-size: 14px; font-weight: bold; font-family: Arial, sans-serif; padding: 3px 0px 2px 0px; margin: 8px 4px 2px 0px; color: #003366; border-bottom: 2px solid #3c78b5; } .pagesubheading { color: #666666; font-size: 10px; padding: 0px 0px 5px 0px; } HR { color: 3c78b5; height: 1; } A:link, A:visited, A:active, A:hover { color: #003366; } h1 A:link, h1 A:visited, h1 A:active { text-decoration: none; } h1 A:hover { border-bottom: 1px dotted #003366; } .wiki-content > :first-child, .commentblock > :first-child { margin-top: 3px; } .logocell { padding: 10px; } input { font-family: verdana, geneva, arial, sans-serif; font-size: 11px; color: #000000; } textarea, textarea.editor { font-family: verdana, geneva, arial, sans-serif; font-size: 11px; color: #333333; } /* use logoSpaceLink instead. .spacenametitle { font: 21px/31px Impact, Arial, Helvetica; font-weight: 100; color: #999999; margin: 0px; } .spacenametitle img { margin: 0 0 -4px 0; } .spacenametitle a { text-decoration: none; color: #999999; } .spacenametitle a:visited { text-decoration: none; color: #999999; }*/ .spacenametitle-printable { font: 20px/25px Impact, Arial, Helvetica; font-weight: 100; color: #999999; margin: 0px; } .spacenametitle-printable a { text-decoration: none; color: #999999; } .spacenametitle-printable a:visited { text-decoration: none; color: #999999; } .blogDate { font-weight: bold; text-decoration: none; color: black; } .blogSurtitle { background: #f0f0f0; border: 1px solid #ddd; padding: 3px; margin: 1px 1px 10px 1px; } .blogHeading { font-size: 20px; line-height: normal; font-weight: bold; padding: 0px; margin: 0px; } .blogHeading a { text-decoration: none; color: black; } .endsection { align: right; color: #666666; margin-top: 10px; } .endsectionleftnav { align: right; color: #666666; margin-top: 10px; } h1 { font-size: 24px; line-height: normal; font-weight: bold; background-color: #f0f0f0; color: #003366; border-bottom: 1px solid #3c78b5; padding: 2px; margin: 36px 0px 4px 0px; } h2 { font-size: 18px; line-height: normal; font-weight: bold; background-color: #f0f0f0; border-bottom: 1px solid #3c78b5; padding: 2px; margin: 27px 0px 4px 0px; } h3 { font-size: 14px; line-height: normal; font-weight: bold; background-color: #f0f0f0; padding: 2px; margin: 21px 0px 4px 0px; } h4 { font-size: 12px; line-height: normal; font-weight: bold; background-color: #f0f0f0; padding: 2px; margin: 18px 0px 4px 0px; } h4.search { font-size: 12px; line-height: normal; font-weight: normal; background-color: #f0f0f0; padding: 4px; margin: 18px 0px 4px 0px; } h5 { font-size: 10px; line-height: normal; font-weight: bold; background-color: #f0f0f0; padding: 2px; margin: 14px 0px 4px 0px; } h6 { font-size: 8px; line-height: normal; font-weight: bold; background-color: #f0f0f0; padding: 2px; margin: 14px 0px 4px 0px; } .smallfont { font-size: 10px; } .descfont { font-size: 10px; color: #666666; } .smallerfont { font-size: 9px; } .smalltext { color: #666666; font-size: 10px; } .smalltext a { color: #666666; } .smalltext-blue { color: #3c78b5; font-size: 10px; } .surtitle { margin-left: 1px; margin-bottom: 5px; font-size: 14px; color: #666666; } /* css hack found here: http://www.fo3nix.pwp.blueyonder.co.uk/tutorials/css/hacks/ */ .navItemOver { font-size: 10px; font-weight: bold; color: #ffffff; background-color: #003366; cursor: hand; voice-family: '\'}\''; voice-family:inherit; cursor: pointer;} .navItemOver a { color: #ffffff; background-color:#003366; text-decoration: none; } .navItemOver a:visited { color: #ffffff; background-color:#003366; text-decoration: none; } .navItemOver a:hover { color: #ffffff; background-color:#003366; text-decoration: none; } .navItem { font-size: 10px; font-weight: bold; color: #ffffff; background-color: #3c78b5; } .navItem a { color: #ffffff; text-decoration: none; } .navItem a:hover { color: #ffffff; text-decoration: none; } .navItem a:visited { color: #ffffff; text-decoration: none; } div.padded { padding: 4px; } div.thickPadded { padding: 10px; } h3.macrolibrariestitle { margin: 0px 0px 0px 0px; } div.centered { text-align: center; margin: 10px; } div.centered table {margin: 0px auto; text-align: left; } .tableview table { margin: 0; } .tableview th { text-align: left; color: #003366; font-size: 12px; padding: 5px 0px 0px 5px; border-bottom: 2px solid #3c78b5; } .tableview td { text-align: left; border-color: #ccc; border-width: 0px 0px 1px 0px; border-style: solid; margin: 0; padding: 4px 10px 4px 5px; } .grid { margin: 2px 0px 5px 0px; border-collapse: collapse; } .grid th { border: 1px solid #ccc; padding: 2px 4px 2px 4px; background: #f0f0f0; text-align: center; } .grid td { border: 1px solid #ccc; padding: 3px 4px 3px 4px; } .gridHover { background-color: #f9f9f9; } td.infocell { background-color: #f0f0f0; } .label { font-weight: bold; color: #003366; } label { font-weight: bold; color: #003366; } .error { background-color: #fcc; } .errorBox { background-color: #fcc; border: 1px solid #c00; padding: 5px; margin: 5px; } .errorMessage { color: #c00; } .success { background-color: #dfd; } .successBox { background-color: #dfd; border: 1px solid #090; padding: 5px; margin-top:5px; margin-bottom:5px; } blockquote { padding-left: 10px; padding-right: 10px; margin-left: 5px; margin-right: 0px; border-left: 1px solid #3c78b5; } table.confluenceTable { margin: 5px; border-collapse: collapse; } /* Added as a temporary fix for CONF-4223. The table elements appear to be inheriting the border: none attribute from the sectionMacro class */ table.confluenceTable td.confluenceTd { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; } /* Added as a temporary fix for CONF-4223. The table elements appear to be inheriting the border: none attribute from the sectionMacro class */ table.confluenceTable th.confluenceTh { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; background-color: #f0f0f0; text-align: center; } td.confluenceTd { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; } th.confluenceTh { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; background-color: #f0f0f0; text-align: center; } DIV.small { font-size: 9px; } H1.pagename { margin-top: 0px; } IMG.inline {} .loginform { margin: 5px; border: 1px solid #ccc; } /* The text how the "This is a preview" comment should be shown. */ .previewnote { text-align: center; font-size: 11px; color: red; } /* How the preview content should be shown */ .previewcontent { background: #E0E0E0; } /* How the system messages should be shown (DisplayMessage.jsp) */ .messagecontent { background: #E0E0E0; } /* How the "This page has been modified..." -comment should be shown. */ .conflictnote { } .createlink { color: maroon; } a.createlink { color: maroon; } .templateparameter { font-size: 9px; color: darkblue; } .diffadded { background: #ddffdd; padding: 1px 1px 1px 4px; border-left: 4px solid darkgreen; } .diffdeleted { color: #999; background: #ffdddd; padding: 1px 1px 1px 4px; border-left: 4px solid darkred; } .diffnochange { padding: 1px 1px 1px 4px; border-left: 4px solid lightgrey; } .differror { background: brown; } .diff { font-family: lucida console, courier new, fixed-width; font-size: 12px; line-height: 14px; } .diffaddedchars { background-color:#99ff99; font-weight:bolder; } .diffremovedchars { background-color:#ff9999; text-decoration: line-through; font-weight:bolder; } .greybackground { background: #f0f0f0 } .greybox { border: 1px solid #ddd; padding: 3px; margin: 1px 1px 10px 1px; } .borderedGreyBox { border: 1px solid #cccccc; background-color: #f0f0f0; padding: 10px; } .greyboxfilled { border: 1px solid #ddd; background: #f0f0f0; padding: 3px; margin: 1px 1px 10px 1px; } .navBackgroundBox { padding: 5px 5px 5px 5px; font-size: 22px; font-weight: bold; font-family: Arial, sans-serif; color: white; background: #3c78b5; text-decoration: none; } .previewBoxTop { background-color: #f0f0f0; border-width: 1px 1px 0px 1px; border-style: solid; border-color: #3c78b5; padding: 5px; margin: 5px 0px 0px 0px; text-align: center; } .previewContent { background-color: #fff; border-color: #3c78b5; border-width: 0px 1px 0px 1px; border-style: solid; padding: 10px; margin: 0px; } .previewBoxBottom { background-color: #f0f0f0; border-width: 0px 1px 1px 1px; border-style: solid; border-color: #3c78b5; padding: 5px; margin: 0px 0px 5px 0px; text-align: center; } .functionbox { background-color: #f0f0f0; border: 1px solid #3c78b5; padding: 3px; margin: 1px 1px 10px 1px; } .functionbox-greyborder { background-color: #f0f0f0; border: 1px solid #ddd; padding: 3px; margin: 1px 1px 10px 1px; } .search-highlight { background-color: #ffffcc; } /* normal (white) background */ .rowNormal { background-color: #ffffff; } /* alternate (pale yellow) background */ .rowAlternate { background-color: #f7f7f7; } /* used in the list attachments table */ .rowAlternateNoBottomColor { background-color: #f7f7f7; } .rowAlternateNoBottomNoColor { } .rowAlternateNoBottomColor td { border-bottom: 0px; } .rowAlternateNoBottomNoColor td { border-bottom: 0px; } /* row highlight (grey) background */ .rowHighlight { background-color: #f0f0f0; } TD.greenbar {FONT-SIZE: 2px; BACKGROUND: #00df00; BORDER: 1px solid #9c9c9c; PADDING: 0px; } TD.redbar {FONT-SIZE: 2px; BACKGROUND: #df0000; BORDER: 1px solid #9c9c9c; PADDING: 0px; } TD.darkredbar {FONT-SIZE: 2px; BACKGROUND: #af0000; BORDER: 1px solid #9c9c9c; PADDING: 0px; } TR.testpassed {FONT-SIZE: 2px; BACKGROUND: #ddffdd; PADDING: 0px; } TR.testfailed {FONT-SIZE: 2px; BACKGROUND: #ffdddd; PADDING: 0px; } .toolbar { margin: 0px; border-collapse: collapse; } .toolbar td { border: 1px solid #ccc; padding: 2px 2px 2px 2px; color: #ccc; } td.noformatting { border-width: 0px; border-style: none; text-align: center; padding: 0px; } .commentblock { margin: 12px 0 12px 0; } /* * Divs displaying the license information, if necessary. */ .license-eval, .license-none, .license-nonprofit { border-top: 1px solid #bbbbbb; text-align: center; font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; } .license-eval, .license-none { background-color: #ffcccc; } .license-eval b, .license-none b { color: #990000 } .license-nonprofit { background-color: #ffffff; } /* * The shadow at the bottom of the page between the main content and the * "powered by" section. */ .bottomshadow { height: 12px; background-image: url("$req.contextPath/images/border/border_bottom.gif"); background-repeat: repeat-x; } /* * Styling of the operations box */ .navmenu .operations li, .navmenu .operations ul { list-style: none; margin-left: 0; padding-left: 0; } .navmenu .operations ul { margin-bottom: 9px; } .navmenu .label { font-weight: inherit; } /* * Styling of ops as a toolbar */ .toolbar div { display: none; } .toolbar .label { display: none; } .toolbar .operations { display: block; } .toolbar .operations ul { display: inline; list-style: none; margin-left: 10px; padding-left: 0; } .toolbar .operations li { list-style: none; display: inline; } /* list page navigational tabs */ #foldertab { padding: 3px 0px 3px 8px; margin-left: 0; border-bottom: 1px solid #3c78b5; font: bold 11px Verdana, sans-serif; } #foldertab li { list-style: none; margin: 0; display: inline; } #foldertab li a { padding: 3px 0.5em; margin-left: 3px; border: 1px solid #3c78b5; border-bottom: none; background: #3c78b5; text-decoration: none; } #foldertab li a:link { color: #ffffff; } #foldertab li a:visited { color: #ffffff; } #foldertab li a:hover { color: #ffffff; background: #003366; border-color: #003366; } #foldertab li a.current { background: white; border-bottom: 1px solid white; color: black; } #foldertab li a.current:link { color: black; } #foldertab li a.current:visited { color: black; } #foldertab li a.current:hover { background: white; border-bottom: 1px solid white; color: black; } /* alphabet list */ ul#squaretab { margin-left: 0; padding-left: 0; white-space: nowrap; font: bold 8px Verdana, sans-serif; } #squaretab li { display: inline; list-style-type: none; } #squaretab a { padding: 2px 6px; border: 1px solid #3c78b5; } #squaretab a:link, #squaretab a:visited { color: #fff; background-color: #3c78b5; text-decoration: none; } #squaretab a:hover { color: #ffffff; background-color: #003366; border-color: #003366; text-decoration: none; } #squaretab li a#current { background: white; color: black; } .blogcalendar * { font-family:verdana, arial, sans-serif; font-size:x-small; font-weight:normal; line-height:140%; padding:2px; } table.blogcalendar { border: 1px solid #3c78b5; } .blogcalendar th.calendarhead, a.calendarhead { font-size:x-small; font-weight:bold; padding:2px; text-transform:uppercase; background-color: #3c78b5; color: #ffffff; letter-spacing: .3em; text-transform: uppercase; } .calendarhead:visited {color: white;} .calendarhead:active {color: white;} .calendarhead:hover {color: white;} .blogcalendar th { font-size:x-small; font-weight:bold; padding:2px; background-color:#f0f0f0; } .blogcalendar td { font-size:x-small; font-weight:normal; } .searchGroup { padding: 0 0 10px 0; background: #f0f0f0; } .searchGroupHeading { font-size: 10px; font-weight: bold; color: #ffffff; background-color: #3c78b5; padding: 2px 4px 1px 4px; } .searchItem { padding: 1px 4px 1px 4px; } .searchItemSelected { padding: 1px 4px 1px 4px; font-weight: bold; background: #ddd; } /* permissions page styles */ .permissionHeading { border-bottom: #bbb; border-width: 0 0 1px 0; border-style: solid; font-size: 16px; text-align: left; } .permissionTab { border-width: 0 0 0 1px; border-style: solid; background: #3c78b5; color: #ffffff; font-size: 10px; } .permissionSuperTab { border-width: 0 0 0 1px; border-style: solid; background: #003366; color: #ffffff; } .permissionCell { border-left: #bbb; border-width: 0 0 0 1px; border-style: solid; } /* warning panel */ .warningPanel { background: #FFFFCE; border:#F0C000 1px solid; padding: 8px; margin: 10px; } /* alert panel */ .alertPanel { background: #FFCCCC; border:#C00 1px solid; padding: 8px; margin: 10px; } /* info panel */ .infoPanel { background: #D8E4F1; border:#3c78b5 1px solid; padding: 8px; margin: 10px; } /* side menu highlighting (e.g. space content screen) */ .optionPadded { padding: 2px; } .optionSelected { background-color: #ffffcc; padding: 2px; border: 1px solid #ddd; margin: -1px; } .optionSelected a { font-weight: bold; text-decoration: none; color: black; } /* information macros */ .noteMacro { border-style: solid; border-width: 1px; border-color: #F0C000; background-color: #FFFFCE; text-align:left; margin-top: 5px; margin-bottom: 5px} .warningMacro { border-style: solid; border-width: 1px; border-color: #c00; background-color: #fcc; text-align:left; margin-top: 5px; margin-bottom: 5px} .infoMacro { border-style: solid; border-width: 1px; border-color: #3c78b5; background-color: #D8E4F1; text-align:left; margin-top: 5px; margin-bottom: 5px} .tipMacro { border-style: solid; border-width: 1px; border-color: #090; background-color: #dfd; text-align:left; margin-top: 5px; margin-bottom: 5px} .informationMacroPadding { padding: 5px 0 0 5px; } table.infoMacro td, table.warningMacro td, table.tipMacro td, table.noteMacro td, table.sectionMacro td { border: none; } table.sectionMacroWithBorder td.columnMacro { border-style: dashed; border-width: 1px; border-color: #cccccc;} .pagecontent { padding: 10px; text-align: left; } /* styles for links in the top bar */ .topBarDiv a:link {color: #ffffff;} .topBarDiv a:visited {color: #ffffff;} .topBarDiv a:active {color: #ffffff;} .topBarDiv a:hover {color: #ffffff;} .topBarDiv {color: #ffffff;} .topBar { background-color: #003366; } /* styles for extended operations */ .greyLinks a:link {color: #666666; text-decoration:underline;} .greyLinks a:visited {color: #666666; text-decoration:underline;} .greyLinks a:active {color: #666666; text-decoration:underline;} .greyLinks a:hover {color: #666666; text-decoration:underline;} .greyLinks {color: #666666; display:block; padding: 10px} .logoSpaceLink {color: #999999; text-decoration: none} .logoSpaceLink a:link {color: #999999; text-decoration: none} .logoSpaceLink a:visited {color: #999999; text-decoration: none} .logoSpaceLink a:active {color: #999999; text-decoration: none} .logoSpaceLink a:hover {color: #003366; text-decoration: none} /* basic panel (basicpanel.vmd) style */ .basicPanelContainer {border: 1px solid #3c78b5; margin-top: 2px; margin-bottom: 8px; width: 100%} .basicPanelTitle {padding: 5px; margin: 0px; background-color: #f0f0f0; color: black; font-weight: bold;} .basicPanelBody {padding: 5px; margin: 0px} .separatorLinks a:link {color: white} .separatorLinks a:visited {color: white} .separatorLinks a:active {color: white} .greynavbar {background-color: #f0f0f0; border-top: 1px solid #3c78b5; margin-top: 2px} div.headerField { float: left; width: auto; height: 100%; } .headerFloat { margin-left: auto; width: 50%; } .headerFloatLeft { float: left; margin-right: 20px; margin-bottom: 10px; } #headerRow { padding: 10px; } div.license-personal { background-color: #003366; color: #ffffff; } div.license-personal a { color: #ffffff; } .greyFormBox { border: 1px solid #cccccc; padding: 5px; } /* IE automatically adds a margin before and after form tags. Use this style to remove that */ .marginlessForm { margin: 0px; } .openPageHighlight { background-color: #ffffcc; padding: 2px; border: 1px solid #ddd; } .editPageInsertLinks, .editPageInsertLinks a { color: #666666; font-weight: bold; font-size: 10px; } /* Style for label heatmap. */ .top10 a { font-weight: bold; font-size: 2em; color: #003366; } .top25 a { font-weight: bold; font-size: 1.6em; color: #003366; } .top50 a { font-size: 1.4em; color: #003366; } .top100 a { font-size: 1.2em; color: #003366; } .heatmap { list-style:none; width: 95%; margin: 0px auto; } .heatmap a { text-decoration:none; } .heatmap a:hover { text-decoration:underline; } .heatmap li { display: inline; } .minitab { padding: 3px 0px 3px 8px; margin-left: 0; margin-top: 1px; margin-bottom: 0px; border-bottom: 1px solid #3c78b5; font: bold 9px Verdana, sans-serif; text-decoration: none; float:none; } .selectedminitab { padding: 3px 0.5em; margin-left: 3px; margin-top: 1px; border: 1px solid #3c78b5; background: white; border-bottom: 1px solid white; color: #000000; text-decoration: none; } .unselectedminitab { padding: 3px 0.5em; margin-left: 3px; margin-top: 1px; border: 1px solid #3c78b5; border-bottom: none; background: #3c78b5; color: #ffffff; text-decoration: none; } a.unselectedminitab:hover { color: #ffffff; background: #003366; border-color: #003366; } a.unselectedminitab:link { color: white; } a.unselectedminitab:visited { color: white; } a.selectedminitab:link { color: black; } a.selectedminitab:visited { color: black; } .linkerror { background-color: #fcc;} a.labelOperationLink:link {text-decoration: underline} a.labelOperationLink:active {text-decoration: underline} a.labelOperationLink:visited {text-decoration: underline} a.labelOperationLink:hover {text-decoration: underline} a.newLabel:link {background-color: #ddffdd} a.newLabel:active {background-color: #ddffdd} a.newLabel:visited {background-color: #ddffdd} a.newLabel:hover {background-color: #ddffdd} ul.square {list-style-type: square} .inline-control-link { background: #ffc; font-size: 9px; color: #666; padding: 2px; text-transform: uppercase; text-decoration: none; } .inline-control-link a:link {text-decoration: none} .inline-control-link a:active {text-decoration: none} .inline-control-link a:visited {text-decoration: none} .inline-control-link a:hover {text-decoration: none} .inline-control-link { background: #ffc; font-size: 9px; color: #666; padding: 2px; text-transform: uppercase; text-decoration: none; cursor: pointer; } div.auto_complete { width: 350px; background: #fff; } div.auto_complete ul { border: 1px solid #888; margin: 0; padding: 0; width: 100%; list-style-type: none; } div.auto_complete ul li { margin: 0; padding: 3px; } div.auto_complete ul li.selected { background-color: #ffb; } div.auto_complete ul strong.highlight { color: #800; margin: 0; padding: 0; } /******* Edit Page Styles *******/ .toogleFormDiv{ border:1px solid #A7A6AA; background-color:white; padding:5px; margin-top: 5px; } .toogleInfoDiv{ border:1px solid #A7A6AA; background-color:white; display:none; padding:5px; margin-top: 10px; } .inputSection{ margin-bottom:20px; } #editBox{ border:1px solid lightgray; background-color:#F0F0F0; } /******* Left Navigation Theme Styles ********/ .leftnav li a { text-decoration:none; color:white; margin:0px; display:block; padding:2px; padding-left:5px; background-color: #3c78b5; border-top:1px solid #3c78b5; } .leftnav li a:active {color:white;} .leftnav li a:visited {color:white;} .leftnav li a:hover {background-color: #003366; color:white;} /* Added by Shaun during i18n */ .replaced { background-color: #33CC66; } .topPadding { margin-top: 20px; } /* new form style */ .form-block { padding: 6px; } .form-error-block { padding: 6px; background: #fcc; border-top: #f0f0f0 1px solid; border-bottom: #f0f0f0 1px solid; margin-bottom: 6px; padding: 0 12px 0 12px; } .form-element-large { font-size: 16px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; } .form-element-small { font-size: 12px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; } .form-header { background: lightyellow; border-top: #f0f0f0 1px solid; border-bottom: #f0f0f0 1px solid; margin-bottom: 6px; padding: 0 12px 0 12px; } .form-header p, .form-block p, .form-error-block p { line-height: normal; margin: 12px 0 12px 0; } .form-example { color: #888; font-size: 11px; } .form-divider { border-bottom: #ccc 1px solid; margin-bottom: 6px; } .form-buttons { margin-top: 6px; border-top: #ccc 1px solid; border-bottom: #ccc 1px solid; background: #f0f0f0; padding: 10px; text-align: center; } .form-buttons input { width: 100px; } .form-block .error { padding: 6px; margin-bottom: 6px; } --> </style> </head> <body> <div id="PageContent"> <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%"><tr> <td valign="top" class="pagebody"> <div class="pageheader"> <span class="pagetitle"> Page Created : <a href="http://cwiki.apache.org/confluence/display/openjpa">openjpa</a> : <a href="http://cwiki.apache.org/confluence/display/openjpa/JPA+2.0+Roadmap">JPA 2.0 Roadmap</a> </span> </div> <p> <a href="http://cwiki.apache.org/confluence/display/openjpa/JPA+2.0+Roadmap">JPA 2.0 Roadmap</a> has been created by <a href="http://cwiki.apache.org/confluence/display/~michael.d.dick@gmail.com">Michael Dick</a> <span class="smallfont">(Sep 24, 2008)</span>. </p> <span class="label">Content:</span><br /> <div class="greybox wiki-content"><h1><a name="JPA2.0Roadmap-JPA2.0RoadMap"></a>JPA 2.0 Road Map</h1> <p>In progress.</p> <p><!-- The following example uses David Blevins' swizzlejira macro to display a subset of JIRA issues. It's intentionally hidden because JIRA is not populated with JPA 2.0 work items (so anything here would be meaningless). {swizzlejira} #set( $jira = $rss.fetch("http://issues.apache.org/jira/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?&pid=12310351&status=1&sorter/field=issuekey&sorter/order=DESC&tempMax=1000") ) #set( $issues = $jira.fillSubTasks() ) h2. Simplified Lifecycle #set( $bulkUpdate = $jira.getIssue("OPENJPA-290").subTasks) {swizzlejiraissues:issues=$as.param($bulkUpdate)|columns=summary;assignee;priority;status|style=progress} {swizzlejira} --></p></div> </td></tr></table></div> <p> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td height="12" background="http://cwiki.apache.org/confluence/images/border/border_bottom.gif"><img src="http://cwiki.apache.org/confluence/images/border/spacer.gif" width="1" height="1" border="0"/></td> </tr> </table> <div class="smalltext"> Powered by <a href="http://www.atlassian.com/software/confluence/default.jsp?clicked=footer" class="smalltext">Atlassian Confluence</a> (Version: 2.2.9 Build:#527 Sep 07, 2006) - <a href="http://jira.atlassian.com/secure/BrowseProject.jspa?id=10470" class="smalltext">Bug/feature request</a><br/> <br> <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action">Unsubscribe or edit your notifications preferences</a> </div> </body> </html> From commits-return-3404-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Thu Sep 25 04:46:47 2008 Return-Path: <commits-return-3404-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 56404 invoked from network); 25 Sep 2008 04:46:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Sep 2008 04:46:47 -0000 Received: (qmail 71076 invoked by uid 500); 25 Sep 2008 04:46:45 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 71064 invoked by uid 500); 25 Sep 2008 04:46:45 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 71055 invoked by uid 99); 25 Sep 2008 04:46:45 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Sep 2008 21:46:45 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Sep 2008 04:45:45 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 75710238889D; Wed, 24 Sep 2008 21:45:49 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r698813 - in /openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java Date: Thu, 25 Sep 2008 04:45:49 -0000 To: commits@openjpa.apache.org From: allee8285@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080925044549.75710238889D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: allee8285 Date: Wed Sep 24 21:45:48 2008 New Revision: 698813 URL: http://svn.apache.org/viewvc?rev=698813&view=rev Log: OPENJPA-719 - Ensure English locale is used in toUpperCase/toLowerCase for locale insensitive code. Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java?rev=698813&r1=698812&r2=698813&view=diff ============================================================================== --- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java (original) +++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java Wed Sep 24 21:45:48 2008 @@ -41,6 +41,7 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Set; @@ -2566,7 +2567,7 @@ // or 'Object'; figure out what type to use String typeName = type.getName(); if (type.isPrimitive()) - typeName = typeName.substring(0, 1).toUpperCase() + typeName = typeName.substring(0, 1).toUpperCase(Locale.ENGLISH) + typeName.substring(1); else if (type.equals(String.class)) typeName = "String"; @@ -3971,7 +3972,7 @@ String methName; if (type.isPrimitive()) { methName = type.getName(); - methName = Character.toUpperCase(methName.charAt(0)) + methName = methName.substring(0, 1).toUpperCase(Locale.ENGLISH) + methName.substring(1); methName = "read" + methName; } else @@ -4128,7 +4129,7 @@ String methName; if (type.isPrimitive()) { methName = type.getName(); - methName = Character.toUpperCase(methName.charAt(0)) + methName = methName.substring(0, 1).toUpperCase(Locale.ENGLISH) + methName.substring(1); methName = "write" + methName; } else Modified: openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java?rev=698813&r1=698812&r2=698813&view=diff ============================================================================== --- openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java (original) +++ openjpa/trunk/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java Wed Sep 24 21:45:48 2008 @@ -241,7 +241,7 @@ * Returns a symbolic constant for the specified string level. */ public static short getLevel(String str) { - str = str.toUpperCase().trim(); + str = str.toUpperCase(Locale.ENGLISH).trim(); short val = TRACE_STR.equals(str) ? Log.TRACE : INFO_STR.equals(str) ? Log.INFO : WARN_STR.equals(str) ? Log.WARN : From commits-return-3405-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Thu Sep 25 04:46:53 2008 Return-Path: <commits-return-3405-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 56452 invoked from network); 25 Sep 2008 04:46:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Sep 2008 04:46:52 -0000 Received: (qmail 71165 invoked by uid 500); 25 Sep 2008 04:46:50 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 71151 invoked by uid 500); 25 Sep 2008 04:46:50 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 71142 invoked by uid 99); 25 Sep 2008 04:46:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 24 Sep 2008 21:46:50 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Sep 2008 04:45:50 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 48B2B238899F; Wed, 24 Sep 2008 21:45:54 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r698814 - in /openjpa/branches/1.2.x: openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java Date: Thu, 25 Sep 2008 04:45:54 -0000 To: commits@openjpa.apache.org From: allee8285@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080925044554.48B2B238899F@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: allee8285 Date: Wed Sep 24 21:45:53 2008 New Revision: 698814 URL: http://svn.apache.org/viewvc?rev=698814&view=rev Log: OPENJPA-719 - Ensure English locale is used in toUpperCase/toLowerCase for locale insensitive code. Modified: openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java openjpa/branches/1.2.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java Modified: openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java?rev=698814&r1=698813&r2=698814&view=diff ============================================================================== --- openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java (original) +++ openjpa/branches/1.2.x/openjpa-kernel/src/main/java/org/apache/openjpa/enhance/PCEnhancer.java Wed Sep 24 21:45:53 2008 @@ -41,6 +41,7 @@ import java.util.HashSet; import java.util.Iterator; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Set; @@ -2566,7 +2567,7 @@ // or 'Object'; figure out what type to use String typeName = type.getName(); if (type.isPrimitive()) - typeName = typeName.substring(0, 1).toUpperCase() + typeName = typeName.substring(0, 1).toUpperCase(Locale.ENGLISH) + typeName.substring(1); else if (type.equals(String.class)) typeName = "String"; @@ -3971,7 +3972,7 @@ String methName; if (type.isPrimitive()) { methName = type.getName(); - methName = Character.toUpperCase(methName.charAt(0)) + methName = methName.substring(0, 1).toUpperCase(Locale.ENGLISH) + methName.substring(1); methName = "read" + methName; } else @@ -4128,7 +4129,7 @@ String methName; if (type.isPrimitive()) { methName = type.getName(); - methName = Character.toUpperCase(methName.charAt(0)) + methName = methName.substring(0, 1).toUpperCase(Locale.ENGLISH) + methName.substring(1); methName = "write" + methName; } else Modified: openjpa/branches/1.2.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java?rev=698814&r1=698813&r2=698814&view=diff ============================================================================== --- openjpa/branches/1.2.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java (original) +++ openjpa/branches/1.2.x/openjpa-lib/src/main/java/org/apache/openjpa/lib/log/LogFactoryImpl.java Wed Sep 24 21:45:53 2008 @@ -241,7 +241,7 @@ * Returns a symbolic constant for the specified string level. */ public static short getLevel(String str) { - str = str.toUpperCase().trim(); + str = str.toUpperCase(Locale.ENGLISH).trim(); short val = TRACE_STR.equals(str) ? Log.TRACE : INFO_STR.equals(str) ? Log.INFO : WARN_STR.equals(str) ? Log.WARN : From commits-return-3406-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Fri Sep 26 03:06:14 2008 Return-Path: <commits-return-3406-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 14509 invoked from network); 26 Sep 2008 03:06:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Sep 2008 03:06:14 -0000 Received: (qmail 99688 invoked by uid 500); 26 Sep 2008 03:06:12 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 99676 invoked by uid 500); 26 Sep 2008 03:06:11 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 99667 invoked by uid 99); 26 Sep 2008 03:06:11 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Sep 2008 20:06:11 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 26 Sep 2008 03:05:19 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id E829A23889E9; Thu, 25 Sep 2008 20:05:52 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r699156 - in /openjpa/trunk: openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/kernel/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/ Date: Fri, 26 Sep 2008 03:05:52 -0000 To: commits@openjpa.apache.org From: fancy@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080926030552.E829A23889E9@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: fancy Date: Thu Sep 25 20:05:52 2008 New Revision: 699156 URL: http://svn.apache.org/viewvc?rev=699156&view=rev Log: OPENJPA-731 Bug on FetchType.EAGER when QuerySQLCache is turned on Committing patch provided by Fay Wang Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TblChild.java openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TblGrandChild.java openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TblParent.java Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/kernel/TestQuerySQLCache.java Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java?rev=699156&r1=699155&r2=699156&view=diff ============================================================================== --- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java (original) +++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/SelectImpl.java Thu Sep 25 20:05:52 2008 @@ -391,7 +391,7 @@ } return getEagerResult(conn, stmnt, rs, store, fetch, forUpdate, - _sql.getSQL()); + _sql.getSQL(), params); } private boolean isForUpdate(JDBCStore store, int lockLevel) { @@ -409,7 +409,7 @@ * to the given result. */ private static void addEagerResults(SelectResult res, SelectImpl sel, - JDBCStore store, JDBCFetchConfiguration fetch) + JDBCStore store, JDBCFetchConfiguration fetch, List params) throws SQLException { if (sel._eager == null) return; @@ -428,7 +428,7 @@ eres = res; else eres = ((SelectExecutor) entry.getValue()).execute(store, - fetch); + fetch, params); eager = res.getEagerMap(false); if (eager == null) { @@ -511,14 +511,15 @@ */ protected Result getEagerResult(Connection conn, PreparedStatement stmnt, ResultSet rs, JDBCStore store, - JDBCFetchConfiguration fetch, boolean forUpdate, String sqlStr) + JDBCFetchConfiguration fetch, boolean forUpdate, String sqlStr, + List params) throws SQLException { SelectResult res = new SelectResult(conn, stmnt, rs, _dict); res.setSelect(this); res.setStore(store); res.setLocking(forUpdate); try { - addEagerResults(res, this, store, fetch); + addEagerResults(res, this, store, fetch, params); } catch (SQLException se) { res.close(); throw se; Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/kernel/TestQuerySQLCache.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/kernel/TestQuerySQLCache.java?rev=699156&r1=699155&r2=699156&view=diff ============================================================================== --- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/kernel/TestQuerySQLCache.java (original) +++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/kernel/TestQuerySQLCache.java Thu Sep 25 20:05:52 2008 @@ -18,6 +18,7 @@ */ package org.apache.openjpa.kernel; +import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.Map; @@ -34,6 +35,9 @@ import org.apache.openjpa.persistence.EntityManagerImpl; import org.apache.openjpa.persistence.OpenJPAEntityManagerFactorySPI; import org.apache.openjpa.persistence.OpenJPAPersistence; +import org.apache.openjpa.persistence.relations.TblChild; +import org.apache.openjpa.persistence.relations.TblGrandChild; +import org.apache.openjpa.persistence.relations.TblParent; import org.apache.openjpa.persistence.simple.Person; /* @@ -271,6 +275,72 @@ runMultiEMCaching(props); } + /* + * Verify QuerySQLCacheValue setting "true" uses the expected cache + * implementation and is caching. + */ + public void testEagerFetch() { + Map props = new HashMap(System.getProperties()); + props.put("openjpa.MetaDataFactory", "jpa(Types=" + + TblChild.class.getName() + ";" + + TblGrandChild.class.getName() + ";" + + TblParent.class.getName() + ")"); + props.put("openjpa.jdbc.QuerySQLCache", "true"); + OpenJPAEntityManagerFactorySPI emf = (OpenJPAEntityManagerFactorySPI) + OpenJPAPersistence.cast( + Persistence.createEntityManagerFactory("test", props)); + + EntityManagerImpl em = (EntityManagerImpl)emf.createEntityManager(); + + em.getTransaction().begin(); + for (int i = 0; i < 2; i++) { + TblParent p = new TblParent(); + p.setParentId(i); + TblChild c = new TblChild(); + c.setChildId(i); + c.setTblParent(p); + p.addTblChild(c); + em.persist(p); + em.persist(c); + + TblGrandChild gc = new TblGrandChild(); + gc.setGrandChildId(i); + gc.setTblChild(c); + c.addTblGrandChild(gc); + + em.persist(p); + em.persist(c); + em.persist(gc); + } + em.flush(); + em.getTransaction().commit(); + em.clear(); + + for (int i = 0; i < 2; i++) { + TblParent p = em.find(TblParent.class, i); + int pid = p.getParentId(); + assertEquals(pid, i); + Collection<TblChild> children = p.getTblChildren(); + boolean hasChild = false; + for (TblChild c : children) { + hasChild = true; + Collection<TblGrandChild> gchildren = c.getTblGrandChildren(); + int cid = c.getChildId(); + assertEquals(cid, i); + boolean hasGrandChild = false; + for (TblGrandChild gc : gchildren) { + hasGrandChild = true; + int gcId = gc.getGrandChildId(); + assertEquals(gcId, i); + } + assertTrue(hasGrandChild); + } + assertTrue(hasChild); + } + em.close(); + emf.close(); + } + private void runMultiEMCaching(Map props) { EntityManagerFactory emfac = Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TblChild.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TblChild.java?rev=699156&view=auto ============================================================================== --- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TblChild.java (added) +++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TblChild.java Thu Sep 25 20:05:52 2008 @@ -0,0 +1,102 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.persistence.relations; + +import java.util.ArrayList; +import java.util.Collection; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.JoinColumns; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Version; + +import org.apache.openjpa.persistence.jdbc.ForeignKey; + +@Entity +public class TblChild { + + @Id + @Column(name = "CHILD_ID",nullable=false) + private Integer childId; + + @Version + @Column(name = "VRS_NBR") + private Integer vrsNbr; + + @OneToMany(mappedBy="tblChild",fetch = FetchType.EAGER, + cascade = {CascadeType.PERSIST,CascadeType.MERGE}) + private Collection<TblGrandChild> tblGrandChildren = + new ArrayList<TblGrandChild>(); + + @ManyToOne(fetch = FetchType.LAZY, + cascade = {CascadeType.PERSIST,CascadeType.MERGE }) + @JoinColumns({@JoinColumn(name = + "PARENT_ID",referencedColumnName="PARENT_ID")}) + @ForeignKey + private TblParent tblParent; + + public Integer getChildId() { + return childId; + } + + public void setChildId(Integer childId) { + this.childId = childId; + } + + public Integer getVrsNbr() { + return vrsNbr; + } + + public void setVrsNbr(Integer vrsNbr) { + this.vrsNbr = vrsNbr; + } + + public Collection<TblGrandChild> getTblGrandChildren() { + return tblGrandChildren; + } + + public void setTblGrandChildren(Collection<TblGrandChild> + tblGrandChildren) { + this.tblGrandChildren = tblGrandChildren; + } + + public void addTblGrandChild(TblGrandChild tblGrandChild) { + tblGrandChild.setTblChild(this); + tblGrandChildren.add(tblGrandChild); + } + + public void removeTblGrandChild(TblGrandChild tblGrandChild) { + tblGrandChild.setTblChild(null); + tblGrandChildren.remove(tblGrandChild); + } + + public TblParent getTblParent() { + return tblParent; + } + + public void setTblParent(TblParent tblParent) { + this.tblParent = tblParent; + } +} Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TblGrandChild.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TblGrandChild.java?rev=699156&view=auto ============================================================================== --- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TblGrandChild.java (added) +++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TblGrandChild.java Thu Sep 25 20:05:52 2008 @@ -0,0 +1,76 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.persistence.relations; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.JoinColumns; +import javax.persistence.ManyToOne; +import javax.persistence.Version; + +import org.apache.openjpa.persistence.jdbc.ForeignKey; + +@Entity +public class TblGrandChild { + + @Id + @Column(name = "GC_ID",nullable=false) + private Integer grandChildId; + + @Version + @Column(name = "VRS_NBR") + private Integer vrsNbr; + + @ManyToOne(fetch = FetchType.LAZY, + cascade = {CascadeType.PERSIST,CascadeType.MERGE }) + @JoinColumns({@JoinColumn(name = + "CHILD_ID",referencedColumnName="CHILD_ID")}) + @ForeignKey + private TblChild tblChild; + + public Integer getGrandChildId() { + return grandChildId; + } + + public void setGrandChildId(Integer grandChildId) { + this.grandChildId = grandChildId; + } + + public Integer getVrsNbr() { + return vrsNbr; + } + + public void setVrsNbr(Integer vrsNbr) { + this.vrsNbr = vrsNbr; + } + + public TblChild getTblChild() { + return tblChild; + } + + public void setTblChild(TblChild tblChild) { + this.tblChild = tblChild; + } +} + + Added: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TblParent.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TblParent.java?rev=699156&view=auto ============================================================================== --- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TblParent.java (added) +++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/relations/TblParent.java Thu Sep 25 20:05:52 2008 @@ -0,0 +1,60 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.openjpa.persistence.relations; + +import java.util.ArrayList; +import java.util.Collection; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.FetchType; +import javax.persistence.Id; +import javax.persistence.OneToMany; +@Entity +public class TblParent { + + @Id + @Column(name = "PARENT_ID") + private Integer parentId; + + @OneToMany(mappedBy="tblParent",fetch = FetchType.LAZY,cascade = { + CascadeType.PERSIST,CascadeType.MERGE }) + private Collection<TblChild> tblChildren = new ArrayList<TblChild>(); + + public Integer getParentId() { + return parentId; + } + + public void setParentId(Integer parentId) { + this.parentId = parentId; + } + + public Collection<TblChild> getTblChildren() { + return tblChildren; + } + + public void setTblChildren(Collection<TblChild> tblChildren) { + this.tblChildren = tblChildren; + } + + public void addTblChild(TblChild tblChild) { + tblChildren.add(tblChild); + } +} From commits-return-3407-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Mon Sep 29 16:07:30 2008 Return-Path: <commits-return-3407-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 58493 invoked from network); 29 Sep 2008 16:07:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Sep 2008 16:07:24 -0000 Received: (qmail 15585 invoked by uid 500); 29 Sep 2008 16:07:22 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 15556 invoked by uid 500); 29 Sep 2008 16:07:22 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 15429 invoked by uid 99); 29 Sep 2008 16:07:21 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Sep 2008 09:07:21 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Sep 2008 16:06:28 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 8928C238889E; Mon, 29 Sep 2008 09:07:02 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r700158 - in /openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/kernel/ openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/ Date: Mon, 29 Sep 2008 16:07:02 -0000 To: commits@openjpa.apache.org From: awhite@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080929160702.8928C238889E@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: awhite Date: Mon Sep 29 09:07:01 2008 New Revision: 700158 URL: http://svn.apache.org/viewvc?rev=700158&view=rev Log: OPENJPA-722 resolution. Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachManager.java openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachedStateManager.java openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestEntityManagerClear.java Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java?rev=700158&r1=700157&r2=700158&view=diff ============================================================================== --- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java (original) +++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/BrokerImpl.java Mon Sep 29 09:07:01 2008 @@ -3167,8 +3167,8 @@ beginOperation(true); try { // If a flush is desired (based on input parm), then check if the - // "dirty" flag is set before calling flush(). - if ((flush) && ((_flags & FLAG_FLUSH_REQUIRED) != 0)) + // "dirty" flag is set before calling flush(). + if (flush && (_flags & FLAG_FLUSH_REQUIRED) != 0) flush(); detachAllInternal(call); } catch (OpenJPAException ke) { Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachManager.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachManager.java?rev=700158&r1=700157&r2=700158&view=diff ============================================================================== --- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachManager.java (original) +++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachManager.java Mon Sep 29 09:07:01 2008 @@ -446,7 +446,8 @@ // detach fields and set detached variables DetachedStateManager detSM = null; if (_opts.getDetachedStateManager() - && useDetachedStateManager(sm, _opts)) + && useDetachedStateManager(sm, _opts) + && !(sm.isNew() && !sm.isDeleted() && !sm.isFlushed())) detSM = new DetachedStateManager(detachedPC, sm, fields, _opts.getAccessUnloaded(), _broker.getMultithreaded()); if (_full) { Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachedStateManager.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachedStateManager.java?rev=700158&r1=700157&r2=700158&view=diff ============================================================================== --- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachedStateManager.java (original) +++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/DetachedStateManager.java Mon Sep 29 09:07:01 2008 @@ -79,7 +79,10 @@ _embedded = sm.isEmbedded(); _loaded = load; _access = access; - _dirty = new BitSet(_loaded.length()); + if (!sm.isFlushed()) + _dirty = (BitSet) sm.getDirty().clone(); + else + _dirty = new BitSet(_loaded.length()); _oid = sm.fetchObjectId(); _version = sm.getVersion(); if (multithreaded) Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestEntityManagerClear.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestEntityManagerClear.java?rev=700158&r1=700157&r2=700158&view=diff ============================================================================== --- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestEntityManagerClear.java (original) +++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/simple/TestEntityManagerClear.java Mon Sep 29 09:07:01 2008 @@ -20,6 +20,7 @@ import junit.textui.TestRunner; import org.apache.openjpa.persistence.test.SingleEMTestCase; +import java.math.BigDecimal; /** * Test case to ensure that the proper JPA clear semantics are processed. @@ -30,7 +31,7 @@ extends SingleEMTestCase { public void setUp() { - setUp(AllFieldTypes.class); + setUp(AllFieldTypes.class, Item.class,CLEAR_TABLES); } public void testDetach() { @@ -94,6 +95,148 @@ rollback(); } + public void testNewClearMerge() { + // Create EntityManager and Start a transaction (1) + begin(); + + // Insert a new object then clear persistent context + AllFieldTypes testObject1 = new AllFieldTypes(); + testObject1.setStringField("my test object1"); + persist(testObject1); + //Object1 is not flushed to DB but only detached by clear(). + em.clear(); + + assertEquals(0, query("select x from AllFieldTypes x " + + "where x.stringField = 'my test object1'"). + getResultList().size()); + em.merge(testObject1); + commit(); + + //Start a new transaction + begin(); + + // Expect Object1 is persisted after merge and commit. + assertEquals(1, query("select x from AllFieldTypes x " + + "where x.stringField = 'my test object1'"). + getResultList().size()); + + // Rollback the transaction and close everything + rollback(); + } + + public void testUpdateClearMerge() { + // Create EntityManager and Start a transaction (1) + begin(); + + // Insert a new object + Item i = new Item(); + i.setItemName("cup"); + persist(i); + commit(); + int id = i.getItemId(); + + begin(); + Item i2 = em.find(Item.class, id); + i2.setItemName("fancy cup"); + //Updated item is not flushed to DB but only detached by clear(). + em.clear(); + assertEquals(0, query("select x from Item x " + + "where x.itemName = 'fancy cup'"). + getResultList().size()); + em.merge(i2); + commit(); + + //Start a new transaction + begin(); + + //should be changed by previous commit + assertEquals(1, query("select x from Item x " + + "where x.itemName = 'fancy cup'"). + getResultList().size()); + + // Rollback the transaction and close everything + rollback(); + } + + /** + * Test modify entity then clear context which cause unflushed modified entity detached. + * Do more modification on detached entity, merge back and commit. + * Expect both changes before clear and after clear are persisted. + * + */ + public void testUpdateClearUpdateMerge() { + // Create EntityManager and Start a transaction (1) + begin(); + + // Insert a new object + Item i = new Item(); + i.setItemName("cup"); + i.setItemPrice(new BigDecimal(100.00)); + persist(i); + commit(); + int id = i.getItemId(); + + begin(); + Item i2 = em.find(Item.class, id); + i2.setItemName("fancy cup"); + //Updated item is not flushed to DB but only detached by clear(). + em.clear(); + assertEquals(0, query("select x from Item x " + + "where x.itemName = 'fancy cup'"). + getResultList().size()); + i2.setItemPrice(new BigDecimal(120.00)); + em.merge(i2); + commit(); + + //Start a new transaction + begin(); + + //should be changed by previous commit + assertEquals(1, query("select x from Item x " + + "where x.itemName = 'fancy cup' and x.itemPrice = 120.00"). + getResultList().size()); + + // Rollback the transaction and close everything + rollback(); + } + + public void testUpdateFlushClearUpdateMerge() { + // Create EntityManager and Start a transaction (1) + begin(); + + // Insert a new object + Item i = new Item(); + i.setItemName("cup"); + i.setItemPrice(new BigDecimal(100.00)); + persist(i); + commit(); + int id = i.getItemId(); + + begin(); + Item i2 = em.find(Item.class, id); + i2.setItemName("fancy cup"); + em.flush(); + em.clear(); + //it is updated because it is flushed before clear(); + assertEquals(1, query("select x from Item x " + + "where x.itemName = 'fancy cup'"). + getResultList().size()); + i2.setItemPrice(new BigDecimal(120.00)); + i2.setItemName("red cup"); + em.merge(i2); + commit(); + + //Start a new transaction + begin(); + + //should be changed by previous commit + assertEquals(1, query("select x from Item x " + + "where x.itemName = 'red cup' and x.itemPrice = 120.00"). + getResultList().size()); + + // Rollback the transaction and close everything + rollback(); + } public static void main(String[] args) { TestRunner.run(TestEntityManagerClear.class); } From commits-return-3408-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Mon Sep 29 17:54:39 2008 Return-Path: <commits-return-3408-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 56747 invoked from network); 29 Sep 2008 17:54:38 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Sep 2008 17:54:38 -0000 Received: (qmail 18201 invoked by uid 500); 29 Sep 2008 17:54:30 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 18189 invoked by uid 500); 29 Sep 2008 17:54:30 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 17953 invoked by uid 99); 29 Sep 2008 17:54:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Sep 2008 10:54:28 -0700 X-ASF-Spam-Status: No, hits=-1996.3 required=10.0 tests=ALL_TRUSTED,HTML_MESSAGE,MIME_HTML_ONLY X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Sep 2008 17:53:26 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 09635234C1E1 for <commits@openjpa.apache.org>; Mon, 29 Sep 2008 10:54:00 -0700 (PDT) Message-ID: <919372343.1222710840031.JavaMail.www-data@brutus> Date: Mon, 29 Sep 2008 10:54:00 -0700 (PDT) From: confluence@apache.org To: commits@openjpa.apache.org Subject: [CONF] OpenJPA: Thanks (page created) MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org <html> <head> <base href="http://cwiki.apache.org/confluence" /> <style type="text/css"> <!-- body, p, td, table, tr, .bodytext, .stepfield { font-family: Verdana, arial, sans-serif; font-size: 11px; line-height: 16px; color: #000000; font-weight: normal; } #PageContent { text-align: left; background-color: #fff; padding: 0px; margin: 0px; padding-bottom:20px; } /* ** when this stylesheet is used for the Tiny MCE Wysiwyg editor's edit area, we can't ** use an id=PageContent or class=wiki-content, so we must ** set the body style to that used for PageContent, and p to that used for wiki-content. */ body { margin: 0px; padding: 0px; text-align: center; background-color: #f0f0f0; } @media print { body { background-color: #fff; } } .monospaceInput { font:12px monospace } .wiki-content p, .commentblock p { margin: 16px 0px 16px 0px; padding: 0px; } .wiki-content-preview { padding: 5px; border-left: 1px solid #3c78b5; border-right: 1px solid #3c78b5; } ul, ol { margin-top: 2px; margin-bottom: 2px; padding-top: 0px; padding-bottom: 0px; } pre { padding: 0px; margin-top: 5px; margin-left: 15px; margin-bottom: 5px; margin-right: 5px; text-align: left; } .helpheading { font-weight: bold; background-color: #D0D9BD; border-bottom: 1px solid #3c78b5; padding: 4px 4px 4px 4px; margin: 0px; margin-top: 10px; } .helpcontent { padding: 4px 4px 20px 4px; background-color: #f5f7f1; } .code { border: 1px dashed #3c78b5; font-size: 11px; font-family: Courier; margin: 10px; line-height: 13px; } .focusedComment { background: #ffffce; } .commentBox, .focusedComment { padding: 10px; margin: 5px 0 5px 0; border: 1px #bbb solid; } .codeHeader { background-color: #f0f0f0; border-bottom: 1px dashed #3c78b5; padding: 3px; text-align: center; } .codeContent { text-align: left; background-color: #f0f0f0; padding: 3px; } .preformatted { border: 1px dashed #3c78b5; font-size: 11px; font-family: Courier; margin: 10px; line-height: 13px; } .preformattedHeader { background-color: #f0f0f0; border-bottom: 1px dashed #3c78b5; padding: 3px; text-align: center; } .preformattedContent { background-color: #f0f0f0; padding: 3px; } .panel { border: 1px dashed #3c78b5; margin: 10px; margin-top: 0px; } .panelHeader { background-color: #f0f0f0; border-bottom: 1px dashed #3c78b5; padding: 3px; text-align: center; } .panelContent { background-color: #f0f0f0; padding: 5px; } .anonymousAlert { background-color: #f0f0f0; border: 1px dashed red; font-size: 11px; padding: 10px 5px 10px 5px; margin: 4px; line-height: 13px; } .lockAlert { background-color: #f0f0f0; width: 50%; border: 1px dashed red; font-size: 11px; padding: 10px 5px 10px 5px; margin: 4px; line-height: 13px; } .code-keyword { color: #000091; background-color: inherit; } .code-object { color: #910091; background-color: inherit; } .code-quote { color: #009100; background-color: inherit; } .code-comment { color: #808080; background-color: inherit; } .code-xml .code-keyword { color: inherit; font-weight: bold; } .code-tag { color: #000091; background-color: inherit; } .breadcrumbs { background-color: #f0f0f0; border-color: #3c78b5; border-width: 1px 0px 1px 0px; border-style: solid; font-size: 11px; padding: 3px 0px 3px 0px; } .navmenu { border: 1px solid #ccc; } .menuheading { font-weight: bold; background-color: #f0f0f0; border-bottom: 1px solid #3c78b5; padding: 4px 4px 2px 4px; } .menuitems { padding: 4px 4px 20px 4px; } .rightpanel { border-left: 1px solid #ccc; border-bottom: 1px solid #ccc; } #helpheading { text-align: left; font-weight: bold; background-color: #D0D9BD; border-bottom: 1px solid #3c78b5; padding: 4px 4px 4px 4px; margin: 0px; } #helpcontent { padding: 4px 4px 4px 4px; background-color: #f5f7f1; } .helptab-unselected { font-weight: bold; padding: 5px; background-color: #f5f7f1; } .helptab-selected { font-weight: bold; background-color: #D0D9BD; padding: 5px; } .helptabs { margin: 0px; background-color: #f5f7f1; padding: 5px; } .infopanel-heading { font-weight: bold; padding: 4px 0px 2px 0px; } .pagebody { } .pageheader { padding: 5px 5px 5px 0px; border-bottom: 1px solid #3c78b5; } .pagetitle { font-size: 22px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; } .newpagetitle { color: #ccc !important; } .steptitle { font-size: 18px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; margin-bottom: 7px; } .substeptitle { font-size: 12px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; margin: 2px 4px 4px 4px; padding: 2px 4px 1px 4px; } .stepdesc { font-family: Verdana, arial, sans-serif; font-size: 11px; line-height: 16px; font-weight: normal; color: #666666; margin-top: 7px; margin-bottom: 7px; } .steplabel { font-weight: bold; margin-right: 4px; color: black; float: left; width: 15%; text-align: right; } .stepfield { background: #f0f0f0; padding: 5px; } .submitButtons{ margin-top:5px; text-align:right; } .formtitle { font-size: 12px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; } .sectionbottom { border-bottom: 1px solid #3c78b5; } .topRow { border-top: 2px solid #3c78b5; } .tabletitle { font-size: 14px; font-weight: bold; font-family: Arial, sans-serif; padding: 3px 0px 2px 0px; margin: 8px 4px 2px 0px; color: #003366; border-bottom: 2px solid #3c78b5; } .pagesubheading { color: #666666; font-size: 10px; padding: 0px 0px 5px 0px; } HR { color: 3c78b5; height: 1; } A:link, A:visited, A:active, A:hover { color: #003366; } h1 A:link, h1 A:visited, h1 A:active { text-decoration: none; } h1 A:hover { border-bottom: 1px dotted #003366; } .wiki-content > :first-child, .commentblock > :first-child { margin-top: 3px; } .logocell { padding: 10px; } input { font-family: verdana, geneva, arial, sans-serif; font-size: 11px; color: #000000; } textarea, textarea.editor { font-family: verdana, geneva, arial, sans-serif; font-size: 11px; color: #333333; } /* use logoSpaceLink instead. .spacenametitle { font: 21px/31px Impact, Arial, Helvetica; font-weight: 100; color: #999999; margin: 0px; } .spacenametitle img { margin: 0 0 -4px 0; } .spacenametitle a { text-decoration: none; color: #999999; } .spacenametitle a:visited { text-decoration: none; color: #999999; }*/ .spacenametitle-printable { font: 20px/25px Impact, Arial, Helvetica; font-weight: 100; color: #999999; margin: 0px; } .spacenametitle-printable a { text-decoration: none; color: #999999; } .spacenametitle-printable a:visited { text-decoration: none; color: #999999; } .blogDate { font-weight: bold; text-decoration: none; color: black; } .blogSurtitle { background: #f0f0f0; border: 1px solid #ddd; padding: 3px; margin: 1px 1px 10px 1px; } .blogHeading { font-size: 20px; line-height: normal; font-weight: bold; padding: 0px; margin: 0px; } .blogHeading a { text-decoration: none; color: black; } .endsection { align: right; color: #666666; margin-top: 10px; } .endsectionleftnav { align: right; color: #666666; margin-top: 10px; } h1 { font-size: 24px; line-height: normal; font-weight: bold; background-color: #f0f0f0; color: #003366; border-bottom: 1px solid #3c78b5; padding: 2px; margin: 36px 0px 4px 0px; } h2 { font-size: 18px; line-height: normal; font-weight: bold; background-color: #f0f0f0; border-bottom: 1px solid #3c78b5; padding: 2px; margin: 27px 0px 4px 0px; } h3 { font-size: 14px; line-height: normal; font-weight: bold; background-color: #f0f0f0; padding: 2px; margin: 21px 0px 4px 0px; } h4 { font-size: 12px; line-height: normal; font-weight: bold; background-color: #f0f0f0; padding: 2px; margin: 18px 0px 4px 0px; } h4.search { font-size: 12px; line-height: normal; font-weight: normal; background-color: #f0f0f0; padding: 4px; margin: 18px 0px 4px 0px; } h5 { font-size: 10px; line-height: normal; font-weight: bold; background-color: #f0f0f0; padding: 2px; margin: 14px 0px 4px 0px; } h6 { font-size: 8px; line-height: normal; font-weight: bold; background-color: #f0f0f0; padding: 2px; margin: 14px 0px 4px 0px; } .smallfont { font-size: 10px; } .descfont { font-size: 10px; color: #666666; } .smallerfont { font-size: 9px; } .smalltext { color: #666666; font-size: 10px; } .smalltext a { color: #666666; } .smalltext-blue { color: #3c78b5; font-size: 10px; } .surtitle { margin-left: 1px; margin-bottom: 5px; font-size: 14px; color: #666666; } /* css hack found here: http://www.fo3nix.pwp.blueyonder.co.uk/tutorials/css/hacks/ */ .navItemOver { font-size: 10px; font-weight: bold; color: #ffffff; background-color: #003366; cursor: hand; voice-family: '\'}\''; voice-family:inherit; cursor: pointer;} .navItemOver a { color: #ffffff; background-color:#003366; text-decoration: none; } .navItemOver a:visited { color: #ffffff; background-color:#003366; text-decoration: none; } .navItemOver a:hover { color: #ffffff; background-color:#003366; text-decoration: none; } .navItem { font-size: 10px; font-weight: bold; color: #ffffff; background-color: #3c78b5; } .navItem a { color: #ffffff; text-decoration: none; } .navItem a:hover { color: #ffffff; text-decoration: none; } .navItem a:visited { color: #ffffff; text-decoration: none; } div.padded { padding: 4px; } div.thickPadded { padding: 10px; } h3.macrolibrariestitle { margin: 0px 0px 0px 0px; } div.centered { text-align: center; margin: 10px; } div.centered table {margin: 0px auto; text-align: left; } .tableview table { margin: 0; } .tableview th { text-align: left; color: #003366; font-size: 12px; padding: 5px 0px 0px 5px; border-bottom: 2px solid #3c78b5; } .tableview td { text-align: left; border-color: #ccc; border-width: 0px 0px 1px 0px; border-style: solid; margin: 0; padding: 4px 10px 4px 5px; } .grid { margin: 2px 0px 5px 0px; border-collapse: collapse; } .grid th { border: 1px solid #ccc; padding: 2px 4px 2px 4px; background: #f0f0f0; text-align: center; } .grid td { border: 1px solid #ccc; padding: 3px 4px 3px 4px; } .gridHover { background-color: #f9f9f9; } td.infocell { background-color: #f0f0f0; } .label { font-weight: bold; color: #003366; } label { font-weight: bold; color: #003366; } .error { background-color: #fcc; } .errorBox { background-color: #fcc; border: 1px solid #c00; padding: 5px; margin: 5px; } .errorMessage { color: #c00; } .success { background-color: #dfd; } .successBox { background-color: #dfd; border: 1px solid #090; padding: 5px; margin-top:5px; margin-bottom:5px; } blockquote { padding-left: 10px; padding-right: 10px; margin-left: 5px; margin-right: 0px; border-left: 1px solid #3c78b5; } table.confluenceTable { margin: 5px; border-collapse: collapse; } /* Added as a temporary fix for CONF-4223. The table elements appear to be inheriting the border: none attribute from the sectionMacro class */ table.confluenceTable td.confluenceTd { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; } /* Added as a temporary fix for CONF-4223. The table elements appear to be inheriting the border: none attribute from the sectionMacro class */ table.confluenceTable th.confluenceTh { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; background-color: #f0f0f0; text-align: center; } td.confluenceTd { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; } th.confluenceTh { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; background-color: #f0f0f0; text-align: center; } DIV.small { font-size: 9px; } H1.pagename { margin-top: 0px; } IMG.inline {} .loginform { margin: 5px; border: 1px solid #ccc; } /* The text how the "This is a preview" comment should be shown. */ .previewnote { text-align: center; font-size: 11px; color: red; } /* How the preview content should be shown */ .previewcontent { background: #E0E0E0; } /* How the system messages should be shown (DisplayMessage.jsp) */ .messagecontent { background: #E0E0E0; } /* How the "This page has been modified..." -comment should be shown. */ .conflictnote { } .createlink { color: maroon; } a.createlink { color: maroon; } .templateparameter { font-size: 9px; color: darkblue; } .diffadded { background: #ddffdd; padding: 1px 1px 1px 4px; border-left: 4px solid darkgreen; } .diffdeleted { color: #999; background: #ffdddd; padding: 1px 1px 1px 4px; border-left: 4px solid darkred; } .diffnochange { padding: 1px 1px 1px 4px; border-left: 4px solid lightgrey; } .differror { background: brown; } .diff { font-family: lucida console, courier new, fixed-width; font-size: 12px; line-height: 14px; } .diffaddedchars { background-color:#99ff99; font-weight:bolder; } .diffremovedchars { background-color:#ff9999; text-decoration: line-through; font-weight:bolder; } .greybackground { background: #f0f0f0 } .greybox { border: 1px solid #ddd; padding: 3px; margin: 1px 1px 10px 1px; } .borderedGreyBox { border: 1px solid #cccccc; background-color: #f0f0f0; padding: 10px; } .greyboxfilled { border: 1px solid #ddd; background: #f0f0f0; padding: 3px; margin: 1px 1px 10px 1px; } .navBackgroundBox { padding: 5px 5px 5px 5px; font-size: 22px; font-weight: bold; font-family: Arial, sans-serif; color: white; background: #3c78b5; text-decoration: none; } .previewBoxTop { background-color: #f0f0f0; border-width: 1px 1px 0px 1px; border-style: solid; border-color: #3c78b5; padding: 5px; margin: 5px 0px 0px 0px; text-align: center; } .previewContent { background-color: #fff; border-color: #3c78b5; border-width: 0px 1px 0px 1px; border-style: solid; padding: 10px; margin: 0px; } .previewBoxBottom { background-color: #f0f0f0; border-width: 0px 1px 1px 1px; border-style: solid; border-color: #3c78b5; padding: 5px; margin: 0px 0px 5px 0px; text-align: center; } .functionbox { background-color: #f0f0f0; border: 1px solid #3c78b5; padding: 3px; margin: 1px 1px 10px 1px; } .functionbox-greyborder { background-color: #f0f0f0; border: 1px solid #ddd; padding: 3px; margin: 1px 1px 10px 1px; } .search-highlight { background-color: #ffffcc; } /* normal (white) background */ .rowNormal { background-color: #ffffff; } /* alternate (pale yellow) background */ .rowAlternate { background-color: #f7f7f7; } /* used in the list attachments table */ .rowAlternateNoBottomColor { background-color: #f7f7f7; } .rowAlternateNoBottomNoColor { } .rowAlternateNoBottomColor td { border-bottom: 0px; } .rowAlternateNoBottomNoColor td { border-bottom: 0px; } /* row highlight (grey) background */ .rowHighlight { background-color: #f0f0f0; } TD.greenbar {FONT-SIZE: 2px; BACKGROUND: #00df00; BORDER: 1px solid #9c9c9c; PADDING: 0px; } TD.redbar {FONT-SIZE: 2px; BACKGROUND: #df0000; BORDER: 1px solid #9c9c9c; PADDING: 0px; } TD.darkredbar {FONT-SIZE: 2px; BACKGROUND: #af0000; BORDER: 1px solid #9c9c9c; PADDING: 0px; } TR.testpassed {FONT-SIZE: 2px; BACKGROUND: #ddffdd; PADDING: 0px; } TR.testfailed {FONT-SIZE: 2px; BACKGROUND: #ffdddd; PADDING: 0px; } .toolbar { margin: 0px; border-collapse: collapse; } .toolbar td { border: 1px solid #ccc; padding: 2px 2px 2px 2px; color: #ccc; } td.noformatting { border-width: 0px; border-style: none; text-align: center; padding: 0px; } .commentblock { margin: 12px 0 12px 0; } /* * Divs displaying the license information, if necessary. */ .license-eval, .license-none, .license-nonprofit { border-top: 1px solid #bbbbbb; text-align: center; font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; } .license-eval, .license-none { background-color: #ffcccc; } .license-eval b, .license-none b { color: #990000 } .license-nonprofit { background-color: #ffffff; } /* * The shadow at the bottom of the page between the main content and the * "powered by" section. */ .bottomshadow { height: 12px; background-image: url("$req.contextPath/images/border/border_bottom.gif"); background-repeat: repeat-x; } /* * Styling of the operations box */ .navmenu .operations li, .navmenu .operations ul { list-style: none; margin-left: 0; padding-left: 0; } .navmenu .operations ul { margin-bottom: 9px; } .navmenu .label { font-weight: inherit; } /* * Styling of ops as a toolbar */ .toolbar div { display: none; } .toolbar .label { display: none; } .toolbar .operations { display: block; } .toolbar .operations ul { display: inline; list-style: none; margin-left: 10px; padding-left: 0; } .toolbar .operations li { list-style: none; display: inline; } /* list page navigational tabs */ #foldertab { padding: 3px 0px 3px 8px; margin-left: 0; border-bottom: 1px solid #3c78b5; font: bold 11px Verdana, sans-serif; } #foldertab li { list-style: none; margin: 0; display: inline; } #foldertab li a { padding: 3px 0.5em; margin-left: 3px; border: 1px solid #3c78b5; border-bottom: none; background: #3c78b5; text-decoration: none; } #foldertab li a:link { color: #ffffff; } #foldertab li a:visited { color: #ffffff; } #foldertab li a:hover { color: #ffffff; background: #003366; border-color: #003366; } #foldertab li a.current { background: white; border-bottom: 1px solid white; color: black; } #foldertab li a.current:link { color: black; } #foldertab li a.current:visited { color: black; } #foldertab li a.current:hover { background: white; border-bottom: 1px solid white; color: black; } /* alphabet list */ ul#squaretab { margin-left: 0; padding-left: 0; white-space: nowrap; font: bold 8px Verdana, sans-serif; } #squaretab li { display: inline; list-style-type: none; } #squaretab a { padding: 2px 6px; border: 1px solid #3c78b5; } #squaretab a:link, #squaretab a:visited { color: #fff; background-color: #3c78b5; text-decoration: none; } #squaretab a:hover { color: #ffffff; background-color: #003366; border-color: #003366; text-decoration: none; } #squaretab li a#current { background: white; color: black; } .blogcalendar * { font-family:verdana, arial, sans-serif; font-size:x-small; font-weight:normal; line-height:140%; padding:2px; } table.blogcalendar { border: 1px solid #3c78b5; } .blogcalendar th.calendarhead, a.calendarhead { font-size:x-small; font-weight:bold; padding:2px; text-transform:uppercase; background-color: #3c78b5; color: #ffffff; letter-spacing: .3em; text-transform: uppercase; } .calendarhead:visited {color: white;} .calendarhead:active {color: white;} .calendarhead:hover {color: white;} .blogcalendar th { font-size:x-small; font-weight:bold; padding:2px; background-color:#f0f0f0; } .blogcalendar td { font-size:x-small; font-weight:normal; } .searchGroup { padding: 0 0 10px 0; background: #f0f0f0; } .searchGroupHeading { font-size: 10px; font-weight: bold; color: #ffffff; background-color: #3c78b5; padding: 2px 4px 1px 4px; } .searchItem { padding: 1px 4px 1px 4px; } .searchItemSelected { padding: 1px 4px 1px 4px; font-weight: bold; background: #ddd; } /* permissions page styles */ .permissionHeading { border-bottom: #bbb; border-width: 0 0 1px 0; border-style: solid; font-size: 16px; text-align: left; } .permissionTab { border-width: 0 0 0 1px; border-style: solid; background: #3c78b5; color: #ffffff; font-size: 10px; } .permissionSuperTab { border-width: 0 0 0 1px; border-style: solid; background: #003366; color: #ffffff; } .permissionCell { border-left: #bbb; border-width: 0 0 0 1px; border-style: solid; } /* warning panel */ .warningPanel { background: #FFFFCE; border:#F0C000 1px solid; padding: 8px; margin: 10px; } /* alert panel */ .alertPanel { background: #FFCCCC; border:#C00 1px solid; padding: 8px; margin: 10px; } /* info panel */ .infoPanel { background: #D8E4F1; border:#3c78b5 1px solid; padding: 8px; margin: 10px; } /* side menu highlighting (e.g. space content screen) */ .optionPadded { padding: 2px; } .optionSelected { background-color: #ffffcc; padding: 2px; border: 1px solid #ddd; margin: -1px; } .optionSelected a { font-weight: bold; text-decoration: none; color: black; } /* information macros */ .noteMacro { border-style: solid; border-width: 1px; border-color: #F0C000; background-color: #FFFFCE; text-align:left; margin-top: 5px; margin-bottom: 5px} .warningMacro { border-style: solid; border-width: 1px; border-color: #c00; background-color: #fcc; text-align:left; margin-top: 5px; margin-bottom: 5px} .infoMacro { border-style: solid; border-width: 1px; border-color: #3c78b5; background-color: #D8E4F1; text-align:left; margin-top: 5px; margin-bottom: 5px} .tipMacro { border-style: solid; border-width: 1px; border-color: #090; background-color: #dfd; text-align:left; margin-top: 5px; margin-bottom: 5px} .informationMacroPadding { padding: 5px 0 0 5px; } table.infoMacro td, table.warningMacro td, table.tipMacro td, table.noteMacro td, table.sectionMacro td { border: none; } table.sectionMacroWithBorder td.columnMacro { border-style: dashed; border-width: 1px; border-color: #cccccc;} .pagecontent { padding: 10px; text-align: left; } /* styles for links in the top bar */ .topBarDiv a:link {color: #ffffff;} .topBarDiv a:visited {color: #ffffff;} .topBarDiv a:active {color: #ffffff;} .topBarDiv a:hover {color: #ffffff;} .topBarDiv {color: #ffffff;} .topBar { background-color: #003366; } /* styles for extended operations */ .greyLinks a:link {color: #666666; text-decoration:underline;} .greyLinks a:visited {color: #666666; text-decoration:underline;} .greyLinks a:active {color: #666666; text-decoration:underline;} .greyLinks a:hover {color: #666666; text-decoration:underline;} .greyLinks {color: #666666; display:block; padding: 10px} .logoSpaceLink {color: #999999; text-decoration: none} .logoSpaceLink a:link {color: #999999; text-decoration: none} .logoSpaceLink a:visited {color: #999999; text-decoration: none} .logoSpaceLink a:active {color: #999999; text-decoration: none} .logoSpaceLink a:hover {color: #003366; text-decoration: none} /* basic panel (basicpanel.vmd) style */ .basicPanelContainer {border: 1px solid #3c78b5; margin-top: 2px; margin-bottom: 8px; width: 100%} .basicPanelTitle {padding: 5px; margin: 0px; background-color: #f0f0f0; color: black; font-weight: bold;} .basicPanelBody {padding: 5px; margin: 0px} .separatorLinks a:link {color: white} .separatorLinks a:visited {color: white} .separatorLinks a:active {color: white} .greynavbar {background-color: #f0f0f0; border-top: 1px solid #3c78b5; margin-top: 2px} div.headerField { float: left; width: auto; height: 100%; } .headerFloat { margin-left: auto; width: 50%; } .headerFloatLeft { float: left; margin-right: 20px; margin-bottom: 10px; } #headerRow { padding: 10px; } div.license-personal { background-color: #003366; color: #ffffff; } div.license-personal a { color: #ffffff; } .greyFormBox { border: 1px solid #cccccc; padding: 5px; } /* IE automatically adds a margin before and after form tags. Use this style to remove that */ .marginlessForm { margin: 0px; } .openPageHighlight { background-color: #ffffcc; padding: 2px; border: 1px solid #ddd; } .editPageInsertLinks, .editPageInsertLinks a { color: #666666; font-weight: bold; font-size: 10px; } /* Style for label heatmap. */ .top10 a { font-weight: bold; font-size: 2em; color: #003366; } .top25 a { font-weight: bold; font-size: 1.6em; color: #003366; } .top50 a { font-size: 1.4em; color: #003366; } .top100 a { font-size: 1.2em; color: #003366; } .heatmap { list-style:none; width: 95%; margin: 0px auto; } .heatmap a { text-decoration:none; } .heatmap a:hover { text-decoration:underline; } .heatmap li { display: inline; } .minitab { padding: 3px 0px 3px 8px; margin-left: 0; margin-top: 1px; margin-bottom: 0px; border-bottom: 1px solid #3c78b5; font: bold 9px Verdana, sans-serif; text-decoration: none; float:none; } .selectedminitab { padding: 3px 0.5em; margin-left: 3px; margin-top: 1px; border: 1px solid #3c78b5; background: white; border-bottom: 1px solid white; color: #000000; text-decoration: none; } .unselectedminitab { padding: 3px 0.5em; margin-left: 3px; margin-top: 1px; border: 1px solid #3c78b5; border-bottom: none; background: #3c78b5; color: #ffffff; text-decoration: none; } a.unselectedminitab:hover { color: #ffffff; background: #003366; border-color: #003366; } a.unselectedminitab:link { color: white; } a.unselectedminitab:visited { color: white; } a.selectedminitab:link { color: black; } a.selectedminitab:visited { color: black; } .linkerror { background-color: #fcc;} a.labelOperationLink:link {text-decoration: underline} a.labelOperationLink:active {text-decoration: underline} a.labelOperationLink:visited {text-decoration: underline} a.labelOperationLink:hover {text-decoration: underline} a.newLabel:link {background-color: #ddffdd} a.newLabel:active {background-color: #ddffdd} a.newLabel:visited {background-color: #ddffdd} a.newLabel:hover {background-color: #ddffdd} ul.square {list-style-type: square} .inline-control-link { background: #ffc; font-size: 9px; color: #666; padding: 2px; text-transform: uppercase; text-decoration: none; } .inline-control-link a:link {text-decoration: none} .inline-control-link a:active {text-decoration: none} .inline-control-link a:visited {text-decoration: none} .inline-control-link a:hover {text-decoration: none} .inline-control-link { background: #ffc; font-size: 9px; color: #666; padding: 2px; text-transform: uppercase; text-decoration: none; cursor: pointer; } div.auto_complete { width: 350px; background: #fff; } div.auto_complete ul { border: 1px solid #888; margin: 0; padding: 0; width: 100%; list-style-type: none; } div.auto_complete ul li { margin: 0; padding: 3px; } div.auto_complete ul li.selected { background-color: #ffb; } div.auto_complete ul strong.highlight { color: #800; margin: 0; padding: 0; } /******* Edit Page Styles *******/ .toogleFormDiv{ border:1px solid #A7A6AA; background-color:white; padding:5px; margin-top: 5px; } .toogleInfoDiv{ border:1px solid #A7A6AA; background-color:white; display:none; padding:5px; margin-top: 10px; } .inputSection{ margin-bottom:20px; } #editBox{ border:1px solid lightgray; background-color:#F0F0F0; } /******* Left Navigation Theme Styles ********/ .leftnav li a { text-decoration:none; color:white; margin:0px; display:block; padding:2px; padding-left:5px; background-color: #3c78b5; border-top:1px solid #3c78b5; } .leftnav li a:active {color:white;} .leftnav li a:visited {color:white;} .leftnav li a:hover {background-color: #003366; color:white;} /* Added by Shaun during i18n */ .replaced { background-color: #33CC66; } .topPadding { margin-top: 20px; } /* new form style */ .form-block { padding: 6px; } .form-error-block { padding: 6px; background: #fcc; border-top: #f0f0f0 1px solid; border-bottom: #f0f0f0 1px solid; margin-bottom: 6px; padding: 0 12px 0 12px; } .form-element-large { font-size: 16px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; } .form-element-small { font-size: 12px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; } .form-header { background: lightyellow; border-top: #f0f0f0 1px solid; border-bottom: #f0f0f0 1px solid; margin-bottom: 6px; padding: 0 12px 0 12px; } .form-header p, .form-block p, .form-error-block p { line-height: normal; margin: 12px 0 12px 0; } .form-example { color: #888; font-size: 11px; } .form-divider { border-bottom: #ccc 1px solid; margin-bottom: 6px; } .form-buttons { margin-top: 6px; border-top: #ccc 1px solid; border-bottom: #ccc 1px solid; background: #f0f0f0; padding: 10px; text-align: center; } .form-buttons input { width: 100px; } .form-block .error { padding: 6px; margin-bottom: 6px; } --> </style> </head> <body> <div id="PageContent"> <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%"><tr> <td valign="top" class="pagebody"> <div class="pageheader"> <span class="pagetitle"> Page Created : <a href="http://cwiki.apache.org/confluence/display/openjpa">openjpa</a> : <a href="http://cwiki.apache.org/confluence/display/openjpa/Thanks">Thanks</a> </span> </div> <p> <a href="http://cwiki.apache.org/confluence/display/openjpa/Thanks">Thanks</a> has been created by <a href="http://cwiki.apache.org/confluence/display/~michael.d.dick@gmail.com">Michael Dick</a> <span class="smallfont">(Sep 29, 2008)</span>. </p> <span class="label">Content:</span><br /> <div class="greybox wiki-content"><p>The Apache OpenJPA development team would like to thank the following individuals and organizations. </p> <h1><a name="Thanks-ApacheSponsors"></a>Apache Sponsors</h1> <p>Without those sponsors, the ASF would simply not exist or sustain its activities :<br/> <span class="nobr"><a href="http://www.apache.org/foundation/thanks.html" title="Visit page outside Confluence" rel="nofollow">http://www.apache.org/foundation/thanks.html<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span></p> <p>For those who want to know more about the Apache Sponsorship Program, please check :<br/> <span class="nobr"><a href="http://www.apache.org/foundation/sponsorship.html" title="Visit page outside Confluence" rel="nofollow">http://www.apache.org/foundation/sponsorship.html<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span></p> <p>Thanks !</p> <h1><a name="Thanks-Individuals"></a>Individuals</h1> <h1><a name="Thanks-Organizations"></a>Organizations </h1> <table class='confluenceTable'><tbody> <tr> <th class='confluenceTh'>Organization </th> <th class='confluenceTh'> Donation type </th> <th class='confluenceTh'> Organization Contact </th> <th class='confluenceTh'> Apache Contact </th> </tr> <tr> <td class='confluenceTd'> <span class="nobr"><a href="http://www.ej-technologies.com" title="Visit page outside Confluence" rel="nofollow">ej-technologies<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> <td class='confluenceTd'> <span class="nobr"><a href="http://www.ej-technologies.com/products/jprofiler/overview.html" title="Visit page outside Confluence" rel="nofollow">jProfiler<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> license </td> <td class='confluenceTd'> ?? </td> <td class='confluenceTd'> Pinaki Poddar </td> </tr> </tbody></table></div> </td></tr></table></div> <p> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td height="12" background="http://cwiki.apache.org/confluence/images/border/border_bottom.gif"><img src="http://cwiki.apache.org/confluence/images/border/spacer.gif" width="1" height="1" border="0"/></td> </tr> </table> <div class="smalltext"> Powered by <a href="http://www.atlassian.com/software/confluence/default.jsp?clicked=footer" class="smalltext">Atlassian Confluence</a> (Version: 2.2.9 Build:#527 Sep 07, 2006) - <a href="http://jira.atlassian.com/secure/BrowseProject.jspa?id=10470" class="smalltext">Bug/feature request</a><br/> <br> <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action">Unsubscribe or edit your notifications preferences</a> </div> </body> </html> From commits-return-3409-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Mon Sep 29 17:56:01 2008 Return-Path: <commits-return-3409-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 57777 invoked from network); 29 Sep 2008 17:56:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Sep 2008 17:56:01 -0000 Received: (qmail 23629 invoked by uid 500); 29 Sep 2008 17:55:59 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 23619 invoked by uid 500); 29 Sep 2008 17:55:59 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 23610 invoked by uid 99); 29 Sep 2008 17:55:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Sep 2008 10:55:59 -0700 X-ASF-Spam-Status: No, hits=-1996.3 required=10.0 tests=ALL_TRUSTED,HTML_MESSAGE,MIME_HTML_ONLY X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Sep 2008 17:54:57 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 07E3C234C1E1 for <commits@openjpa.apache.org>; Mon, 29 Sep 2008 10:55:00 -0700 (PDT) Message-ID: <213571780.1222710900030.JavaMail.www-data@brutus> Date: Mon, 29 Sep 2008 10:55:00 -0700 (PDT) From: confluence@apache.org To: commits@openjpa.apache.org Subject: [CONF] OpenJPA: Thanks (page edited) MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org <html> <head> <base href="http://cwiki.apache.org/confluence" /> <style type="text/css"> <!-- body, p, td, table, tr, .bodytext, .stepfield { font-family: Verdana, arial, sans-serif; font-size: 11px; line-height: 16px; color: #000000; font-weight: normal; } #PageContent { text-align: left; background-color: #fff; padding: 0px; margin: 0px; padding-bottom:20px; } /* ** when this stylesheet is used for the Tiny MCE Wysiwyg editor's edit area, we can't ** use an id=PageContent or class=wiki-content, so we must ** set the body style to that used for PageContent, and p to that used for wiki-content. */ body { margin: 0px; padding: 0px; text-align: center; background-color: #f0f0f0; } @media print { body { background-color: #fff; } } .monospaceInput { font:12px monospace } .wiki-content p, .commentblock p { margin: 16px 0px 16px 0px; padding: 0px; } .wiki-content-preview { padding: 5px; border-left: 1px solid #3c78b5; border-right: 1px solid #3c78b5; } ul, ol { margin-top: 2px; margin-bottom: 2px; padding-top: 0px; padding-bottom: 0px; } pre { padding: 0px; margin-top: 5px; margin-left: 15px; margin-bottom: 5px; margin-right: 5px; text-align: left; } .helpheading { font-weight: bold; background-color: #D0D9BD; border-bottom: 1px solid #3c78b5; padding: 4px 4px 4px 4px; margin: 0px; margin-top: 10px; } .helpcontent { padding: 4px 4px 20px 4px; background-color: #f5f7f1; } .code { border: 1px dashed #3c78b5; font-size: 11px; font-family: Courier; margin: 10px; line-height: 13px; } .focusedComment { background: #ffffce; } .commentBox, .focusedComment { padding: 10px; margin: 5px 0 5px 0; border: 1px #bbb solid; } .codeHeader { background-color: #f0f0f0; border-bottom: 1px dashed #3c78b5; padding: 3px; text-align: center; } .codeContent { text-align: left; background-color: #f0f0f0; padding: 3px; } .preformatted { border: 1px dashed #3c78b5; font-size: 11px; font-family: Courier; margin: 10px; line-height: 13px; } .preformattedHeader { background-color: #f0f0f0; border-bottom: 1px dashed #3c78b5; padding: 3px; text-align: center; } .preformattedContent { background-color: #f0f0f0; padding: 3px; } .panel { border: 1px dashed #3c78b5; margin: 10px; margin-top: 0px; } .panelHeader { background-color: #f0f0f0; border-bottom: 1px dashed #3c78b5; padding: 3px; text-align: center; } .panelContent { background-color: #f0f0f0; padding: 5px; } .anonymousAlert { background-color: #f0f0f0; border: 1px dashed red; font-size: 11px; padding: 10px 5px 10px 5px; margin: 4px; line-height: 13px; } .lockAlert { background-color: #f0f0f0; width: 50%; border: 1px dashed red; font-size: 11px; padding: 10px 5px 10px 5px; margin: 4px; line-height: 13px; } .code-keyword { color: #000091; background-color: inherit; } .code-object { color: #910091; background-color: inherit; } .code-quote { color: #009100; background-color: inherit; } .code-comment { color: #808080; background-color: inherit; } .code-xml .code-keyword { color: inherit; font-weight: bold; } .code-tag { color: #000091; background-color: inherit; } .breadcrumbs { background-color: #f0f0f0; border-color: #3c78b5; border-width: 1px 0px 1px 0px; border-style: solid; font-size: 11px; padding: 3px 0px 3px 0px; } .navmenu { border: 1px solid #ccc; } .menuheading { font-weight: bold; background-color: #f0f0f0; border-bottom: 1px solid #3c78b5; padding: 4px 4px 2px 4px; } .menuitems { padding: 4px 4px 20px 4px; } .rightpanel { border-left: 1px solid #ccc; border-bottom: 1px solid #ccc; } #helpheading { text-align: left; font-weight: bold; background-color: #D0D9BD; border-bottom: 1px solid #3c78b5; padding: 4px 4px 4px 4px; margin: 0px; } #helpcontent { padding: 4px 4px 4px 4px; background-color: #f5f7f1; } .helptab-unselected { font-weight: bold; padding: 5px; background-color: #f5f7f1; } .helptab-selected { font-weight: bold; background-color: #D0D9BD; padding: 5px; } .helptabs { margin: 0px; background-color: #f5f7f1; padding: 5px; } .infopanel-heading { font-weight: bold; padding: 4px 0px 2px 0px; } .pagebody { } .pageheader { padding: 5px 5px 5px 0px; border-bottom: 1px solid #3c78b5; } .pagetitle { font-size: 22px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; } .newpagetitle { color: #ccc !important; } .steptitle { font-size: 18px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; margin-bottom: 7px; } .substeptitle { font-size: 12px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; margin: 2px 4px 4px 4px; padding: 2px 4px 1px 4px; } .stepdesc { font-family: Verdana, arial, sans-serif; font-size: 11px; line-height: 16px; font-weight: normal; color: #666666; margin-top: 7px; margin-bottom: 7px; } .steplabel { font-weight: bold; margin-right: 4px; color: black; float: left; width: 15%; text-align: right; } .stepfield { background: #f0f0f0; padding: 5px; } .submitButtons{ margin-top:5px; text-align:right; } .formtitle { font-size: 12px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; } .sectionbottom { border-bottom: 1px solid #3c78b5; } .topRow { border-top: 2px solid #3c78b5; } .tabletitle { font-size: 14px; font-weight: bold; font-family: Arial, sans-serif; padding: 3px 0px 2px 0px; margin: 8px 4px 2px 0px; color: #003366; border-bottom: 2px solid #3c78b5; } .pagesubheading { color: #666666; font-size: 10px; padding: 0px 0px 5px 0px; } HR { color: 3c78b5; height: 1; } A:link, A:visited, A:active, A:hover { color: #003366; } h1 A:link, h1 A:visited, h1 A:active { text-decoration: none; } h1 A:hover { border-bottom: 1px dotted #003366; } .wiki-content > :first-child, .commentblock > :first-child { margin-top: 3px; } .logocell { padding: 10px; } input { font-family: verdana, geneva, arial, sans-serif; font-size: 11px; color: #000000; } textarea, textarea.editor { font-family: verdana, geneva, arial, sans-serif; font-size: 11px; color: #333333; } /* use logoSpaceLink instead. .spacenametitle { font: 21px/31px Impact, Arial, Helvetica; font-weight: 100; color: #999999; margin: 0px; } .spacenametitle img { margin: 0 0 -4px 0; } .spacenametitle a { text-decoration: none; color: #999999; } .spacenametitle a:visited { text-decoration: none; color: #999999; }*/ .spacenametitle-printable { font: 20px/25px Impact, Arial, Helvetica; font-weight: 100; color: #999999; margin: 0px; } .spacenametitle-printable a { text-decoration: none; color: #999999; } .spacenametitle-printable a:visited { text-decoration: none; color: #999999; } .blogDate { font-weight: bold; text-decoration: none; color: black; } .blogSurtitle { background: #f0f0f0; border: 1px solid #ddd; padding: 3px; margin: 1px 1px 10px 1px; } .blogHeading { font-size: 20px; line-height: normal; font-weight: bold; padding: 0px; margin: 0px; } .blogHeading a { text-decoration: none; color: black; } .endsection { align: right; color: #666666; margin-top: 10px; } .endsectionleftnav { align: right; color: #666666; margin-top: 10px; } h1 { font-size: 24px; line-height: normal; font-weight: bold; background-color: #f0f0f0; color: #003366; border-bottom: 1px solid #3c78b5; padding: 2px; margin: 36px 0px 4px 0px; } h2 { font-size: 18px; line-height: normal; font-weight: bold; background-color: #f0f0f0; border-bottom: 1px solid #3c78b5; padding: 2px; margin: 27px 0px 4px 0px; } h3 { font-size: 14px; line-height: normal; font-weight: bold; background-color: #f0f0f0; padding: 2px; margin: 21px 0px 4px 0px; } h4 { font-size: 12px; line-height: normal; font-weight: bold; background-color: #f0f0f0; padding: 2px; margin: 18px 0px 4px 0px; } h4.search { font-size: 12px; line-height: normal; font-weight: normal; background-color: #f0f0f0; padding: 4px; margin: 18px 0px 4px 0px; } h5 { font-size: 10px; line-height: normal; font-weight: bold; background-color: #f0f0f0; padding: 2px; margin: 14px 0px 4px 0px; } h6 { font-size: 8px; line-height: normal; font-weight: bold; background-color: #f0f0f0; padding: 2px; margin: 14px 0px 4px 0px; } .smallfont { font-size: 10px; } .descfont { font-size: 10px; color: #666666; } .smallerfont { font-size: 9px; } .smalltext { color: #666666; font-size: 10px; } .smalltext a { color: #666666; } .smalltext-blue { color: #3c78b5; font-size: 10px; } .surtitle { margin-left: 1px; margin-bottom: 5px; font-size: 14px; color: #666666; } /* css hack found here: http://www.fo3nix.pwp.blueyonder.co.uk/tutorials/css/hacks/ */ .navItemOver { font-size: 10px; font-weight: bold; color: #ffffff; background-color: #003366; cursor: hand; voice-family: '\'}\''; voice-family:inherit; cursor: pointer;} .navItemOver a { color: #ffffff; background-color:#003366; text-decoration: none; } .navItemOver a:visited { color: #ffffff; background-color:#003366; text-decoration: none; } .navItemOver a:hover { color: #ffffff; background-color:#003366; text-decoration: none; } .navItem { font-size: 10px; font-weight: bold; color: #ffffff; background-color: #3c78b5; } .navItem a { color: #ffffff; text-decoration: none; } .navItem a:hover { color: #ffffff; text-decoration: none; } .navItem a:visited { color: #ffffff; text-decoration: none; } div.padded { padding: 4px; } div.thickPadded { padding: 10px; } h3.macrolibrariestitle { margin: 0px 0px 0px 0px; } div.centered { text-align: center; margin: 10px; } div.centered table {margin: 0px auto; text-align: left; } .tableview table { margin: 0; } .tableview th { text-align: left; color: #003366; font-size: 12px; padding: 5px 0px 0px 5px; border-bottom: 2px solid #3c78b5; } .tableview td { text-align: left; border-color: #ccc; border-width: 0px 0px 1px 0px; border-style: solid; margin: 0; padding: 4px 10px 4px 5px; } .grid { margin: 2px 0px 5px 0px; border-collapse: collapse; } .grid th { border: 1px solid #ccc; padding: 2px 4px 2px 4px; background: #f0f0f0; text-align: center; } .grid td { border: 1px solid #ccc; padding: 3px 4px 3px 4px; } .gridHover { background-color: #f9f9f9; } td.infocell { background-color: #f0f0f0; } .label { font-weight: bold; color: #003366; } label { font-weight: bold; color: #003366; } .error { background-color: #fcc; } .errorBox { background-color: #fcc; border: 1px solid #c00; padding: 5px; margin: 5px; } .errorMessage { color: #c00; } .success { background-color: #dfd; } .successBox { background-color: #dfd; border: 1px solid #090; padding: 5px; margin-top:5px; margin-bottom:5px; } blockquote { padding-left: 10px; padding-right: 10px; margin-left: 5px; margin-right: 0px; border-left: 1px solid #3c78b5; } table.confluenceTable { margin: 5px; border-collapse: collapse; } /* Added as a temporary fix for CONF-4223. The table elements appear to be inheriting the border: none attribute from the sectionMacro class */ table.confluenceTable td.confluenceTd { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; } /* Added as a temporary fix for CONF-4223. The table elements appear to be inheriting the border: none attribute from the sectionMacro class */ table.confluenceTable th.confluenceTh { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; background-color: #f0f0f0; text-align: center; } td.confluenceTd { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; } th.confluenceTh { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; background-color: #f0f0f0; text-align: center; } DIV.small { font-size: 9px; } H1.pagename { margin-top: 0px; } IMG.inline {} .loginform { margin: 5px; border: 1px solid #ccc; } /* The text how the "This is a preview" comment should be shown. */ .previewnote { text-align: center; font-size: 11px; color: red; } /* How the preview content should be shown */ .previewcontent { background: #E0E0E0; } /* How the system messages should be shown (DisplayMessage.jsp) */ .messagecontent { background: #E0E0E0; } /* How the "This page has been modified..." -comment should be shown. */ .conflictnote { } .createlink { color: maroon; } a.createlink { color: maroon; } .templateparameter { font-size: 9px; color: darkblue; } .diffadded { background: #ddffdd; padding: 1px 1px 1px 4px; border-left: 4px solid darkgreen; } .diffdeleted { color: #999; background: #ffdddd; padding: 1px 1px 1px 4px; border-left: 4px solid darkred; } .diffnochange { padding: 1px 1px 1px 4px; border-left: 4px solid lightgrey; } .differror { background: brown; } .diff { font-family: lucida console, courier new, fixed-width; font-size: 12px; line-height: 14px; } .diffaddedchars { background-color:#99ff99; font-weight:bolder; } .diffremovedchars { background-color:#ff9999; text-decoration: line-through; font-weight:bolder; } .greybackground { background: #f0f0f0 } .greybox { border: 1px solid #ddd; padding: 3px; margin: 1px 1px 10px 1px; } .borderedGreyBox { border: 1px solid #cccccc; background-color: #f0f0f0; padding: 10px; } .greyboxfilled { border: 1px solid #ddd; background: #f0f0f0; padding: 3px; margin: 1px 1px 10px 1px; } .navBackgroundBox { padding: 5px 5px 5px 5px; font-size: 22px; font-weight: bold; font-family: Arial, sans-serif; color: white; background: #3c78b5; text-decoration: none; } .previewBoxTop { background-color: #f0f0f0; border-width: 1px 1px 0px 1px; border-style: solid; border-color: #3c78b5; padding: 5px; margin: 5px 0px 0px 0px; text-align: center; } .previewContent { background-color: #fff; border-color: #3c78b5; border-width: 0px 1px 0px 1px; border-style: solid; padding: 10px; margin: 0px; } .previewBoxBottom { background-color: #f0f0f0; border-width: 0px 1px 1px 1px; border-style: solid; border-color: #3c78b5; padding: 5px; margin: 0px 0px 5px 0px; text-align: center; } .functionbox { background-color: #f0f0f0; border: 1px solid #3c78b5; padding: 3px; margin: 1px 1px 10px 1px; } .functionbox-greyborder { background-color: #f0f0f0; border: 1px solid #ddd; padding: 3px; margin: 1px 1px 10px 1px; } .search-highlight { background-color: #ffffcc; } /* normal (white) background */ .rowNormal { background-color: #ffffff; } /* alternate (pale yellow) background */ .rowAlternate { background-color: #f7f7f7; } /* used in the list attachments table */ .rowAlternateNoBottomColor { background-color: #f7f7f7; } .rowAlternateNoBottomNoColor { } .rowAlternateNoBottomColor td { border-bottom: 0px; } .rowAlternateNoBottomNoColor td { border-bottom: 0px; } /* row highlight (grey) background */ .rowHighlight { background-color: #f0f0f0; } TD.greenbar {FONT-SIZE: 2px; BACKGROUND: #00df00; BORDER: 1px solid #9c9c9c; PADDING: 0px; } TD.redbar {FONT-SIZE: 2px; BACKGROUND: #df0000; BORDER: 1px solid #9c9c9c; PADDING: 0px; } TD.darkredbar {FONT-SIZE: 2px; BACKGROUND: #af0000; BORDER: 1px solid #9c9c9c; PADDING: 0px; } TR.testpassed {FONT-SIZE: 2px; BACKGROUND: #ddffdd; PADDING: 0px; } TR.testfailed {FONT-SIZE: 2px; BACKGROUND: #ffdddd; PADDING: 0px; } .toolbar { margin: 0px; border-collapse: collapse; } .toolbar td { border: 1px solid #ccc; padding: 2px 2px 2px 2px; color: #ccc; } td.noformatting { border-width: 0px; border-style: none; text-align: center; padding: 0px; } .commentblock { margin: 12px 0 12px 0; } /* * Divs displaying the license information, if necessary. */ .license-eval, .license-none, .license-nonprofit { border-top: 1px solid #bbbbbb; text-align: center; font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; } .license-eval, .license-none { background-color: #ffcccc; } .license-eval b, .license-none b { color: #990000 } .license-nonprofit { background-color: #ffffff; } /* * The shadow at the bottom of the page between the main content and the * "powered by" section. */ .bottomshadow { height: 12px; background-image: url("$req.contextPath/images/border/border_bottom.gif"); background-repeat: repeat-x; } /* * Styling of the operations box */ .navmenu .operations li, .navmenu .operations ul { list-style: none; margin-left: 0; padding-left: 0; } .navmenu .operations ul { margin-bottom: 9px; } .navmenu .label { font-weight: inherit; } /* * Styling of ops as a toolbar */ .toolbar div { display: none; } .toolbar .label { display: none; } .toolbar .operations { display: block; } .toolbar .operations ul { display: inline; list-style: none; margin-left: 10px; padding-left: 0; } .toolbar .operations li { list-style: none; display: inline; } /* list page navigational tabs */ #foldertab { padding: 3px 0px 3px 8px; margin-left: 0; border-bottom: 1px solid #3c78b5; font: bold 11px Verdana, sans-serif; } #foldertab li { list-style: none; margin: 0; display: inline; } #foldertab li a { padding: 3px 0.5em; margin-left: 3px; border: 1px solid #3c78b5; border-bottom: none; background: #3c78b5; text-decoration: none; } #foldertab li a:link { color: #ffffff; } #foldertab li a:visited { color: #ffffff; } #foldertab li a:hover { color: #ffffff; background: #003366; border-color: #003366; } #foldertab li a.current { background: white; border-bottom: 1px solid white; color: black; } #foldertab li a.current:link { color: black; } #foldertab li a.current:visited { color: black; } #foldertab li a.current:hover { background: white; border-bottom: 1px solid white; color: black; } /* alphabet list */ ul#squaretab { margin-left: 0; padding-left: 0; white-space: nowrap; font: bold 8px Verdana, sans-serif; } #squaretab li { display: inline; list-style-type: none; } #squaretab a { padding: 2px 6px; border: 1px solid #3c78b5; } #squaretab a:link, #squaretab a:visited { color: #fff; background-color: #3c78b5; text-decoration: none; } #squaretab a:hover { color: #ffffff; background-color: #003366; border-color: #003366; text-decoration: none; } #squaretab li a#current { background: white; color: black; } .blogcalendar * { font-family:verdana, arial, sans-serif; font-size:x-small; font-weight:normal; line-height:140%; padding:2px; } table.blogcalendar { border: 1px solid #3c78b5; } .blogcalendar th.calendarhead, a.calendarhead { font-size:x-small; font-weight:bold; padding:2px; text-transform:uppercase; background-color: #3c78b5; color: #ffffff; letter-spacing: .3em; text-transform: uppercase; } .calendarhead:visited {color: white;} .calendarhead:active {color: white;} .calendarhead:hover {color: white;} .blogcalendar th { font-size:x-small; font-weight:bold; padding:2px; background-color:#f0f0f0; } .blogcalendar td { font-size:x-small; font-weight:normal; } .searchGroup { padding: 0 0 10px 0; background: #f0f0f0; } .searchGroupHeading { font-size: 10px; font-weight: bold; color: #ffffff; background-color: #3c78b5; padding: 2px 4px 1px 4px; } .searchItem { padding: 1px 4px 1px 4px; } .searchItemSelected { padding: 1px 4px 1px 4px; font-weight: bold; background: #ddd; } /* permissions page styles */ .permissionHeading { border-bottom: #bbb; border-width: 0 0 1px 0; border-style: solid; font-size: 16px; text-align: left; } .permissionTab { border-width: 0 0 0 1px; border-style: solid; background: #3c78b5; color: #ffffff; font-size: 10px; } .permissionSuperTab { border-width: 0 0 0 1px; border-style: solid; background: #003366; color: #ffffff; } .permissionCell { border-left: #bbb; border-width: 0 0 0 1px; border-style: solid; } /* warning panel */ .warningPanel { background: #FFFFCE; border:#F0C000 1px solid; padding: 8px; margin: 10px; } /* alert panel */ .alertPanel { background: #FFCCCC; border:#C00 1px solid; padding: 8px; margin: 10px; } /* info panel */ .infoPanel { background: #D8E4F1; border:#3c78b5 1px solid; padding: 8px; margin: 10px; } /* side menu highlighting (e.g. space content screen) */ .optionPadded { padding: 2px; } .optionSelected { background-color: #ffffcc; padding: 2px; border: 1px solid #ddd; margin: -1px; } .optionSelected a { font-weight: bold; text-decoration: none; color: black; } /* information macros */ .noteMacro { border-style: solid; border-width: 1px; border-color: #F0C000; background-color: #FFFFCE; text-align:left; margin-top: 5px; margin-bottom: 5px} .warningMacro { border-style: solid; border-width: 1px; border-color: #c00; background-color: #fcc; text-align:left; margin-top: 5px; margin-bottom: 5px} .infoMacro { border-style: solid; border-width: 1px; border-color: #3c78b5; background-color: #D8E4F1; text-align:left; margin-top: 5px; margin-bottom: 5px} .tipMacro { border-style: solid; border-width: 1px; border-color: #090; background-color: #dfd; text-align:left; margin-top: 5px; margin-bottom: 5px} .informationMacroPadding { padding: 5px 0 0 5px; } table.infoMacro td, table.warningMacro td, table.tipMacro td, table.noteMacro td, table.sectionMacro td { border: none; } table.sectionMacroWithBorder td.columnMacro { border-style: dashed; border-width: 1px; border-color: #cccccc;} .pagecontent { padding: 10px; text-align: left; } /* styles for links in the top bar */ .topBarDiv a:link {color: #ffffff;} .topBarDiv a:visited {color: #ffffff;} .topBarDiv a:active {color: #ffffff;} .topBarDiv a:hover {color: #ffffff;} .topBarDiv {color: #ffffff;} .topBar { background-color: #003366; } /* styles for extended operations */ .greyLinks a:link {color: #666666; text-decoration:underline;} .greyLinks a:visited {color: #666666; text-decoration:underline;} .greyLinks a:active {color: #666666; text-decoration:underline;} .greyLinks a:hover {color: #666666; text-decoration:underline;} .greyLinks {color: #666666; display:block; padding: 10px} .logoSpaceLink {color: #999999; text-decoration: none} .logoSpaceLink a:link {color: #999999; text-decoration: none} .logoSpaceLink a:visited {color: #999999; text-decoration: none} .logoSpaceLink a:active {color: #999999; text-decoration: none} .logoSpaceLink a:hover {color: #003366; text-decoration: none} /* basic panel (basicpanel.vmd) style */ .basicPanelContainer {border: 1px solid #3c78b5; margin-top: 2px; margin-bottom: 8px; width: 100%} .basicPanelTitle {padding: 5px; margin: 0px; background-color: #f0f0f0; color: black; font-weight: bold;} .basicPanelBody {padding: 5px; margin: 0px} .separatorLinks a:link {color: white} .separatorLinks a:visited {color: white} .separatorLinks a:active {color: white} .greynavbar {background-color: #f0f0f0; border-top: 1px solid #3c78b5; margin-top: 2px} div.headerField { float: left; width: auto; height: 100%; } .headerFloat { margin-left: auto; width: 50%; } .headerFloatLeft { float: left; margin-right: 20px; margin-bottom: 10px; } #headerRow { padding: 10px; } div.license-personal { background-color: #003366; color: #ffffff; } div.license-personal a { color: #ffffff; } .greyFormBox { border: 1px solid #cccccc; padding: 5px; } /* IE automatically adds a margin before and after form tags. Use this style to remove that */ .marginlessForm { margin: 0px; } .openPageHighlight { background-color: #ffffcc; padding: 2px; border: 1px solid #ddd; } .editPageInsertLinks, .editPageInsertLinks a { color: #666666; font-weight: bold; font-size: 10px; } /* Style for label heatmap. */ .top10 a { font-weight: bold; font-size: 2em; color: #003366; } .top25 a { font-weight: bold; font-size: 1.6em; color: #003366; } .top50 a { font-size: 1.4em; color: #003366; } .top100 a { font-size: 1.2em; color: #003366; } .heatmap { list-style:none; width: 95%; margin: 0px auto; } .heatmap a { text-decoration:none; } .heatmap a:hover { text-decoration:underline; } .heatmap li { display: inline; } .minitab { padding: 3px 0px 3px 8px; margin-left: 0; margin-top: 1px; margin-bottom: 0px; border-bottom: 1px solid #3c78b5; font: bold 9px Verdana, sans-serif; text-decoration: none; float:none; } .selectedminitab { padding: 3px 0.5em; margin-left: 3px; margin-top: 1px; border: 1px solid #3c78b5; background: white; border-bottom: 1px solid white; color: #000000; text-decoration: none; } .unselectedminitab { padding: 3px 0.5em; margin-left: 3px; margin-top: 1px; border: 1px solid #3c78b5; border-bottom: none; background: #3c78b5; color: #ffffff; text-decoration: none; } a.unselectedminitab:hover { color: #ffffff; background: #003366; border-color: #003366; } a.unselectedminitab:link { color: white; } a.unselectedminitab:visited { color: white; } a.selectedminitab:link { color: black; } a.selectedminitab:visited { color: black; } .linkerror { background-color: #fcc;} a.labelOperationLink:link {text-decoration: underline} a.labelOperationLink:active {text-decoration: underline} a.labelOperationLink:visited {text-decoration: underline} a.labelOperationLink:hover {text-decoration: underline} a.newLabel:link {background-color: #ddffdd} a.newLabel:active {background-color: #ddffdd} a.newLabel:visited {background-color: #ddffdd} a.newLabel:hover {background-color: #ddffdd} ul.square {list-style-type: square} .inline-control-link { background: #ffc; font-size: 9px; color: #666; padding: 2px; text-transform: uppercase; text-decoration: none; } .inline-control-link a:link {text-decoration: none} .inline-control-link a:active {text-decoration: none} .inline-control-link a:visited {text-decoration: none} .inline-control-link a:hover {text-decoration: none} .inline-control-link { background: #ffc; font-size: 9px; color: #666; padding: 2px; text-transform: uppercase; text-decoration: none; cursor: pointer; } div.auto_complete { width: 350px; background: #fff; } div.auto_complete ul { border: 1px solid #888; margin: 0; padding: 0; width: 100%; list-style-type: none; } div.auto_complete ul li { margin: 0; padding: 3px; } div.auto_complete ul li.selected { background-color: #ffb; } div.auto_complete ul strong.highlight { color: #800; margin: 0; padding: 0; } /******* Edit Page Styles *******/ .toogleFormDiv{ border:1px solid #A7A6AA; background-color:white; padding:5px; margin-top: 5px; } .toogleInfoDiv{ border:1px solid #A7A6AA; background-color:white; display:none; padding:5px; margin-top: 10px; } .inputSection{ margin-bottom:20px; } #editBox{ border:1px solid lightgray; background-color:#F0F0F0; } /******* Left Navigation Theme Styles ********/ .leftnav li a { text-decoration:none; color:white; margin:0px; display:block; padding:2px; padding-left:5px; background-color: #3c78b5; border-top:1px solid #3c78b5; } .leftnav li a:active {color:white;} .leftnav li a:visited {color:white;} .leftnav li a:hover {background-color: #003366; color:white;} /* Added by Shaun during i18n */ .replaced { background-color: #33CC66; } .topPadding { margin-top: 20px; } /* new form style */ .form-block { padding: 6px; } .form-error-block { padding: 6px; background: #fcc; border-top: #f0f0f0 1px solid; border-bottom: #f0f0f0 1px solid; margin-bottom: 6px; padding: 0 12px 0 12px; } .form-element-large { font-size: 16px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; } .form-element-small { font-size: 12px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; } .form-header { background: lightyellow; border-top: #f0f0f0 1px solid; border-bottom: #f0f0f0 1px solid; margin-bottom: 6px; padding: 0 12px 0 12px; } .form-header p, .form-block p, .form-error-block p { line-height: normal; margin: 12px 0 12px 0; } .form-example { color: #888; font-size: 11px; } .form-divider { border-bottom: #ccc 1px solid; margin-bottom: 6px; } .form-buttons { margin-top: 6px; border-top: #ccc 1px solid; border-bottom: #ccc 1px solid; background: #f0f0f0; padding: 10px; text-align: center; } .form-buttons input { width: 100px; } .form-block .error { padding: 6px; margin-bottom: 6px; } --> </style> </head> <body> <div id="PageContent"> <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%"><tr> <td valign="top" class="pagebody"> <div class="pageheader"> <span class="pagetitle"> Page Edited : <a href="http://cwiki.apache.org/confluence/display/openjpa">openjpa</a> : <a href="http://cwiki.apache.org/confluence/display/openjpa/Thanks">Thanks</a> </span> </div> <p> <a href="http://cwiki.apache.org/confluence/display/openjpa/Thanks">Thanks</a> has been edited by <a href="http://cwiki.apache.org/confluence/display/~michael.d.dick@gmail.com">Michael Dick</a> <span class="smallfont">(Sep 29, 2008)</span>. </p> <p> <a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=98336&originalVersion=1&revisedVersion=2">(View changes)</a> </p> <span class="label">Content:</span><br/> <div class="greybox wiki-content"> <p>The Apache OpenJPA team would like to thank the following individuals and organizations. </p> <h1><a name="Thanks-ApacheSponsors"></a>Apache Sponsors</h1> <p>Without those sponsors, the ASF would simply not exist or sustain its activities :<br/> <span class="nobr"><a href="http://www.apache.org/foundation/thanks.html" title="Visit page outside Confluence" rel="nofollow">http://www.apache.org/foundation/thanks.html<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span></p> <p>For those who want to know more about the Apache Sponsorship Program, please check :<br/> <span class="nobr"><a href="http://www.apache.org/foundation/sponsorship.html" title="Visit page outside Confluence" rel="nofollow">http://www.apache.org/foundation/sponsorship.html<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span></p> <p>Thanks !</p> <h1><a name="Thanks-Individuals"></a>Individuals</h1> <h1><a name="Thanks-Organizations"></a>Organizations </h1> <table class='confluenceTable'><tbody> <tr> <th class='confluenceTh'>Organization </th> <th class='confluenceTh'> Donation type </th> <th class='confluenceTh'> Organization Contact </th> <th class='confluenceTh'> Apache Contact </th> </tr> <tr> <td class='confluenceTd'> <span class="nobr"><a href="http://www.ej-technologies.com" title="Visit page outside Confluence" rel="nofollow">ej-technologies<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> </td> <td class='confluenceTd'> <span class="nobr"><a href="http://www.ej-technologies.com/products/jprofiler/overview.html" title="Visit page outside Confluence" rel="nofollow">jProfiler<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span> license </td> <td class='confluenceTd'> ?? </td> <td class='confluenceTd'> Pinaki Poddar </td> </tr> </tbody></table></div> </td></tr></table></div> <p> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td height="12" background="http://cwiki.apache.org/confluence/images/border/border_bottom.gif"><img src="http://cwiki.apache.org/confluence/images/border/spacer.gif" width="1" height="1" border="0"/></td> </tr> </table> <div class="smalltext"> Powered by <a href="http://www.atlassian.com/software/confluence/default.jsp?clicked=footer" class="smalltext">Atlassian Confluence</a> (Version: 2.2.9 Build:#527 Sep 07, 2006) - <a href="http://jira.atlassian.com/secure/BrowseProject.jspa?id=10470" class="smalltext">Bug/feature request</a><br/> <br> <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action">Unsubscribe or edit your notifications preferences</a> </div> </body> </html> From commits-return-3410-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Mon Sep 29 18:08:01 2008 Return-Path: <commits-return-3410-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 70412 invoked from network); 29 Sep 2008 18:08:01 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 29 Sep 2008 18:08:01 -0000 Received: (qmail 50938 invoked by uid 500); 29 Sep 2008 18:07:59 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 50928 invoked by uid 500); 29 Sep 2008 18:07:59 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 50913 invoked by uid 99); 29 Sep 2008 18:07:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Sep 2008 11:07:59 -0700 X-ASF-Spam-Status: No, hits=-1996.3 required=10.0 tests=ALL_TRUSTED,HTML_MESSAGE,MIME_HTML_ONLY X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 29 Sep 2008 18:06:57 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 0A51D234C1E2 for <commits@openjpa.apache.org>; Mon, 29 Sep 2008 11:07:00 -0700 (PDT) Message-ID: <2062939316.1222711620026.JavaMail.www-data@brutus> Date: Mon, 29 Sep 2008 11:07:00 -0700 (PDT) From: confluence@apache.org To: commits@openjpa.apache.org Subject: [CONF] OpenJPA: Thanks (page edited) MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org <html> <head> <base href="http://cwiki.apache.org/confluence" /> <style type="text/css"> <!-- body, p, td, table, tr, .bodytext, .stepfield { font-family: Verdana, arial, sans-serif; font-size: 11px; line-height: 16px; color: #000000; font-weight: normal; } #PageContent { text-align: left; background-color: #fff; padding: 0px; margin: 0px; padding-bottom:20px; } /* ** when this stylesheet is used for the Tiny MCE Wysiwyg editor's edit area, we can't ** use an id=PageContent or class=wiki-content, so we must ** set the body style to that used for PageContent, and p to that used for wiki-content. */ body { margin: 0px; padding: 0px; text-align: center; background-color: #f0f0f0; } @media print { body { background-color: #fff; } } .monospaceInput { font:12px monospace } .wiki-content p, .commentblock p { margin: 16px 0px 16px 0px; padding: 0px; } .wiki-content-preview { padding: 5px; border-left: 1px solid #3c78b5; border-right: 1px solid #3c78b5; } ul, ol { margin-top: 2px; margin-bottom: 2px; padding-top: 0px; padding-bottom: 0px; } pre { padding: 0px; margin-top: 5px; margin-left: 15px; margin-bottom: 5px; margin-right: 5px; text-align: left; } .helpheading { font-weight: bold; background-color: #D0D9BD; border-bottom: 1px solid #3c78b5; padding: 4px 4px 4px 4px; margin: 0px; margin-top: 10px; } .helpcontent { padding: 4px 4px 20px 4px; background-color: #f5f7f1; } .code { border: 1px dashed #3c78b5; font-size: 11px; font-family: Courier; margin: 10px; line-height: 13px; } .focusedComment { background: #ffffce; } .commentBox, .focusedComment { padding: 10px; margin: 5px 0 5px 0; border: 1px #bbb solid; } .codeHeader { background-color: #f0f0f0; border-bottom: 1px dashed #3c78b5; padding: 3px; text-align: center; } .codeContent { text-align: left; background-color: #f0f0f0; padding: 3px; } .preformatted { border: 1px dashed #3c78b5; font-size: 11px; font-family: Courier; margin: 10px; line-height: 13px; } .preformattedHeader { background-color: #f0f0f0; border-bottom: 1px dashed #3c78b5; padding: 3px; text-align: center; } .preformattedContent { background-color: #f0f0f0; padding: 3px; } .panel { border: 1px dashed #3c78b5; margin: 10px; margin-top: 0px; } .panelHeader { background-color: #f0f0f0; border-bottom: 1px dashed #3c78b5; padding: 3px; text-align: center; } .panelContent { background-color: #f0f0f0; padding: 5px; } .anonymousAlert { background-color: #f0f0f0; border: 1px dashed red; font-size: 11px; padding: 10px 5px 10px 5px; margin: 4px; line-height: 13px; } .lockAlert { background-color: #f0f0f0; width: 50%; border: 1px dashed red; font-size: 11px; padding: 10px 5px 10px 5px; margin: 4px; line-height: 13px; } .code-keyword { color: #000091; background-color: inherit; } .code-object { color: #910091; background-color: inherit; } .code-quote { color: #009100; background-color: inherit; } .code-comment { color: #808080; background-color: inherit; } .code-xml .code-keyword { color: inherit; font-weight: bold; } .code-tag { color: #000091; background-color: inherit; } .breadcrumbs { background-color: #f0f0f0; border-color: #3c78b5; border-width: 1px 0px 1px 0px; border-style: solid; font-size: 11px; padding: 3px 0px 3px 0px; } .navmenu { border: 1px solid #ccc; } .menuheading { font-weight: bold; background-color: #f0f0f0; border-bottom: 1px solid #3c78b5; padding: 4px 4px 2px 4px; } .menuitems { padding: 4px 4px 20px 4px; } .rightpanel { border-left: 1px solid #ccc; border-bottom: 1px solid #ccc; } #helpheading { text-align: left; font-weight: bold; background-color: #D0D9BD; border-bottom: 1px solid #3c78b5; padding: 4px 4px 4px 4px; margin: 0px; } #helpcontent { padding: 4px 4px 4px 4px; background-color: #f5f7f1; } .helptab-unselected { font-weight: bold; padding: 5px; background-color: #f5f7f1; } .helptab-selected { font-weight: bold; background-color: #D0D9BD; padding: 5px; } .helptabs { margin: 0px; background-color: #f5f7f1; padding: 5px; } .infopanel-heading { font-weight: bold; padding: 4px 0px 2px 0px; } .pagebody { } .pageheader { padding: 5px 5px 5px 0px; border-bottom: 1px solid #3c78b5; } .pagetitle { font-size: 22px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; } .newpagetitle { color: #ccc !important; } .steptitle { font-size: 18px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; margin-bottom: 7px; } .substeptitle { font-size: 12px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; margin: 2px 4px 4px 4px; padding: 2px 4px 1px 4px; } .stepdesc { font-family: Verdana, arial, sans-serif; font-size: 11px; line-height: 16px; font-weight: normal; color: #666666; margin-top: 7px; margin-bottom: 7px; } .steplabel { font-weight: bold; margin-right: 4px; color: black; float: left; width: 15%; text-align: right; } .stepfield { background: #f0f0f0; padding: 5px; } .submitButtons{ margin-top:5px; text-align:right; } .formtitle { font-size: 12px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; } .sectionbottom { border-bottom: 1px solid #3c78b5; } .topRow { border-top: 2px solid #3c78b5; } .tabletitle { font-size: 14px; font-weight: bold; font-family: Arial, sans-serif; padding: 3px 0px 2px 0px; margin: 8px 4px 2px 0px; color: #003366; border-bottom: 2px solid #3c78b5; } .pagesubheading { color: #666666; font-size: 10px; padding: 0px 0px 5px 0px; } HR { color: 3c78b5; height: 1; } A:link, A:visited, A:active, A:hover { color: #003366; } h1 A:link, h1 A:visited, h1 A:active { text-decoration: none; } h1 A:hover { border-bottom: 1px dotted #003366; } .wiki-content > :first-child, .commentblock > :first-child { margin-top: 3px; } .logocell { padding: 10px; } input { font-family: verdana, geneva, arial, sans-serif; font-size: 11px; color: #000000; } textarea, textarea.editor { font-family: verdana, geneva, arial, sans-serif; font-size: 11px; color: #333333; } /* use logoSpaceLink instead. .spacenametitle { font: 21px/31px Impact, Arial, Helvetica; font-weight: 100; color: #999999; margin: 0px; } .spacenametitle img { margin: 0 0 -4px 0; } .spacenametitle a { text-decoration: none; color: #999999; } .spacenametitle a:visited { text-decoration: none; color: #999999; }*/ .spacenametitle-printable { font: 20px/25px Impact, Arial, Helvetica; font-weight: 100; color: #999999; margin: 0px; } .spacenametitle-printable a { text-decoration: none; color: #999999; } .spacenametitle-printable a:visited { text-decoration: none; color: #999999; } .blogDate { font-weight: bold; text-decoration: none; color: black; } .blogSurtitle { background: #f0f0f0; border: 1px solid #ddd; padding: 3px; margin: 1px 1px 10px 1px; } .blogHeading { font-size: 20px; line-height: normal; font-weight: bold; padding: 0px; margin: 0px; } .blogHeading a { text-decoration: none; color: black; } .endsection { align: right; color: #666666; margin-top: 10px; } .endsectionleftnav { align: right; color: #666666; margin-top: 10px; } h1 { font-size: 24px; line-height: normal; font-weight: bold; background-color: #f0f0f0; color: #003366; border-bottom: 1px solid #3c78b5; padding: 2px; margin: 36px 0px 4px 0px; } h2 { font-size: 18px; line-height: normal; font-weight: bold; background-color: #f0f0f0; border-bottom: 1px solid #3c78b5; padding: 2px; margin: 27px 0px 4px 0px; } h3 { font-size: 14px; line-height: normal; font-weight: bold; background-color: #f0f0f0; padding: 2px; margin: 21px 0px 4px 0px; } h4 { font-size: 12px; line-height: normal; font-weight: bold; background-color: #f0f0f0; padding: 2px; margin: 18px 0px 4px 0px; } h4.search { font-size: 12px; line-height: normal; font-weight: normal; background-color: #f0f0f0; padding: 4px; margin: 18px 0px 4px 0px; } h5 { font-size: 10px; line-height: normal; font-weight: bold; background-color: #f0f0f0; padding: 2px; margin: 14px 0px 4px 0px; } h6 { font-size: 8px; line-height: normal; font-weight: bold; background-color: #f0f0f0; padding: 2px; margin: 14px 0px 4px 0px; } .smallfont { font-size: 10px; } .descfont { font-size: 10px; color: #666666; } .smallerfont { font-size: 9px; } .smalltext { color: #666666; font-size: 10px; } .smalltext a { color: #666666; } .smalltext-blue { color: #3c78b5; font-size: 10px; } .surtitle { margin-left: 1px; margin-bottom: 5px; font-size: 14px; color: #666666; } /* css hack found here: http://www.fo3nix.pwp.blueyonder.co.uk/tutorials/css/hacks/ */ .navItemOver { font-size: 10px; font-weight: bold; color: #ffffff; background-color: #003366; cursor: hand; voice-family: '\'}\''; voice-family:inherit; cursor: pointer;} .navItemOver a { color: #ffffff; background-color:#003366; text-decoration: none; } .navItemOver a:visited { color: #ffffff; background-color:#003366; text-decoration: none; } .navItemOver a:hover { color: #ffffff; background-color:#003366; text-decoration: none; } .navItem { font-size: 10px; font-weight: bold; color: #ffffff; background-color: #3c78b5; } .navItem a { color: #ffffff; text-decoration: none; } .navItem a:hover { color: #ffffff; text-decoration: none; } .navItem a:visited { color: #ffffff; text-decoration: none; } div.padded { padding: 4px; } div.thickPadded { padding: 10px; } h3.macrolibrariestitle { margin: 0px 0px 0px 0px; } div.centered { text-align: center; margin: 10px; } div.centered table {margin: 0px auto; text-align: left; } .tableview table { margin: 0; } .tableview th { text-align: left; color: #003366; font-size: 12px; padding: 5px 0px 0px 5px; border-bottom: 2px solid #3c78b5; } .tableview td { text-align: left; border-color: #ccc; border-width: 0px 0px 1px 0px; border-style: solid; margin: 0; padding: 4px 10px 4px 5px; } .grid { margin: 2px 0px 5px 0px; border-collapse: collapse; } .grid th { border: 1px solid #ccc; padding: 2px 4px 2px 4px; background: #f0f0f0; text-align: center; } .grid td { border: 1px solid #ccc; padding: 3px 4px 3px 4px; } .gridHover { background-color: #f9f9f9; } td.infocell { background-color: #f0f0f0; } .label { font-weight: bold; color: #003366; } label { font-weight: bold; color: #003366; } .error { background-color: #fcc; } .errorBox { background-color: #fcc; border: 1px solid #c00; padding: 5px; margin: 5px; } .errorMessage { color: #c00; } .success { background-color: #dfd; } .successBox { background-color: #dfd; border: 1px solid #090; padding: 5px; margin-top:5px; margin-bottom:5px; } blockquote { padding-left: 10px; padding-right: 10px; margin-left: 5px; margin-right: 0px; border-left: 1px solid #3c78b5; } table.confluenceTable { margin: 5px; border-collapse: collapse; } /* Added as a temporary fix for CONF-4223. The table elements appear to be inheriting the border: none attribute from the sectionMacro class */ table.confluenceTable td.confluenceTd { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; } /* Added as a temporary fix for CONF-4223. The table elements appear to be inheriting the border: none attribute from the sectionMacro class */ table.confluenceTable th.confluenceTh { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; background-color: #f0f0f0; text-align: center; } td.confluenceTd { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; } th.confluenceTh { border-width: 1px; border-style: solid; border-color: #ccc; padding: 3px 4px 3px 4px; background-color: #f0f0f0; text-align: center; } DIV.small { font-size: 9px; } H1.pagename { margin-top: 0px; } IMG.inline {} .loginform { margin: 5px; border: 1px solid #ccc; } /* The text how the "This is a preview" comment should be shown. */ .previewnote { text-align: center; font-size: 11px; color: red; } /* How the preview content should be shown */ .previewcontent { background: #E0E0E0; } /* How the system messages should be shown (DisplayMessage.jsp) */ .messagecontent { background: #E0E0E0; } /* How the "This page has been modified..." -comment should be shown. */ .conflictnote { } .createlink { color: maroon; } a.createlink { color: maroon; } .templateparameter { font-size: 9px; color: darkblue; } .diffadded { background: #ddffdd; padding: 1px 1px 1px 4px; border-left: 4px solid darkgreen; } .diffdeleted { color: #999; background: #ffdddd; padding: 1px 1px 1px 4px; border-left: 4px solid darkred; } .diffnochange { padding: 1px 1px 1px 4px; border-left: 4px solid lightgrey; } .differror { background: brown; } .diff { font-family: lucida console, courier new, fixed-width; font-size: 12px; line-height: 14px; } .diffaddedchars { background-color:#99ff99; font-weight:bolder; } .diffremovedchars { background-color:#ff9999; text-decoration: line-through; font-weight:bolder; } .greybackground { background: #f0f0f0 } .greybox { border: 1px solid #ddd; padding: 3px; margin: 1px 1px 10px 1px; } .borderedGreyBox { border: 1px solid #cccccc; background-color: #f0f0f0; padding: 10px; } .greyboxfilled { border: 1px solid #ddd; background: #f0f0f0; padding: 3px; margin: 1px 1px 10px 1px; } .navBackgroundBox { padding: 5px 5px 5px 5px; font-size: 22px; font-weight: bold; font-family: Arial, sans-serif; color: white; background: #3c78b5; text-decoration: none; } .previewBoxTop { background-color: #f0f0f0; border-width: 1px 1px 0px 1px; border-style: solid; border-color: #3c78b5; padding: 5px; margin: 5px 0px 0px 0px; text-align: center; } .previewContent { background-color: #fff; border-color: #3c78b5; border-width: 0px 1px 0px 1px; border-style: solid; padding: 10px; margin: 0px; } .previewBoxBottom { background-color: #f0f0f0; border-width: 0px 1px 1px 1px; border-style: solid; border-color: #3c78b5; padding: 5px; margin: 0px 0px 5px 0px; text-align: center; } .functionbox { background-color: #f0f0f0; border: 1px solid #3c78b5; padding: 3px; margin: 1px 1px 10px 1px; } .functionbox-greyborder { background-color: #f0f0f0; border: 1px solid #ddd; padding: 3px; margin: 1px 1px 10px 1px; } .search-highlight { background-color: #ffffcc; } /* normal (white) background */ .rowNormal { background-color: #ffffff; } /* alternate (pale yellow) background */ .rowAlternate { background-color: #f7f7f7; } /* used in the list attachments table */ .rowAlternateNoBottomColor { background-color: #f7f7f7; } .rowAlternateNoBottomNoColor { } .rowAlternateNoBottomColor td { border-bottom: 0px; } .rowAlternateNoBottomNoColor td { border-bottom: 0px; } /* row highlight (grey) background */ .rowHighlight { background-color: #f0f0f0; } TD.greenbar {FONT-SIZE: 2px; BACKGROUND: #00df00; BORDER: 1px solid #9c9c9c; PADDING: 0px; } TD.redbar {FONT-SIZE: 2px; BACKGROUND: #df0000; BORDER: 1px solid #9c9c9c; PADDING: 0px; } TD.darkredbar {FONT-SIZE: 2px; BACKGROUND: #af0000; BORDER: 1px solid #9c9c9c; PADDING: 0px; } TR.testpassed {FONT-SIZE: 2px; BACKGROUND: #ddffdd; PADDING: 0px; } TR.testfailed {FONT-SIZE: 2px; BACKGROUND: #ffdddd; PADDING: 0px; } .toolbar { margin: 0px; border-collapse: collapse; } .toolbar td { border: 1px solid #ccc; padding: 2px 2px 2px 2px; color: #ccc; } td.noformatting { border-width: 0px; border-style: none; text-align: center; padding: 0px; } .commentblock { margin: 12px 0 12px 0; } /* * Divs displaying the license information, if necessary. */ .license-eval, .license-none, .license-nonprofit { border-top: 1px solid #bbbbbb; text-align: center; font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; } .license-eval, .license-none { background-color: #ffcccc; } .license-eval b, .license-none b { color: #990000 } .license-nonprofit { background-color: #ffffff; } /* * The shadow at the bottom of the page between the main content and the * "powered by" section. */ .bottomshadow { height: 12px; background-image: url("$req.contextPath/images/border/border_bottom.gif"); background-repeat: repeat-x; } /* * Styling of the operations box */ .navmenu .operations li, .navmenu .operations ul { list-style: none; margin-left: 0; padding-left: 0; } .navmenu .operations ul { margin-bottom: 9px; } .navmenu .label { font-weight: inherit; } /* * Styling of ops as a toolbar */ .toolbar div { display: none; } .toolbar .label { display: none; } .toolbar .operations { display: block; } .toolbar .operations ul { display: inline; list-style: none; margin-left: 10px; padding-left: 0; } .toolbar .operations li { list-style: none; display: inline; } /* list page navigational tabs */ #foldertab { padding: 3px 0px 3px 8px; margin-left: 0; border-bottom: 1px solid #3c78b5; font: bold 11px Verdana, sans-serif; } #foldertab li { list-style: none; margin: 0; display: inline; } #foldertab li a { padding: 3px 0.5em; margin-left: 3px; border: 1px solid #3c78b5; border-bottom: none; background: #3c78b5; text-decoration: none; } #foldertab li a:link { color: #ffffff; } #foldertab li a:visited { color: #ffffff; } #foldertab li a:hover { color: #ffffff; background: #003366; border-color: #003366; } #foldertab li a.current { background: white; border-bottom: 1px solid white; color: black; } #foldertab li a.current:link { color: black; } #foldertab li a.current:visited { color: black; } #foldertab li a.current:hover { background: white; border-bottom: 1px solid white; color: black; } /* alphabet list */ ul#squaretab { margin-left: 0; padding-left: 0; white-space: nowrap; font: bold 8px Verdana, sans-serif; } #squaretab li { display: inline; list-style-type: none; } #squaretab a { padding: 2px 6px; border: 1px solid #3c78b5; } #squaretab a:link, #squaretab a:visited { color: #fff; background-color: #3c78b5; text-decoration: none; } #squaretab a:hover { color: #ffffff; background-color: #003366; border-color: #003366; text-decoration: none; } #squaretab li a#current { background: white; color: black; } .blogcalendar * { font-family:verdana, arial, sans-serif; font-size:x-small; font-weight:normal; line-height:140%; padding:2px; } table.blogcalendar { border: 1px solid #3c78b5; } .blogcalendar th.calendarhead, a.calendarhead { font-size:x-small; font-weight:bold; padding:2px; text-transform:uppercase; background-color: #3c78b5; color: #ffffff; letter-spacing: .3em; text-transform: uppercase; } .calendarhead:visited {color: white;} .calendarhead:active {color: white;} .calendarhead:hover {color: white;} .blogcalendar th { font-size:x-small; font-weight:bold; padding:2px; background-color:#f0f0f0; } .blogcalendar td { font-size:x-small; font-weight:normal; } .searchGroup { padding: 0 0 10px 0; background: #f0f0f0; } .searchGroupHeading { font-size: 10px; font-weight: bold; color: #ffffff; background-color: #3c78b5; padding: 2px 4px 1px 4px; } .searchItem { padding: 1px 4px 1px 4px; } .searchItemSelected { padding: 1px 4px 1px 4px; font-weight: bold; background: #ddd; } /* permissions page styles */ .permissionHeading { border-bottom: #bbb; border-width: 0 0 1px 0; border-style: solid; font-size: 16px; text-align: left; } .permissionTab { border-width: 0 0 0 1px; border-style: solid; background: #3c78b5; color: #ffffff; font-size: 10px; } .permissionSuperTab { border-width: 0 0 0 1px; border-style: solid; background: #003366; color: #ffffff; } .permissionCell { border-left: #bbb; border-width: 0 0 0 1px; border-style: solid; } /* warning panel */ .warningPanel { background: #FFFFCE; border:#F0C000 1px solid; padding: 8px; margin: 10px; } /* alert panel */ .alertPanel { background: #FFCCCC; border:#C00 1px solid; padding: 8px; margin: 10px; } /* info panel */ .infoPanel { background: #D8E4F1; border:#3c78b5 1px solid; padding: 8px; margin: 10px; } /* side menu highlighting (e.g. space content screen) */ .optionPadded { padding: 2px; } .optionSelected { background-color: #ffffcc; padding: 2px; border: 1px solid #ddd; margin: -1px; } .optionSelected a { font-weight: bold; text-decoration: none; color: black; } /* information macros */ .noteMacro { border-style: solid; border-width: 1px; border-color: #F0C000; background-color: #FFFFCE; text-align:left; margin-top: 5px; margin-bottom: 5px} .warningMacro { border-style: solid; border-width: 1px; border-color: #c00; background-color: #fcc; text-align:left; margin-top: 5px; margin-bottom: 5px} .infoMacro { border-style: solid; border-width: 1px; border-color: #3c78b5; background-color: #D8E4F1; text-align:left; margin-top: 5px; margin-bottom: 5px} .tipMacro { border-style: solid; border-width: 1px; border-color: #090; background-color: #dfd; text-align:left; margin-top: 5px; margin-bottom: 5px} .informationMacroPadding { padding: 5px 0 0 5px; } table.infoMacro td, table.warningMacro td, table.tipMacro td, table.noteMacro td, table.sectionMacro td { border: none; } table.sectionMacroWithBorder td.columnMacro { border-style: dashed; border-width: 1px; border-color: #cccccc;} .pagecontent { padding: 10px; text-align: left; } /* styles for links in the top bar */ .topBarDiv a:link {color: #ffffff;} .topBarDiv a:visited {color: #ffffff;} .topBarDiv a:active {color: #ffffff;} .topBarDiv a:hover {color: #ffffff;} .topBarDiv {color: #ffffff;} .topBar { background-color: #003366; } /* styles for extended operations */ .greyLinks a:link {color: #666666; text-decoration:underline;} .greyLinks a:visited {color: #666666; text-decoration:underline;} .greyLinks a:active {color: #666666; text-decoration:underline;} .greyLinks a:hover {color: #666666; text-decoration:underline;} .greyLinks {color: #666666; display:block; padding: 10px} .logoSpaceLink {color: #999999; text-decoration: none} .logoSpaceLink a:link {color: #999999; text-decoration: none} .logoSpaceLink a:visited {color: #999999; text-decoration: none} .logoSpaceLink a:active {color: #999999; text-decoration: none} .logoSpaceLink a:hover {color: #003366; text-decoration: none} /* basic panel (basicpanel.vmd) style */ .basicPanelContainer {border: 1px solid #3c78b5; margin-top: 2px; margin-bottom: 8px; width: 100%} .basicPanelTitle {padding: 5px; margin: 0px; background-color: #f0f0f0; color: black; font-weight: bold;} .basicPanelBody {padding: 5px; margin: 0px} .separatorLinks a:link {color: white} .separatorLinks a:visited {color: white} .separatorLinks a:active {color: white} .greynavbar {background-color: #f0f0f0; border-top: 1px solid #3c78b5; margin-top: 2px} div.headerField { float: left; width: auto; height: 100%; } .headerFloat { margin-left: auto; width: 50%; } .headerFloatLeft { float: left; margin-right: 20px; margin-bottom: 10px; } #headerRow { padding: 10px; } div.license-personal { background-color: #003366; color: #ffffff; } div.license-personal a { color: #ffffff; } .greyFormBox { border: 1px solid #cccccc; padding: 5px; } /* IE automatically adds a margin before and after form tags. Use this style to remove that */ .marginlessForm { margin: 0px; } .openPageHighlight { background-color: #ffffcc; padding: 2px; border: 1px solid #ddd; } .editPageInsertLinks, .editPageInsertLinks a { color: #666666; font-weight: bold; font-size: 10px; } /* Style for label heatmap. */ .top10 a { font-weight: bold; font-size: 2em; color: #003366; } .top25 a { font-weight: bold; font-size: 1.6em; color: #003366; } .top50 a { font-size: 1.4em; color: #003366; } .top100 a { font-size: 1.2em; color: #003366; } .heatmap { list-style:none; width: 95%; margin: 0px auto; } .heatmap a { text-decoration:none; } .heatmap a:hover { text-decoration:underline; } .heatmap li { display: inline; } .minitab { padding: 3px 0px 3px 8px; margin-left: 0; margin-top: 1px; margin-bottom: 0px; border-bottom: 1px solid #3c78b5; font: bold 9px Verdana, sans-serif; text-decoration: none; float:none; } .selectedminitab { padding: 3px 0.5em; margin-left: 3px; margin-top: 1px; border: 1px solid #3c78b5; background: white; border-bottom: 1px solid white; color: #000000; text-decoration: none; } .unselectedminitab { padding: 3px 0.5em; margin-left: 3px; margin-top: 1px; border: 1px solid #3c78b5; border-bottom: none; background: #3c78b5; color: #ffffff; text-decoration: none; } a.unselectedminitab:hover { color: #ffffff; background: #003366; border-color: #003366; } a.unselectedminitab:link { color: white; } a.unselectedminitab:visited { color: white; } a.selectedminitab:link { color: black; } a.selectedminitab:visited { color: black; } .linkerror { background-color: #fcc;} a.labelOperationLink:link {text-decoration: underline} a.labelOperationLink:active {text-decoration: underline} a.labelOperationLink:visited {text-decoration: underline} a.labelOperationLink:hover {text-decoration: underline} a.newLabel:link {background-color: #ddffdd} a.newLabel:active {background-color: #ddffdd} a.newLabel:visited {background-color: #ddffdd} a.newLabel:hover {background-color: #ddffdd} ul.square {list-style-type: square} .inline-control-link { background: #ffc; font-size: 9px; color: #666; padding: 2px; text-transform: uppercase; text-decoration: none; } .inline-control-link a:link {text-decoration: none} .inline-control-link a:active {text-decoration: none} .inline-control-link a:visited {text-decoration: none} .inline-control-link a:hover {text-decoration: none} .inline-control-link { background: #ffc; font-size: 9px; color: #666; padding: 2px; text-transform: uppercase; text-decoration: none; cursor: pointer; } div.auto_complete { width: 350px; background: #fff; } div.auto_complete ul { border: 1px solid #888; margin: 0; padding: 0; width: 100%; list-style-type: none; } div.auto_complete ul li { margin: 0; padding: 3px; } div.auto_complete ul li.selected { background-color: #ffb; } div.auto_complete ul strong.highlight { color: #800; margin: 0; padding: 0; } /******* Edit Page Styles *******/ .toogleFormDiv{ border:1px solid #A7A6AA; background-color:white; padding:5px; margin-top: 5px; } .toogleInfoDiv{ border:1px solid #A7A6AA; background-color:white; display:none; padding:5px; margin-top: 10px; } .inputSection{ margin-bottom:20px; } #editBox{ border:1px solid lightgray; background-color:#F0F0F0; } /******* Left Navigation Theme Styles ********/ .leftnav li a { text-decoration:none; color:white; margin:0px; display:block; padding:2px; padding-left:5px; background-color: #3c78b5; border-top:1px solid #3c78b5; } .leftnav li a:active {color:white;} .leftnav li a:visited {color:white;} .leftnav li a:hover {background-color: #003366; color:white;} /* Added by Shaun during i18n */ .replaced { background-color: #33CC66; } .topPadding { margin-top: 20px; } /* new form style */ .form-block { padding: 6px; } .form-error-block { padding: 6px; background: #fcc; border-top: #f0f0f0 1px solid; border-bottom: #f0f0f0 1px solid; margin-bottom: 6px; padding: 0 12px 0 12px; } .form-element-large { font-size: 16px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; } .form-element-small { font-size: 12px; font-weight: bold; font-family: Arial, sans-serif; color: #003366; } .form-header { background: lightyellow; border-top: #f0f0f0 1px solid; border-bottom: #f0f0f0 1px solid; margin-bottom: 6px; padding: 0 12px 0 12px; } .form-header p, .form-block p, .form-error-block p { line-height: normal; margin: 12px 0 12px 0; } .form-example { color: #888; font-size: 11px; } .form-divider { border-bottom: #ccc 1px solid; margin-bottom: 6px; } .form-buttons { margin-top: 6px; border-top: #ccc 1px solid; border-bottom: #ccc 1px solid; background: #f0f0f0; padding: 10px; text-align: center; } .form-buttons input { width: 100px; } .form-block .error { padding: 6px; margin-bottom: 6px; } --> </style> </head> <body> <div id="PageContent"> <table class="pagecontent" border="0" cellpadding="0" cellspacing="0" width="100%"><tr> <td valign="top" class="pagebody"> <div class="pageheader"> <span class="pagetitle"> Page Edited : <a href="http://cwiki.apache.org/confluence/display/openjpa">openjpa</a> : <a href="http://cwiki.apache.org/confluence/display/openjpa/Thanks">Thanks</a> </span> </div> <p> <a href="http://cwiki.apache.org/confluence/display/openjpa/Thanks">Thanks</a> has been edited by <a href="http://cwiki.apache.org/confluence/display/~michael.d.dick@gmail.com">Michael Dick</a> <span class="smallfont">(Sep 29, 2008)</span>. </p> <p> Change summary: <div class="greybox wiki-content"><p>Re-read the email wrt a thanks page. Until we have a conclusive answer I've commented out the like to jProfiler. Links to Apache Sponsors are left in place though. </p></div> </p> <p> <a href="http://cwiki.apache.org/confluence/pages/diffpagesbyversion.action?pageId=98336&originalVersion=4&revisedVersion=5">(View changes)</a> </p> <span class="label">Content:</span><br/> <div class="greybox wiki-content"> <p>The Apache OpenJPA team would like to thank the following individuals and organizations. </p> <h3><a name="Thanks-ApacheSponsors"></a>Apache Sponsors</h3> <p>Without those sponsors, the ASF would simply not exist or sustain its activities :<br/> <span class="nobr"><a href="http://www.apache.org/foundation/thanks.html" title="Visit page outside Confluence" rel="nofollow">http://www.apache.org/foundation/thanks.html<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span></p> <p>For those who want to know more about the Apache Sponsorship Program, please check :<br/> <span class="nobr"><a href="http://www.apache.org/foundation/sponsorship.html" title="Visit page outside Confluence" rel="nofollow">http://www.apache.org/foundation/sponsorship.html<sup><img class="rendericon" src="/confluence/images/icons/linkext7.gif" height="7" width="7" align="absmiddle" alt="" border="0"/></sup></a></span></p> <p>Thanks !</p> <p> </p></div> </td></tr></table></div> <p> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td height="12" background="http://cwiki.apache.org/confluence/images/border/border_bottom.gif"><img src="http://cwiki.apache.org/confluence/images/border/spacer.gif" width="1" height="1" border="0"/></td> </tr> </table> <div class="smalltext"> Powered by <a href="http://www.atlassian.com/software/confluence/default.jsp?clicked=footer" class="smalltext">Atlassian Confluence</a> (Version: 2.2.9 Build:#527 Sep 07, 2006) - <a href="http://jira.atlassian.com/secure/BrowseProject.jspa?id=10470" class="smalltext">Bug/feature request</a><br/> <br> <a href="http://cwiki.apache.org/confluence/users/viewnotifications.action">Unsubscribe or edit your notifications preferences</a> </div> </body> </html> From commits-return-3411-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Tue Sep 30 19:42:35 2008 Return-Path: <commits-return-3411-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 93744 invoked from network); 30 Sep 2008 19:42:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Sep 2008 19:42:35 -0000 Received: (qmail 4092 invoked by uid 500); 30 Sep 2008 19:42:33 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 4083 invoked by uid 500); 30 Sep 2008 19:42:33 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 4073 invoked by uid 99); 30 Sep 2008 19:42:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Sep 2008 12:42:33 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Sep 2008 19:41:37 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 131E02388A08; Tue, 30 Sep 2008 12:42:12 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r700563 [2/3] - in /openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/TestEmbedded.java Date: Tue, 30 Sep 2008 19:42:11 -0000 To: commits@openjpa.apache.org From: jrbauer@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080930194212.131E02388A08@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java?rev=700563&r1=700562&r2=700563&view=diff ============================================================================== --- openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java (original) +++ openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java Tue Sep 30 12:42:11 2008 @@ -1,3258 +1,3259 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.openjpa.kernel; - -import java.io.IOException; -import java.io.NotSerializableException; -import java.io.ObjectInputStream; -import java.io.ObjectOutput; -import java.io.ObjectOutputStream; -import java.io.Serializable; -import java.lang.reflect.Modifier; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.BitSet; -import java.util.Calendar; -import java.util.Comparator; -import java.util.Date; -import java.util.HashMap; -import java.util.Iterator; -import java.util.TimeZone; - -import org.apache.commons.lang.StringUtils; -import org.apache.openjpa.conf.OpenJPAConfiguration; -import org.apache.openjpa.enhance.DynamicPersistenceCapable; -import org.apache.openjpa.enhance.FieldManager; -import org.apache.openjpa.enhance.ManagedInstanceProvider; -import org.apache.openjpa.enhance.PCRegistry; -import org.apache.openjpa.enhance.PersistenceCapable; -import org.apache.openjpa.enhance.RedefinitionHelper; -import org.apache.openjpa.enhance.StateManager; -import org.apache.openjpa.event.LifecycleEvent; -import org.apache.openjpa.event.LifecycleEventManager; -import org.apache.openjpa.lib.util.Localizer; -import org.apache.openjpa.meta.ClassMetaData; -import org.apache.openjpa.meta.FetchGroup; -import org.apache.openjpa.meta.FieldMetaData; -import org.apache.openjpa.meta.JavaTypes; -import org.apache.openjpa.meta.UpdateStrategies; -import org.apache.openjpa.meta.ValueMetaData; -import org.apache.openjpa.meta.ValueStrategies; -import org.apache.openjpa.util.ApplicationIds; -import org.apache.openjpa.util.Exceptions; -import org.apache.openjpa.util.ImplHelper; -import org.apache.openjpa.util.InternalException; -import org.apache.openjpa.util.InvalidStateException; -import org.apache.openjpa.util.ObjectNotFoundException; -import org.apache.openjpa.util.OpenJPAId; -import org.apache.openjpa.util.ProxyManager; -import org.apache.openjpa.util.RuntimeExceptionTranslator; -import org.apache.openjpa.util.UserException; -import serp.util.Numbers; - -/** - * Implementation of the {@link OpenJPAStateManager} interface for use - * with this runtime. Each state manager manages the state of a single - * persistence capable instance. The state manager is also responsible for - * all communications about the instance to the {@link StoreManager}. - * The state manager uses the State pattern in both its interaction with - * the governed instance and its interaction with the broker. - * In its interactions with the persistence capable instance, it uses the - * {@link FieldManager} interface. Similarly, when interacting with the - * broker, it uses the {@link PCState} singleton that represents - * the current lifecycle state of the instance. - * - * @author Abe White - */ -public class StateManagerImpl - implements OpenJPAStateManager, Serializable { - - public static final int LOAD_FGS = 0; - public static final int LOAD_ALL = 1; - public static final int LOAD_SERIALIZE = 2; - - private static final int FLAG_SAVE = 2 << 0; - private static final int FLAG_DEREF = 2 << 1; - private static final int FLAG_LOADED = 2 << 2; - private static final int FLAG_READ_LOCKED = 2 << 3; - private static final int FLAG_WRITE_LOCKED = 2 << 4; - private static final int FLAG_OID_ASSIGNED = 2 << 5; - private static final int FLAG_LOADING = 2 << 6; - private static final int FLAG_PRE_DELETING = 2 << 7; - private static final int FLAG_FLUSHED = 2 << 8; - private static final int FLAG_PRE_FLUSHED = 2 << 9; - private static final int FLAG_FLUSHED_DIRTY = 2 << 10; - private static final int FLAG_IMPL_CACHE = 2 << 11; - private static final int FLAG_INVERSES = 2 << 12; - private static final int FLAG_NO_UNPROXY = 2 << 13; - private static final int FLAG_VERSION_CHECK = 2 << 14; - private static final int FLAG_VERSION_UPDATE = 2 << 15; - private static final int FLAG_DETACHING = 2 << 16; - - private static final Localizer _loc = Localizer.forPackage - (StateManagerImpl.class); - - // information about the instance - private transient PersistenceCapable _pc = null; - private transient ClassMetaData _meta = null; - private BitSet _loaded = null; - private BitSet _dirty = null; - private BitSet _flush = null; - private int _flags = 0; - - // id is the state manager identity; oid is the persistent identity. oid - // may be null for embedded and transient-transactional objects or new - // instances that haven't been assigned an oid. id is reassigned to oid - // on successful oid assignment (or flush completion if assignment is - // during flush) - private Object _id = null; - private Object _oid = null; - - // the managing persistence manager and lifecycle state - private transient BrokerImpl _broker; // this is serialized specially - private PCState _state = PCState.TRANSIENT; - - // the current and last loaded version indicators, and the lock object - private Object _version = null; - private Object _loadVersion = null; - private Object _lock = null; - private int _readLockLevel = -1; - private int _writeLockLevel = -1; - - // delegates when providing/replacing instance data - private SingleFieldManager _single = null; - private SaveFieldManager _saved = null; - private FieldManager _fm = null; - - // impldata; field impldata and intermediate data share the same array - private Object _impl = null; - private Object[] _fieldImpl = null; - - // information about the owner of this instance, if it is embedded - private StateManagerImpl _owner = null; - private int _ownerIndex = -1; - - /** - * Constructor; supply id, type metadata, and owning persistence manager. - */ - protected StateManagerImpl(Object id, ClassMetaData meta, - BrokerImpl broker) { - _id = id; - _meta = meta; - _broker = broker; - _single = new SingleFieldManager(this, broker); - - if (_meta.getIdentityType() == ClassMetaData.ID_UNKNOWN) - throw new UserException(_loc.get("meta-unknownid", _meta)); - } - - /** - * Set the owning state and field if this is an embedded instance. - */ - void setOwner(StateManagerImpl owner, ValueMetaData ownerMeta) { - _owner = owner; - _ownerIndex = ownerMeta.getFieldMetaData().getIndex(); - } - - /** - * Whether this state manager is in the middle of a load. - */ - boolean isLoading() { - return (_flags & FLAG_LOADING) > 0; - } - - /** - * Whether this state manager is in the middle of a load initiated - * by outside code; for any internal methods that cause loading, the - * loading flag is set automatically. - */ - void setLoading(boolean loading) { - if (loading) - _flags |= FLAG_LOADING; - else - _flags &= ~FLAG_LOADING; - } - - /** - * Set or reset the lifecycle state of the managed instance. If the - * transactional state of the instance changes, it will be enlisted/ - * delisted from the current transaction as necessary. The given - * state will be initialized after being set. If the given state - * is the same as the current state, this method will have no effect. - */ - private void setPCState(PCState state) { - if (_state == state) - return; - - lock(); - try { - // notify the store manager that we're changing states; can veto - _broker.getStoreManager().beforeStateChange(this, _state, state); - - // replace state - boolean wasDeleted = _state.isDeleted(); - boolean wasDirty = _state.isDirty(); - boolean wasPending = _state.isPendingTransactional(); - _state = state; - - // enlist/delist from transaction - if (_state.isTransactional()) { - _broker.addToTransaction(this); - if (_state.isDeleted() != wasDeleted) - _broker.setDirty(this, !wasDirty || isFlushed()); - else if (_state.isDirty() && !wasDirty) - _broker.setDirty(this, true); - } else if (!wasPending && _state.isPendingTransactional()) - _broker.addToPendingTransaction(this); - else if (wasPending && !_state.isPendingTransactional()) - _broker.removeFromPendingTransaction(this); - else - _broker.removeFromTransaction(this); - - // initialize - _state.initialize(this); - if (_state.isDeleted() && !wasDeleted) - fireLifecycleEvent(LifecycleEvent.AFTER_DELETE); - } finally { - unlock(); - } - } - - ////////////////////////////////////// - // OpenJPAStateManager implementation - ////////////////////////////////////// - - public void initialize(Class cls, PCState state) { - // check to see if our current object id instance is the - // correct id type for the specified class; this is for cases - // when we have an application id hierarchy and we had set the - // metadata to a superclass id -- the subclass' id may be a - // different class, so we need to reset it - if (_meta.getDescribedType() != cls) { - ClassMetaData sub = _meta.getRepository().getMetaData - (cls, _broker.getClassLoader(), true); - if (_oid != null) { - if (_meta.getIdentityType() == ClassMetaData.ID_DATASTORE) - _oid = _broker.getStoreManager().copyDataStoreId(_oid, - sub); - else if (_meta.isOpenJPAIdentity()) - _oid = ApplicationIds.copy(_oid, sub); - else if (sub.getObjectIdType() != _meta.getObjectIdType()) { - Object[] pkFields = ApplicationIds.toPKValues(_oid, _meta); - _oid = ApplicationIds.fromPKValues(pkFields, sub); - } - } - _meta = sub; - } - - PersistenceCapable inst = PCRegistry.newInstance(cls, this, _oid, true); - if (inst == null) { - // the instance was null: check to see if the instance is - // abstract (as can sometimes be the case when the - // class discriminator strategy is not configured correctly) - if (Modifier.isAbstract(cls.getModifiers())) - throw new UserException(_loc.get("instantiate-abstract", - cls.getName(), _oid)); - throw new InternalException(); - } - - initialize(inst, state); - } - - /** - * Initialize with the given instance and state. - */ - protected void initialize(PersistenceCapable pc, PCState state) { - if (pc == null) - throw new UserException(_loc.get("init-null-pc", _meta)); - if (pc.pcGetStateManager() != null && pc.pcGetStateManager() != this) - throw new UserException(_loc.get("init-sm-pc", - Exceptions.toString(pc))).setFailedObject(pc); - pc.pcReplaceStateManager(this); - - FieldMetaData[] fmds = _meta.getFields(); - _loaded = new BitSet(fmds.length); - _flush = new BitSet(fmds.length); - _dirty = new BitSet(fmds.length); - - for (int i = 0; i < fmds.length; i++) { - // mark primary key and non-persistent fields as loaded - if (fmds[i].isPrimaryKey() - || fmds[i].getManagement() != fmds[i].MANAGE_PERSISTENT) - _loaded.set(i); - - // record whether there are any managed inverse fields - if (_broker.getInverseManager() != null - && fmds[i].getInverseMetaDatas().length > 0) - _flags |= FLAG_INVERSES; - } - - pc.pcSetDetachedState(null); - _pc = pc; - - if (_oid instanceof OpenJPAId) - ((OpenJPAId) _oid).setManagedInstanceType(_meta.getDescribedType()); - - // initialize our state and add ourselves to the broker's cache - setPCState(state); - if (_broker.getStateManagerImplById(getObjectId(), false) == null) { - _broker.setStateManager(_id, this, BrokerImpl.STATUS_INIT); - } - if (state == PCState.PNEW) - fireLifecycleEvent(LifecycleEvent.AFTER_PERSIST); - - // if this is a non-tracking PC, add a hard ref to the appropriate data - // sets and give it an opportunity to make a state snapshot. - if (!isIntercepting()) { - saveFields(true); - if (!isNew()) - RedefinitionHelper.assignLazyLoadProxies(this); - } - } - - /** - * Whether or not data access in this instance is intercepted. This differs - * from {@link ClassMetaData#isIntercepting()} in that it checks for - * property access + subclassing in addition to the redefinition / - * enhancement checks. - * - * @since 1.0.0 - */ - public boolean isIntercepting() { - if (getMetaData().isIntercepting()) - return true; - if (getMetaData().getAccessType() != ClassMetaData.ACCESS_FIELD - && _pc instanceof DynamicPersistenceCapable) - return true; - - return false; - } - - /** - * Fire the given lifecycle event to all listeners. - */ - private boolean fireLifecycleEvent(int type) { - return _broker.fireLifecycleEvent(getManagedInstance(), null, - _meta, type); - } - - public void load(FetchConfiguration fetch) { - load(fetch, LOAD_FGS, null, null, false); - } - - /** - * Load the state of this instance based on the given fetch configuration - * and load mode. Return true if any data was loaded, false otherwise. - */ - protected boolean load(FetchConfiguration fetch, int loadMode, - BitSet exclude, Object sdata, boolean forWrite) { - if (!forWrite && (!isPersistent() || isNew() || isDeleted())) - return false; - - // if any fields being loaded, do state transitions for read - BitSet fields = getUnloadedInternal(fetch, loadMode, exclude); - boolean active = _broker.isActive(); - if (!forWrite && fields != null) - beforeRead(-1); - - // call load even if no fields are being loaded, because it takes - // care of checking if the DFG is loaded, making sure version info - // is loaded, etc - int lockLevel = calculateLockLevel(active, forWrite, fetch); - boolean ret = loadFields(fields, fetch, lockLevel, sdata); - obtainLocks(active, forWrite, lockLevel, fetch, sdata); - return ret; - } - - public Object getManagedInstance() { - if (_pc instanceof ManagedInstanceProvider) - return ((ManagedInstanceProvider) _pc).getManagedInstance(); - else - return _pc; - } - - public PersistenceCapable getPersistenceCapable() { - return _pc; - } - - public ClassMetaData getMetaData() { - return _meta; - } - - public OpenJPAStateManager getOwner() { - return _owner; - } - - public int getOwnerIndex() { - return _ownerIndex; - } - - public boolean isEmbedded() { - return _owner != null; - } - - public boolean isFlushed() { - return (_flags & FLAG_FLUSHED) > 0; - } - - public boolean isFlushedDirty() { - return (_flags & FLAG_FLUSHED_DIRTY) > 0; - } - - public BitSet getLoaded() { - return _loaded; - } - - public BitSet getFlushed() { - return _flush; - } - - public BitSet getDirty() { - return _dirty; - } - - public BitSet getUnloaded(FetchConfiguration fetch) { - // collect fields to load from data store based on fetch configuration - BitSet fields = getUnloadedInternal(fetch, LOAD_FGS, null); - return (fields == null) ? new BitSet(0) : fields; - } - - /** - * Internal version of {@link OpenJPAStateManager#getUnloaded} that avoids - * creating an empty bit set by returning null when there are no unloaded - * fields. - */ - private BitSet getUnloadedInternal(FetchConfiguration fetch, int mode, - BitSet exclude) { - if (exclude == StoreContext.EXCLUDE_ALL) - return null; - - BitSet fields = null; - FieldMetaData[] fmds = _meta.getFields(); - boolean load; - for (int i = 0; i < fmds.length; i++) { - if (_loaded.get(i) || (exclude != null && exclude.get(i))) - continue; - - switch (mode) { - case LOAD_SERIALIZE: - load = !fmds[i].isTransient(); - break; - case LOAD_FGS: - load = fetch == null || fetch.requiresFetch(fmds[i]) - != FetchConfiguration.FETCH_NONE; - break; - default: // LOAD_ALL - load = true; - } - - if (load) { - if (fields == null) - fields = new BitSet(fmds.length); - fields.set(i); - } - } - return fields; - } - - public StoreContext getContext() { - return _broker; - } - - /** - * Managing broker. - */ - BrokerImpl getBroker() { - return _broker; - } - - public Object getId() { - return _id; - } - - public Object getObjectId() { - StateManagerImpl sm = this; - while (sm.getOwner() != null) - sm = (StateManagerImpl) sm.getOwner(); - return sm._oid; - } - - public void setObjectId(Object oid) { - _oid = oid; - if (_pc != null && oid instanceof OpenJPAId) - ((OpenJPAId) oid).setManagedInstanceType(_meta.getDescribedType()); - } - - public boolean assignObjectId(boolean flush) { - lock(); - try { - return assignObjectId(flush, false); - } finally { - unlock(); - } - } - - /** - * Ask store manager to assign our oid, optionally flushing and - * optionally recaching on the new oid. - */ - boolean assignObjectId(boolean flush, boolean preFlushing) { - if (_oid != null || isEmbedded() || !isPersistent()) - return true; - - if (_broker.getStoreManager().assignObjectId(this, preFlushing)) { - if (!preFlushing) - assertObjectIdAssigned(true); - } else if (flush) - _broker.flush(); - else - return false; - return true; - } - - /** - * Make sure we were assigned an oid, and perform actions to make it - * permanent. - * - * @param recache whether to recache ourself on the new oid - */ - private void assertObjectIdAssigned(boolean recache) { - if (!isNew() || isDeleted() || isProvisional() - || (_flags & FLAG_OID_ASSIGNED) != 0) - return; - if (_oid == null) { - if (_meta.getIdentityType() == ClassMetaData.ID_DATASTORE) - throw new InternalException(Exceptions.toString - (getManagedInstance())); - _oid = ApplicationIds.create(_pc, _meta); - } - - Object orig = _id; - _id = _oid; - if (recache) { - try { - _broker.setStateManager(orig, this, - BrokerImpl.STATUS_OID_ASSIGN); - } catch (RuntimeException re) { - _id = orig; - _oid = null; - throw re; - } - } - _flags |= FLAG_OID_ASSIGNED; - } - - /** - * Assign the proper generated value to the given field based on its - * value-strategy. - */ - private boolean assignField(int field, boolean preFlushing) { - OpenJPAStateManager sm = this; - while (sm.isEmbedded()) - sm = sm.getOwner(); - if (!sm.isNew() || sm.isFlushed() || sm.isDeleted()) - return false; - - // special-case oid fields, which require us to look inside the oid - // object - FieldMetaData fmd = _meta.getField(field); - if (fmd.getDeclaredTypeCode() == JavaTypes.OID) { - // try to shortcut if possible - if (_oid != null || isEmbedded() || !isPersistent()) - return true; - - // check embedded fields of oid for value strategy + default value - FieldMetaData[] pks = fmd.getEmbeddedMetaData().getFields(); - OpenJPAStateManager oidsm = null; - boolean assign = false; - for (int i = 0; !assign && i < pks.length; i++) { - if (pks[i].getValueStrategy() == ValueStrategies.NONE) - continue; - if (oidsm == null) - oidsm = new ObjectIdStateManager(fetchObjectField(field), - this, fmd); - assign = oidsm.isDefaultValue(i); - } - return assign && assignObjectId(!preFlushing, preFlushing); - } - - // Just return if there's no value generation strategy - if (fmd.getValueStrategy() == ValueStrategies.NONE) - return false; - - // Throw exception if field already has a value assigned. - // @GeneratedValue overrides POJO initial values and setter methods - if (!fmd.isValueGenerated() && !isDefaultValue(field)) - throw new InvalidStateException(_loc.get( - "existing-value-override-excep", fmd.getFullName(false))); - - // for primary key fields, assign the object id and recache so that - // to the user, so it looks like the oid always matches the pk fields - if (fmd.isPrimaryKey() && !isEmbedded()) - return assignObjectId(!preFlushing, preFlushing); - - // for other fields just assign the field or flush if needed - if (_broker.getStoreManager().assignField(this, field, preFlushing)) { - fmd.setValueGenerated(true); - return true; - } - if (!preFlushing) - _broker.flush(); - return !preFlushing; - } - - public Object getLock() { - return _lock; - } - - public void setLock(Object lock) { - _lock = lock; - } - - public Object getVersion() { - return _version; - } - - public void setVersion(Object version) { - _loadVersion = version; - assignVersionField(version); - } - - Object getLoadVersion() { - return _loadVersion; - } - - public void setNextVersion(Object version) { - assignVersionField(version); - } - - private void assignVersionField(Object version) { - _version = version; - FieldMetaData vfield = _meta.getVersionField(); - if (vfield != null) - store(vfield.getIndex(), JavaTypes.convert(version, - vfield.getTypeCode())); - } - - public PCState getPCState() { - return _state; - } - - public synchronized Object getImplData() { - return _impl; - } - - public synchronized Object setImplData(Object data, boolean cacheable) { - Object old = _impl; - _impl = data; - if (cacheable && data != null) - _flags |= FLAG_IMPL_CACHE; - else - _flags &= ~FLAG_IMPL_CACHE; - return old; - } - - public boolean isImplDataCacheable() { - return (_flags & FLAG_IMPL_CACHE) != 0; - } - - public Object getImplData(int field) { - return getExtraFieldData(field, true); - } - - public Object setImplData(int field, Object data) { - return setExtraFieldData(field, data, true); - } - - public synchronized boolean isImplDataCacheable(int field) { - if (_fieldImpl == null || !_loaded.get(field)) - return false; - if (_meta.getField(field).usesImplData() != null) - return false; - int idx = _meta.getExtraFieldDataIndex(field); - return idx != -1 && _fieldImpl[idx] != null; - } - - public Object getIntermediate(int field) { - return getExtraFieldData(field, false); - } - - public void setIntermediate(int field, Object data) { - setExtraFieldData(field, data, false); - } - - /** - * Return the data from the proper index of the extra field data array. - */ - private synchronized Object getExtraFieldData(int field, boolean isLoaded) { - // only return the field data if the field is in the right loaded - // state; otherwise we might return intermediate for impl data or - // vice versa - if (_fieldImpl == null || _loaded.get(field) != isLoaded) - return null; - int idx = _meta.getExtraFieldDataIndex(field); - return (idx == -1) ? null : _fieldImpl[idx]; - } - - /** - * Set the data from to proper index of the extra field data array. - */ - private synchronized Object setExtraFieldData(int field, Object data, - boolean loaded) { - int idx = _meta.getExtraFieldDataIndex(field); - if (idx == -1) - throw new InternalException(String.valueOf(_meta.getField(field))); - - Object old = (_fieldImpl == null) ? null : _fieldImpl[idx]; - if (data != null) { - // cannot set if field in wrong loaded state - if (_loaded.get(field) != loaded) - throw new InternalException(String.valueOf(_meta.getField - (field))); - - // set data - if (_fieldImpl == null) - _fieldImpl = new Object[_meta.getExtraFieldDataLength()]; - _fieldImpl[idx] = data; - } else if (_fieldImpl != null && _loaded.get(field) == loaded) - _fieldImpl[idx] = null; - return old; - } - - public Object fetch(int field) { - Object val = fetchField(field, false); - return _meta.getField(field).getExternalValue(val, _broker); - } - - public Object fetchField(int field, boolean transitions) { - FieldMetaData fmd = _meta.getField(field); - if (fmd == null) - throw new UserException(_loc.get("no-field", - String.valueOf(field), getManagedInstance().getClass())). - setFailedObject(getManagedInstance()); - - // do normal state transitions - if (!fmd.isPrimaryKey() && transitions) - accessingField(field); - - switch (fmd.getDeclaredTypeCode()) { - case JavaTypes.STRING: - return fetchStringField(field); - case JavaTypes.OBJECT: - return fetchObjectField(field); - case JavaTypes.BOOLEAN: - return (fetchBooleanField(field)) ? Boolean.TRUE - : Boolean.FALSE; - case JavaTypes.BYTE: - return new Byte(fetchByteField(field)); - case JavaTypes.CHAR: - return new Character(fetchCharField(field)); - case JavaTypes.DOUBLE: - return new Double(fetchDoubleField(field)); - case JavaTypes.FLOAT: - return new Float(fetchFloatField(field)); - case JavaTypes.INT: - return Numbers.valueOf(fetchIntField(field)); - case JavaTypes.LONG: - return Numbers.valueOf(fetchLongField(field)); - case JavaTypes.SHORT: - return new Short(fetchShortField(field)); - default: - return fetchObjectField(field); - } - } - - public void store(int field, Object val) { - val = _meta.getField(field).getFieldValue(val, _broker); - storeField(field, val); - } - - public void storeField(int field, Object val) { - storeField(field, val, this); - } - - /** - * <p>Checks whether or not <code>_pc</code> is dirty. In the cases where - * field tracking is not happening (see below), this method will do a - * state comparison to find whether <code>_pc</code> is dirty, and will - * update this instance with this information. In the cases where field - * tracking is happening, this method is a no-op.</p> - * - * <p>Fields are tracked for all classes that are run through the OpenJPA - * enhancer prior to or during deployment, and all classes (enhanced or - * unenhanced) in a Java 6 environment or newer.</p> - * - * <p>In a Java 5 VM or older: - * <br>- instances of unenhanced classes that use - * property access and obey the property access limitations are tracked - * when the instances are loaded from the database by OpenJPA, and are - * not tracked when the instances are created by application code. - * <br>- instances of unenhanced classes that use field access are - * never tracked.</p> - * - * @since 1.0.0 - */ - public void dirtyCheck() { - if (!needsDirtyCheck()) - return; - - SaveFieldManager saved = getSaveFieldManager(); - if (saved == null) - throw new InternalException(_loc.get("no-saved-fields", - getMetaData().getDescribedType().getName())); - - FieldMetaData[] fmds = getMetaData().getFields(); - for (int i = 0; i < fmds.length; i++) { - // pk and version fields cannot be mutated; don't mark them - // as such. ##### validate? - if (!fmds[i].isPrimaryKey() && !fmds[i].isVersion() - && _loaded.get(i)) { - if (!saved.isFieldEqual(i, fetch(i))) { - dirty(i); - } - } - } - } - - private boolean needsDirtyCheck() { - if (isIntercepting()) - return false; - if (isDeleted()) - return false; - if (isNew() && !isFlushed()) - return false; - return true; - } - - public Object fetchInitialField(int field) { - FieldMetaData fmd = _meta.getField(field); - if (_broker.getRestoreState() == RestoreState.RESTORE_NONE - && ((_flags & FLAG_INVERSES) == 0 - || fmd.getInverseMetaDatas().length == 0)) - throw new InvalidStateException(_loc.get("restore-unset")); - - switch (fmd.getDeclaredTypeCode()) { - case JavaTypes.DATE: - case JavaTypes.CALENDAR: - case JavaTypes.ARRAY: - case JavaTypes.COLLECTION: - case JavaTypes.MAP: - case JavaTypes.OBJECT: - // if we're not saving mutable types, throw an exception - if (_broker.getRestoreState() != RestoreState.RESTORE_ALL - && ((_flags & FLAG_INVERSES) == 0 - || fmd.getInverseMetaDatas().length == 0)) - throw new InvalidStateException(_loc.get - ("mutable-restore-unset")); - } - - lock(); - try { - if (_saved == null || !_loaded.get(field) || !_dirty.get(field)) - return fetchField(field, false); - - // if the field is dirty but we never loaded it, we can't restore it - if (_saved.getUnloaded().get(field)) - throw new InvalidStateException(_loc.get("initial-unloaded", - fmd)); - - provideField(_saved.getState(), _single, field); - return fetchField(_single, fmd); - } finally { - unlock(); - } - } - - /** - * Fetch the specified field from the specified field manager, wrapping it - * in an object if it's a primitive. A field should be provided to the - * field manager before this call is made. - */ - private static Object fetchField(FieldManager fm, FieldMetaData fmd) { - int field = fmd.getIndex(); - switch (fmd.getDeclaredTypeCode()) { - case JavaTypes.BOOLEAN: - return (fm.fetchBooleanField(field)) ? Boolean.TRUE - : Boolean.FALSE; - case JavaTypes.BYTE: - return new Byte(fm.fetchByteField(field)); - case JavaTypes.CHAR: - return new Character(fm.fetchCharField(field)); - case JavaTypes.DOUBLE: - return new Double(fm.fetchDoubleField(field)); - case JavaTypes.FLOAT: - return new Float(fm.fetchFloatField(field)); - case JavaTypes.INT: - return Numbers.valueOf(fm.fetchIntField(field)); - case JavaTypes.LONG: - return Numbers.valueOf(fm.fetchLongField(field)); - case JavaTypes.SHORT: - return new Short(fm.fetchShortField(field)); - case JavaTypes.STRING: - return fm.fetchStringField(field); - default: - return fm.fetchObjectField(field); - } - } - - public void setRemote(int field, Object value) { - lock(); - try { - Boolean stat = dirty(field, Boolean.FALSE, false); - storeField(field, value, _single); - replaceField(_pc, _single, field); - postDirty(stat); - } finally { - unlock(); - } - } - - //////////////////////// - // Lifecycle operations - //////////////////////// - - /** - * Notification that the object is about to be accessed. - * - * @param field the field number being read, or -1 if not a single - * field read - */ - void beforeRead(int field) { - // allow unmediated reads of primary key fields - if (field != -1 && _meta.getField(field).isPrimaryKey()) - return; - - if (_broker.isActive() && !_broker.isTransactionEnding()) { - if (_broker.getOptimistic()) - setPCState(_state.beforeOptimisticRead(this, field)); - else - setPCState(_state.beforeRead(this, field)); - } else if (_broker.getNontransactionalRead()) - setPCState(_state.beforeNontransactionalRead(this, field)); - else - throw new InvalidStateException(_loc.get("non-trans-read")). - setFailedObject(getManagedInstance()); - } - - /** - * Delegates to the current state. - * - * @see PCState#beforeFlush - */ - void beforeFlush(int reason, OpCallbacks call) { - _state.beforeFlush(this, reason == BrokerImpl.FLUSH_LOGICAL, call); - } - - /** - * Delegates to the current state. - * - * @see PCState#flush - */ - void afterFlush(int reason) { - // nothing happens when we flush non-persistent states - if (!isPersistent()) - return; - - if (reason != BrokerImpl.FLUSH_ROLLBACK - && reason != BrokerImpl.FLUSH_LOGICAL) { - // analyze previous state for later - boolean wasNew = isNew(); - boolean wasFlushed = isFlushed(); - boolean wasDeleted = isDeleted(); - - // all dirty fields were flushed - _flush.or(_dirty); - - // important to set flushed bit after calling _state.flush so - // that the state can tell whether this is the first flush - setPCState(_state.flush(this)); - _flags |= FLAG_FLUSHED; - _flags &= ~FLAG_FLUSHED_DIRTY; - - _flags &= ~FLAG_VERSION_CHECK; - _flags &= ~FLAG_VERSION_UPDATE; - - // if this was an inc flush during which we had our identity - // assigned, tell the broker to cache us under our final oid - if (reason == BrokerImpl.FLUSH_INC) - assertObjectIdAssigned(true); - - // if this object was stored with preFlush, do post-store callback - if ((_flags & FLAG_PRE_FLUSHED) > 0) - fireLifecycleEvent(LifecycleEvent.AFTER_STORE); - - // do post-update as needed - if (wasNew && !wasFlushed) - fireLifecycleEvent(LifecycleEvent.AFTER_PERSIST_PERFORMED); - else if (wasDeleted) - fireLifecycleEvent(LifecycleEvent.AFTER_DELETE_PERFORMED); - else - // updates and new-flushed with changes - fireLifecycleEvent(LifecycleEvent.AFTER_UPDATE_PERFORMED); - } else if (reason == BrokerImpl.FLUSH_ROLLBACK) { - // revert to last loaded version and original oid - assignVersionField(_loadVersion); - if (isNew() && (_flags & FLAG_OID_ASSIGNED) == 0) - _oid = null; - } - _flags &= ~FLAG_PRE_FLUSHED; - } - - /** - * Delegates to the current state after checking the value - * of the RetainState flag. - * - * @see PCState#commit - * @see PCState#commitRetain - */ - void commit() { - // release locks before oid updated - releaseLocks(); - - // update version and oid information - setVersion(_version); - _flags &= ~FLAG_FLUSHED; - _flags &= ~FLAG_FLUSHED_DIRTY; - - Object orig = _id; - assertObjectIdAssigned(false); - - boolean wasNew = isNew() && !isDeleted() && !isProvisional(); - if (_broker.getRetainState()) - setPCState(_state.commitRetain(this)); - else - setPCState(_state.commit(this)); - - // ask the broker to re-cache us if we were new previously - if (wasNew) - _broker.setStateManager(orig, this, BrokerImpl.STATUS_COMMIT_NEW); - } - - /** - * Delegates to the current state after checking the value - * of the RetainState flag. - * - * @see PCState#rollback - * @see PCState#rollbackRestore - */ - void rollback() { - // release locks - releaseLocks(); - _flags &= ~FLAG_FLUSHED; - _flags &= ~FLAG_FLUSHED_DIRTY; - afterFlush(BrokerImpl.FLUSH_ROLLBACK); - - if (_broker.getRestoreState() != RestoreState.RESTORE_NONE) - setPCState(_state.rollbackRestore(this)); - else - setPCState(_state.rollback(this)); - } - - /** - * Rollback state of the managed instance to the given savepoint. - */ - void rollbackToSavepoint(SavepointFieldManager savepoint) { - _state = savepoint.getPCState(); - BitSet loaded = savepoint.getLoaded(); - for (int i = 0, len = loaded.length(); i < len; i++) { - if (loaded.get(i) && savepoint.restoreField(i)) { - provideField(savepoint.getCopy(), savepoint, i); - replaceField(_pc, savepoint, i); - } - } - _loaded = loaded; - _dirty = savepoint.getDirty(); - _flush = savepoint.getFlushed(); - _version = savepoint.getVersion(); - _loadVersion = savepoint.getLoadVersion(); - } - - /** - * Delegates to the current state. - * - * @see PCState#persist - * @see Broker#persist - */ - void persist() { - setPCState(_state.persist(this)); - } - - /** - * Delegates to the current state. - * - * @see PCState#delete - * @see Broker#delete - */ - void delete() { - setPCState(_state.delete(this)); - } - - /** - * Delegates to the current state. - * - * @see PCState#nontransactional - * @see Broker#nontransactional - */ - void nontransactional() { - setPCState(_state.nontransactional(this)); - } - - /** - * Delegates to the current state. - * - * @see PCState#transactional - * @see Broker#transactional - */ - void transactional() { - setPCState(_state.transactional(this)); - } - - /** - * Delegates to the current state. - * - * @see PCState#nonprovisional - */ - void nonprovisional(boolean logical, OpCallbacks call) { - setPCState(_state.nonprovisional(this, logical, call)); - } - - /** - * Delegates to the current state. - * - * @see PCState#release - * @see Broker#release - */ - void release(boolean unproxy) { - release(unproxy, false); - } - - void release(boolean unproxy, boolean force) { - // optimization for detach-in-place special case when fields are - // already (un)proxied correctly - if (!unproxy) - _flags |= FLAG_NO_UNPROXY; - try { - if (force) - setPCState(PCState.TRANSIENT); - else - setPCState(_state.release(this)); - } finally { - _flags &= ~FLAG_NO_UNPROXY; - } - } - - /** - * Delegates to the current state. - * - * @see PCState#evict - * @see Broker#evict - */ - void evict() { - setPCState(_state.evict(this)); - } - - /** - * Gather relations reachable from values using - * {@link ValueMetaData#CASCADE_IMMEDIATE}. - */ - void gatherCascadeRefresh(OpCallbacks call) { - FieldMetaData[] fmds = _meta.getFields(); - for (int i = 0; i < fmds.length; i++) { - if (!_loaded.get(i)) - continue; - - if (fmds[i].getCascadeRefresh() == ValueMetaData.CASCADE_IMMEDIATE - || fmds[i].getKey().getCascadeRefresh() - == ValueMetaData.CASCADE_IMMEDIATE - || fmds[i].getElement().getCascadeRefresh() - == ValueMetaData.CASCADE_IMMEDIATE) { - _single.storeObjectField(i, fetchField(i, false)); - _single.gatherCascadeRefresh(call); - _single.clear(); - } - } - } - - public boolean beforeRefresh(boolean refreshAll) { - // note: all logic placed here rather than in the states for - // optimization; this method public b/c used by remote package - - // nothing to do for non persistent or new unflushed instances - if (!isPersistent() || (isNew() && !isFlushed())) - return false; - - lock(); - try { - // if dirty need to clear fields - if (isDirty()) { - clearFields(); - return true; - } - - // if some fields have been loaded but the instance is out of - // date or this is part of a refreshAll() and we don't want to - // take the extra hit to see if the instance is out of date, clear - if (_loaded.length() > 0 && (refreshAll || isEmbedded() - || !syncVersion(null))) { - Object version = _version; - clearFields(); - - // if syncVersion just replaced the version, reset it - if (!refreshAll && !isEmbedded()) - setVersion(version); - return true; - } - return false; - } finally { - unlock(); - } - } - - /** - * Perform state transitions after refresh. This method is only - * called if {@link #beforeRefresh} returns true. - */ - void afterRefresh() { - lock(); - try { - // transition to clean or nontransactional depending on trans status - if (!_broker.isActive()) - setPCState(_state.afterNontransactionalRefresh()); - else if (_broker.getOptimistic()) - setPCState(_state.afterOptimisticRefresh()); - else - setPCState(_state.afterRefresh()); - } finally { - unlock(); - } - } - - /** - * Mark this object as a dereferenced dependent object. - */ - void setDereferencedDependent(boolean deref, boolean notify) { - if (!deref && (_flags & FLAG_DEREF) > 0) { - if (notify) - _broker.removeDereferencedDependent(this); - _flags &= ~FLAG_DEREF; - } else if (deref && (_flags & FLAG_DEREF) == 0) { - _flags |= FLAG_DEREF; - if (notify) - _broker.addDereferencedDependent(this); - } - } - - /////////// - // Locking - /////////// - - /** - * Notification that we've been read-locked. Pass in the level at which - * we were locked and the level at which we should write lock ourselves - * on dirty. - */ - void readLocked(int readLockLevel, int writeLockLevel) { - // make sure object is added to transaction so lock will get - // cleared on commit/rollback - if (readLockLevel != LockLevels.LOCK_NONE) - transactional(); - - _readLockLevel = readLockLevel; - _writeLockLevel = writeLockLevel; - _flags |= FLAG_READ_LOCKED; - _flags &= ~FLAG_WRITE_LOCKED; - } - - /** - * Return the lock level to use when loading state. - */ - private int calculateLockLevel(boolean active, boolean forWrite, - FetchConfiguration fetch) { - if (!active) - return LockLevels.LOCK_NONE; - if (fetch == null) - fetch = _broker.getFetchConfiguration(); - - if (_readLockLevel == -1) - _readLockLevel = fetch.getReadLockLevel(); - if (_writeLockLevel == -1) - _writeLockLevel = fetch.getWriteLockLevel(); - return (forWrite) ? _writeLockLevel : _readLockLevel; - } - - /** - * Make sure we're locked at the given level. - */ - private void obtainLocks(boolean active, boolean forWrite, int lockLevel, - FetchConfiguration fetch, Object sdata) { - if (!active) - return; - - // if we haven't been locked yet, lock now at the given level - int flag = (forWrite) ? FLAG_WRITE_LOCKED : FLAG_READ_LOCKED; - if ((_flags & flag) == 0) { - // make sure object is added to transaction so lock will get - // cleared on commit/rollback - if (lockLevel != LockLevels.LOCK_NONE) - transactional(); - - if (fetch == null) - fetch = _broker.getFetchConfiguration(); - _broker.getLockManager().lock(this, lockLevel, - fetch.getLockTimeout(), sdata); - _flags |= FLAG_READ_LOCKED; - _flags |= flag; - } - } - - /** - * Release locks. - */ - private void releaseLocks() { - if (_lock != null) - _broker.getLockManager().release(this); - _readLockLevel = -1; - _writeLockLevel = -1; - _flags &= ~FLAG_READ_LOCKED; - _flags &= ~FLAG_WRITE_LOCKED; - } - - //////////////////////////////////////////// - // Implementation of StateManager interface - //////////////////////////////////////////// - - /** - * @return whether or not unloaded fields should be closed. - */ - public boolean serializing() { - // if the broker is in the midst of a serialization, then no special - // handling should be performed on the instance, and no subsequent - // load should happen - if (_broker.isSerializing()) - return false; - - try { - if (_meta.isDetachable()) - return DetachManager.preSerialize(this); - - load(_broker.getFetchConfiguration(), LOAD_SERIALIZE, null, null, - false); - return false; - } catch (RuntimeException re) { - throw translate(re); - } - } - - public boolean writeDetached(ObjectOutput out) - throws IOException { - BitSet idxs = new BitSet(_meta.getFields().length); - lock(); - try { - boolean detsm = DetachManager.writeDetachedState(this, out, idxs); - if (detsm) - _flags |= FLAG_DETACHING; - - FieldMetaData[] fmds = _meta.getFields(); - for (int i = 0; i < fmds.length; i++) { - if (fmds[i].isTransient()) - continue; - provideField(_pc, _single, i); - _single.serialize(out, !idxs.get(i)); - _single.clear(); - } - return true; - } catch (RuntimeException re) { - throw translate(re); - } finally { - _flags &= ~FLAG_DETACHING; - unlock(); - } - } - - public void proxyDetachedDeserialized(int idx) { - // we don't serialize state manager impls - throw new InternalException(); - } - - public boolean isTransactional() { - // special case for TCLEAN, which we want to appear non-trans to - // internal code, but which publicly should be transactional - return _state == PCState.TCLEAN || _state.isTransactional(); - } - - public boolean isPendingTransactional() { - return _state.isPendingTransactional(); - } - - public boolean isProvisional() { - return _state.isProvisional(); - } - - public boolean isPersistent() { - return _state.isPersistent(); - } - - public boolean isNew() { - return _state.isNew(); - } - - public boolean isDeleted() { - return _state.isDeleted(); - } - - public boolean isDirty() { - return _state.isDirty(); - } - - public boolean isDetached() { - return (_flags & FLAG_DETACHING) != 0; - } - - public Object getGenericContext() { - return _broker; - } - - public Object fetchObjectId() { - try { - assignObjectId(true); - if (_oid == null || !_broker.getConfiguration(). - getCompatibilityInstance().getCopyObjectIds()) - return _oid; - - if (_meta.getIdentityType() == ClassMetaData.ID_DATASTORE) - return _broker.getStoreManager().copyDataStoreId(_oid, _meta); - return ApplicationIds.copy(_oid, _meta); - } catch (RuntimeException re) { - throw translate(re); - } - } - - public Object getPCPrimaryKey(Object oid, int field) { - FieldMetaData fmd = _meta.getField(field); - Object pk = ApplicationIds.get(oid, fmd); - if (pk == null) - return null; - - ClassMetaData relmeta = fmd.getDeclaredTypeMetaData(); - pk = ApplicationIds.wrap(relmeta, pk); - if (relmeta.getIdentityType() == ClassMetaData.ID_DATASTORE - && fmd.getObjectIdFieldTypeCode() == JavaTypes.LONG) - pk = _broker.getStoreManager().newDataStoreId(pk, relmeta); - else if (relmeta.getIdentityType() == ClassMetaData.ID_APPLICATION - && fmd.getObjectIdFieldType() != relmeta.getObjectIdType()) - pk = ApplicationIds.fromPKValues(new Object[] { pk }, relmeta); - return _broker.find(pk, false, null); - } - - public byte replaceFlags() { - // we always use load required so that we can detect when objects - // are touched for locking or making transactional - return PersistenceCapable.LOAD_REQUIRED; - } - - public StateManager replaceStateManager(StateManager sm) { - return sm; - } - - public void accessingField(int field) { - // possibly change state - try { - beforeRead(field); - beforeAccessField(field); - } catch (RuntimeException re) { - throw translate(re); - } - } - - /** - * Load the given field before access. - */ - protected void beforeAccessField(int field) { - lock(); - try { - boolean active = _broker.isActive(); - int lockLevel = calculateLockLevel(active, false, null); - if (!_loaded.get(field)) - loadField(field, lockLevel, false, true); - else - assignField(field, false); - obtainLocks(active, false, lockLevel, null, null); - } catch (RuntimeException re) { - throw translate(re); - } finally { - unlock(); - } - } - - public void dirty(String field) { - FieldMetaData fmd = _meta.getField(field); - if (fmd == null) - throw translate(new UserException(_loc.get("no-field", field, - ImplHelper.getManagedInstance(_pc).getClass())) - .setFailedObject(getManagedInstance())); - - dirty(fmd.getIndex(), null, true); - } - - public void dirty(int field) { - dirty(field, null, true); - } - - /** - * Make the given field dirty. - * - * @param mutate if null, may be an SCO mutation; if true, is certainly - * a mutation (or at least treat as one) - * @return {@link Boolean#FALSE} if this instance was already dirty, - * <code>null</code> if it was dirty but not since flush, and - * {@link Boolean#TRUE} if it was not dirty - */ - private Boolean dirty(int field, Boolean mutate, boolean loadFetchGroup) { - boolean locked = false; - boolean newFlush = false; - boolean clean = false; - try { - FieldMetaData fmd = _meta.getField(field); - if (!isNew() || isFlushed()) { - if (fmd.getUpdateStrategy() == UpdateStrategies.RESTRICT) - throw new InvalidStateException(_loc.get - ("update-restrict", fmd)); - if (fmd.getUpdateStrategy() == UpdateStrategies.IGNORE) - return Boolean.FALSE; - } - - if (isEmbedded()) { - // notify owner of change - _owner.dirty(_ownerIndex, Boolean.TRUE, loadFetchGroup); - } - - // is this a direct mutation of an sco field? - if (mutate == null) { - switch (fmd.getDeclaredTypeCode()) { - case JavaTypes.COLLECTION: - case JavaTypes.MAP: - case JavaTypes.ARRAY: - case JavaTypes.DATE: - case JavaTypes.CALENDAR: - case JavaTypes.OBJECT: - mutate = Boolean.TRUE; - break; - case JavaTypes.PC: - mutate = - (fmd.isEmbedded()) ? Boolean.TRUE : Boolean.FALSE; - break; - default: - mutate = Boolean.FALSE; // not sco - } - } - - // possibly change state - boolean active = _broker.isActive(); - clean = !_state.isDirty(); // intentional direct access - - // fire event fast before state change. - if (clean) - fireLifecycleEvent(LifecycleEvent.BEFORE_DIRTY); - if (active) { - if (_broker.getOptimistic()) - setPCState(_state.beforeOptimisticWrite(this, field, - mutate.booleanValue())); - else - setPCState(_state.beforeWrite(this, field, - mutate.booleanValue())); - } else if (fmd.getManagement() == FieldMetaData.MANAGE_PERSISTENT) { - if (isPersistent() && !_broker.getNontransactionalWrite()) - throw new InvalidStateException(_loc.get - ("non-trans-write")).setFailedObject - (getManagedInstance()); - - setPCState(_state.beforeNontransactionalWrite(this, field, - mutate.booleanValue())); - } - - if ((_flags & FLAG_FLUSHED) != 0) { - newFlush = (_flags & FLAG_FLUSHED_DIRTY) == 0; - _flags |= FLAG_FLUSHED_DIRTY; - } - - lock(); - locked = true; - - // note that the field is in need of flushing again, and tell the - // broker too - _flush.clear(field); - _broker.setDirty(this, newFlush && !clean); - - // save the field for rollback if needed - saveField(field); - - // dirty the field and mark loaded; load fetch group if needed - int lockLevel = calculateLockLevel(active, true, null); - if (!_dirty.get(field)) { - setLoaded(field, true); - _dirty.set(field); - - // make sure the field's fetch group is loaded - if (loadFetchGroup && isPersistent() - && fmd.getManagement() == fmd.MANAGE_PERSISTENT) - loadField(field, lockLevel, true, true); - } - obtainLocks(active, true, lockLevel, null, null); - } catch (RuntimeException re) { - throw translate(re); - } finally { - if (locked) - unlock(); - } - - if (clean) - return Boolean.TRUE; - if (newFlush) { - // this event can be fired later cause we're already dirty. - fireLifecycleEvent(LifecycleEvent.BEFORE_DIRTY_FLUSHED); - return null; - } - return Boolean.FALSE; - } - - /** - * Fire post-dirty events after field value changes. - * - * @param status return value from {@link #dirty(int, Boolean, boolean)} - */ - private void postDirty(Boolean status) { - if (Boolean.TRUE.equals(status)) - fireLifecycleEvent(LifecycleEvent.AFTER_DIRTY); - else if (status == null) - fireLifecycleEvent(LifecycleEvent.AFTER_DIRTY_FLUSHED); - } - - public void removed(int field, Object removed, boolean key) { - if (removed == null) - return; - - try { - // dereference dependent fields, delete embedded - FieldMetaData fmd = _meta.getField(field); - ValueMetaData vmd = (key) ? fmd.getKey() : fmd.getElement(); - if (vmd.isEmbeddedPC()) - _single.delete(vmd, removed, null); - else if (vmd.getCascadeDelete() == ValueMetaData.CASCADE_AUTO) - _single.dereferenceDependent(removed); - } catch (RuntimeException re) { - throw translate(re); - } - } - - public Object newProxy(int field) { - FieldMetaData fmd = _meta.getField(field); - if (!fmd.isExternalized()) - return newFieldProxy(field); - - switch (fmd.getTypeCode()) { - case JavaTypes.DATE: - if (fmd.getDeclaredType() == java.sql.Date.class) - return new java.sql.Date(System.currentTimeMillis()); - if (fmd.getDeclaredType() == java.sql.Timestamp.class) - return new java.sql.Timestamp(System.currentTimeMillis()); - if (fmd.getDeclaredType() == java.sql.Time.class) - return new java.sql.Time(System.currentTimeMillis()); - return new Date(); - case JavaTypes.CALENDAR: - return Calendar.getInstance(); - case JavaTypes.COLLECTION: - return new ArrayList(); - case JavaTypes.MAP: - return new HashMap(); - } - return null; - } - - public Object newFieldProxy(int field) { - FieldMetaData fmd = _meta.getField(field); - ProxyManager mgr = _broker.getConfiguration(). - getProxyManagerInstance(); - Object init = fmd.getInitializer(); - - switch (fmd.getDeclaredTypeCode()) { - case JavaTypes.DATE: - return mgr.newDateProxy(fmd.getDeclaredType()); - case JavaTypes.CALENDAR: - return mgr.newCalendarProxy(fmd.getDeclaredType(), - init instanceof TimeZone ? (TimeZone) init : null); - case JavaTypes.COLLECTION: - return mgr.newCollectionProxy(fmd.getProxyType(), - fmd.getElement().getDeclaredType(), - init instanceof Comparator ? (Comparator) init : null); - case JavaTypes.MAP: - return mgr.newMapProxy(fmd.getProxyType(), - fmd.getKey().getDeclaredType(), - fmd.getElement().getDeclaredType(), - init instanceof Comparator ? (Comparator) init : null); - } - return null; - } - - public boolean isDefaultValue(int field) { - lock(); - try { - _single.clear(); - provideField(_pc, _single, field); - boolean ret = _single.isDefaultValue(); - _single.clear(); - return ret; - } finally { - unlock(); - } - } - - ///////////////////////////////////////////////////////// - // Record that the field is dirty (which might load DFG) - ///////////////////////////////////////////////////////// - - public void settingBooleanField(PersistenceCapable pc, int field, - boolean curVal, boolean newVal, int set) { - if (set != SET_REMOTE) { - if (newVal == curVal && _loaded.get(field)) - return; - assertNoPrimaryKeyChange(field); - } - - lock(); - try { - Boolean stat = dirty(field, Boolean.FALSE, set == SET_USER); - _single.storeBooleanField(field, newVal); - replaceField(pc, _single, field); - postDirty(stat); - } finally { - unlock(); - } - } - - public void settingByteField(PersistenceCapable pc, int field, - byte curVal, byte newVal, int set) { - if (set != SET_REMOTE) { - if (newVal == curVal && _loaded.get(field)) - return; - assertNoPrimaryKeyChange(field); - } - - lock(); - try { - Boolean stat = dirty(field, Boolean.FALSE, set == SET_USER); - _single.storeByteField(field, newVal); - replaceField(pc, _single, field); - postDirty(stat); - } finally { - unlock(); - } - } - - public void settingCharField(PersistenceCapable pc, int field, - char curVal, char newVal, int set) { - if (set != SET_REMOTE) { - if (newVal == curVal && _loaded.get(field)) - return; - assertNoPrimaryKeyChange(field); - } - - lock(); - try { - Boolean stat = dirty(field, Boolean.FALSE, set == SET_USER); - _single.storeCharField(field, newVal); - replaceField(pc, _single, field); - postDirty(stat); - } finally { - unlock(); - } - } - - public void settingDoubleField(PersistenceCapable pc, int field, - double curVal, double newVal, int set) { - if (set != SET_REMOTE) { - if (newVal == curVal && _loaded.get(field)) - return; - assertNoPrimaryKeyChange(field); - } - - lock(); - try { - Boolean stat = dirty(field, Boolean.FALSE, set == SET_USER); - _single.storeDoubleField(field, newVal); - replaceField(pc, _single, field); - postDirty(stat); - } finally { - unlock(); - } - } - - public void settingFloatField(PersistenceCapable pc, int field, - float curVal, float newVal, int set) { - if (set != SET_REMOTE) { - if (newVal == curVal && _loaded.get(field)) - return; - assertNoPrimaryKeyChange(field); - } - - lock(); - try { - Boolean stat = dirty(field, Boolean.FALSE, set == SET_USER); - _single.storeFloatField(field, newVal); - replaceField(pc, _single, field); - postDirty(stat); - } finally { - unlock(); - } - } - - public void settingIntField(PersistenceCapable pc, int field, - int curVal, int newVal, int set) { - if (set != SET_REMOTE) { - if (newVal == curVal && _loaded.get(field)) - return; - assertNoPrimaryKeyChange(field); - } - - lock(); - try { - Boolean stat = dirty(field, Boolean.FALSE, set == SET_USER); - _single.storeIntField(field, newVal); - replaceField(pc, _single, field); - postDirty(stat); - } finally { - unlock(); - } - } - - public void settingLongField(PersistenceCapable pc, int field, - long curVal, long newVal, int set) { - if (set != SET_REMOTE) { - if (newVal == curVal && _loaded.get(field)) - return; - assertNoPrimaryKeyChange(field); - } - - lock(); - try { - Boolean stat = dirty(field, Boolean.FALSE, set == SET_USER); - _single.storeLongField(field, newVal); - replaceField(pc, _single, field); - postDirty(stat); - } finally { - unlock(); - } - } - - public void settingObjectField(PersistenceCapable pc, int field, - Object curVal, Object newVal, int set) { - if (set != SET_REMOTE) { - FieldMetaData fmd = _meta.getField(field); - if (_loaded.get(field)) { - if (newVal == curVal) - return; - - // only compare new to old values if the comparison is going to - // be cheap -- don't compare collections, maps, UDTs - switch (fmd.getDeclaredTypeCode()) { - case JavaTypes.ARRAY: - case JavaTypes.COLLECTION: - case JavaTypes.MAP: - case JavaTypes.PC: - case JavaTypes.PC_UNTYPED: - break; - default: - if (newVal != null && newVal.equals(curVal)) - return; - } - } else { - // if this is a dependent unloaded field, make sure to load - // it now - if (fmd.getCascadeDelete() == ValueMetaData.CASCADE_AUTO - || fmd.getKey().getCascadeDelete() - == ValueMetaData.CASCADE_AUTO - || fmd.getElement().getCascadeDelete() - == ValueMetaData.CASCADE_AUTO) - curVal = fetchObjectField(field); - } - - assertNoPrimaryKeyChange(field); - if (fmd.getDeclaredTypeCode() == JavaTypes.OID) - assertNotManagedObjectId(newVal); - } - - lock(); - try { - Boolean stat = dirty(field, Boolean.FALSE, set == SET_USER); - if (set != SET_REMOTE) { - _single.storeObjectField(field, curVal); - _single.unproxy(); - _single.dereferenceDependent(); - _single.clear(); - } - _single.storeObjectField(field, newVal); - replaceField(pc, _single, field); - postDirty(stat); - } finally { - unlock(); - } - } - - public void settingShortField(PersistenceCapable pc, int field, - short curVal, short newVal, int set) { - if (set != SET_REMOTE) { - if (newVal == curVal && _loaded.get(field)) - return; - assertNoPrimaryKeyChange(field); - } - - lock(); - try { - Boolean stat = dirty(field, Boolean.FALSE, set == SET_USER); - _single.storeShortField(field, newVal); - replaceField(pc, _single, field); - postDirty(stat); - } finally { - unlock(); - } - } - - public void settingStringField(PersistenceCapable pc, int field, - String curVal, String newVal, int set) { - if (set != SET_REMOTE) { - if (StringUtils.equals(newVal, curVal) && _loaded.get(field)) - return; - assertNoPrimaryKeyChange(field); - } - - lock(); - try { - Boolean stat = dirty(field, Boolean.FALSE, set == SET_USER); - _single.storeStringField(field, newVal); - replaceField(pc, _single, field); - postDirty(stat); - } finally { - unlock(); - } - } - - /** - * Disallows changing primary key fields for instances. - */ - private void assertNoPrimaryKeyChange(int field) { - if (_oid != null && _meta.getField(field).isPrimaryKey()) - throw translate(new InvalidStateException(_loc.get - ("change-identity")).setFailedObject(getManagedInstance())); - } - - /** - * Disallows setting an object id field to a managed instance. - */ - void assertNotManagedObjectId(Object val) { - if (val != null - && (ImplHelper.toPersistenceCapable(val, - getContext().getConfiguration())).pcGetGenericContext()!= null) - throw translate(new InvalidStateException(_loc.get - ("managed-oid", Exceptions.toString(val), - Exceptions.toString(getManagedInstance()))). - setFailedObject(getManagedInstance())); - } - - //////////////////////////// - // Delegate to FieldManager - //////////////////////////// - - public void providedBooleanField(PersistenceCapable pc, int field, - boolean curVal) { - _fm.storeBooleanField(field, curVal); - } - - public void providedByteField(PersistenceCapable pc, int field, - byte curVal) { - _fm.storeByteField(field, curVal); - } - - public void providedCharField(PersistenceCapable pc, int field, - char curVal) { - _fm.storeCharField(field, curVal); - } - - public void providedDoubleField(PersistenceCapable pc, int field, - double curVal) { - _fm.storeDoubleField(field, curVal); - } - - public void providedFloatField(PersistenceCapable pc, int field, - float curVal) { - _fm.storeFloatField(field, curVal); - } - - public void providedIntField(PersistenceCapable pc, int field, - int curVal) { - _fm.storeIntField(field, curVal); - } - - public void providedLongField(PersistenceCapable pc, int field, - long curVal) { - _fm.storeLongField(field, curVal); - } - - public void providedObjectField(PersistenceCapable pc, int field, - Object curVal) { - _fm.storeObjectField(field, curVal); - } - - public void providedShortField(PersistenceCapable pc, int field, - short curVal) { - _fm.storeShortField(field, curVal); - } - - public void providedStringField(PersistenceCapable pc, int field, - String curVal) { - _fm.storeStringField(field, curVal); - } - - public boolean replaceBooleanField(PersistenceCapable pc, int field) { - return _fm.fetchBooleanField(field); - } - - public byte replaceByteField(PersistenceCapable pc, int field) { - return _fm.fetchByteField(field); - } - - public char replaceCharField(PersistenceCapable pc, int field) { - return _fm.fetchCharField(field); - } - - public double replaceDoubleField(PersistenceCapable pc, int field) { - return _fm.fetchDoubleField(field); - } - - public float replaceFloatField(PersistenceCapable pc, int field) { - return _fm.fetchFloatField(field); - } - - public int replaceIntField(PersistenceCapable pc, int field) { - return _fm.fetchIntField(field); - } - - public long replaceLongField(PersistenceCapable pc, int field) { - return _fm.fetchLongField(field); - } - - public Object replaceObjectField(PersistenceCapable pc, int field) { - return _fm.fetchObjectField(field); - } - - public short replaceShortField(PersistenceCapable pc, int field) { - return _fm.fetchShortField(field); - } - - public String replaceStringField(PersistenceCapable pc, int field) { - return _fm.fetchStringField(field); - } - - ////////////////////////////////// - // Implementation of FieldManager - ////////////////////////////////// - - public boolean fetchBoolean(int field) { - FieldMetaData fmd = _meta.getField(field); - if (!fmd.isExternalized()) - return fetchBooleanField(field); - - Object val = fetchField(field, false); - return ((Boolean) fmd.getExternalValue(val, _broker)).booleanValue(); - } - - public boolean fetchBooleanField(int field) { - lock(); - try { - if (!_loaded.get(field)) - loadField(field, LockLevels.LOCK_NONE, false, false); - - provideField(_pc, _single, field); - return _single.fetchBooleanField(field); - } finally { - unlock(); - } - } - - public byte fetchByte(int field) { - FieldMetaData fmd = _meta.getField(field); - if (!fmd.isExternalized()) - return fetchByteField(field); - - Object val = fetchField(field, false); - return ((Number) fmd.getExternalValue(val, _broker)).byteValue(); - } - - public byte fetchByteField(int field) { - lock(); - try { - if (!_loaded.get(field)) - loadField(field, LockLevels.LOCK_NONE, false, false); - - provideField(_pc, _single, field); - return _single.fetchByteField(field); - } finally { - unlock(); - } - } - - public char fetchChar(int field) { - FieldMetaData fmd = _meta.getField(field); - if (!fmd.isExternalized()) - return fetchCharField(field); - - Object val = fetchField(field, false); - return ((Character) fmd.getExternalValue(val, _broker)).charValue(); - } - - public char fetchCharField(int field) { - lock(); - try { - if (!_loaded.get(field)) - loadField(field, LockLevels.LOCK_NONE, false, false); - - provideField(_pc, _single, field); - return _single.fetchCharField(field); - } finally { - unlock(); - } - } - - public double fetchDouble(int field) { - FieldMetaData fmd = _meta.getField(field); - if (!fmd.isExternalized()) - return fetchDoubleField(field); - - Object val = fetchField(field, false); - return ((Number) fmd.getExternalValue(val, _broker)).doubleValue(); - } - - public double fetchDoubleField(int field) { - lock(); - try { - if (!_loaded.get(field)) - loadField(field, LockLevels.LOCK_NONE, false, false); - - provideField(_pc, _single, field); - return _single.fetchDoubleField(field); - } finally { - unlock(); - } - } - - public float fetchFloat(int field) { - FieldMetaData fmd = _meta.getField(field); - if (!fmd.isExternalized()) - return fetchFloatField(field); - - Object val = fetchField(field, false); - return ((Number) fmd.getExternalValue(val, _broker)).floatValue(); - } - - public float fetchFloatField(int field) { - lock(); - try { - if (!_loaded.get(field)) - loadField(field, LockLevels.LOCK_NONE, false, false); - - provideField(_pc, _single, field); - return _single.fetchFloatField(field); - } finally { - unlock(); - } - } - - public int fetchInt(int field) { - FieldMetaData fmd = _meta.getField(field); - if (!fmd.isExternalized()) - return fetchIntField(field); - - Object val = fetchField(field, false); - return ((Number) fmd.getExternalValue(val, _broker)).intValue(); - } - - public int fetchIntField(int field) { - lock(); - try { - if (!_loaded.get(field)) - loadField(field, LockLevels.LOCK_NONE, false, false); - - provideField(_pc, _single, field); - return _single.fetchIntField(field); - } finally { - unlock(); - } - } - - public long fetchLong(int field) { - FieldMetaData fmd = _meta.getField(field); - if (!fmd.isExternalized()) - return fetchLongField(field); - - Object val = fetchField(field, false); - return ((Number) fmd.getExternalValue(val, _broker)).longValue(); - } - - public long fetchLongField(int field) { - lock(); - try { - if (!_loaded.get(field)) - loadField(field, LockLevels.LOCK_NONE, false, false); - - provideField(_pc, _single, field); - return _single.fetchLongField(field); - } finally { - unlock(); - } - } - - public Object fetchObject(int field) { - FieldMetaData fmd = _meta.getField(field); - if (!fmd.isExternalized()) - return fetchObjectField(field); - - Object val = fetchField(field, false); - return fmd.getExternalValue(val, _broker); - } - - public Object fetchObjectField(int field) { - lock(); - try { - if (!_loaded.get(field)) - loadField(field, LockLevels.LOCK_NONE, false, false); - - provideField(_pc, _single, field); - return _single.fetchObjectField(field); - } finally { - unlock(); - } - } - - public short fetchShort(int field) { - FieldMetaData fmd = _meta.getField(field); - if (!fmd.isExternalized()) - return fetchShortField(field); - - Object val = fetchField(field, false); - return ((Number) fmd.getExternalValue(val, _broker)).shortValue(); - } - - public short fetchShortField(int field) { - lock(); - try { - if (!_loaded.get(field)) - loadField(field, LockLevels.LOCK_NONE, false, false); - - provideField(_pc, _single, field); - return _single.fetchShortField(field); - } finally { - unlock(); - } - } - - public String fetchString(int field) { - FieldMetaData fmd = _meta.getField(field); - if (!fmd.isExternalized()) - return fetchStringField(field); - - Object val = fetchField(field, false); - return (String) fmd.getExternalValue(val, _broker); - } - - public String fetchStringField(int field) { - lock(); - try { - if (!_loaded.get(field)) - loadField(field, LockLevels.LOCK_NONE, false, false); - - provideField(_pc, _single, field); - return _single.fetchStringField(field); - } finally { - unlock(); - } - } - - public void storeBoolean(int field, boolean externalVal) { - FieldMetaData fmd = _meta.getField(field); - if (!fmd.isExternalized()) - storeBooleanField(field, externalVal); - else { - Object val = (externalVal) ? Boolean.TRUE : Boolean.FALSE; - storeField(field, fmd.getFieldValue(val, _broker)); - } - } - - public void storeBooleanField(int field, boolean curVal) { - lock(); - try { - _single.storeBooleanField(field, curVal); - replaceField(_pc, _single, field); - setLoaded(field, true); - postLoad(field, null); - } finally { - unlock(); - } - } - - public void storeByte(int field, byte externalVal) { - FieldMetaData fmd = _meta.getField(field); - if (!fmd.isExternalized()) - storeByteField(field, externalVal); - else - storeField(field, fmd.getFieldValue(new Byte(externalVal), - _broker)); - } - - public void storeByteField(int field, byte curVal) { - lock(); - try { - _single.storeByteField(field, curVal); - replaceField(_pc, _single, field); - setLoaded(field, true); - postLoad(field, null); - } finally { - unlock(); - } - } - - public void storeChar(int field, char externalVal) { - FieldMetaData fmd = _meta.getField(field); - if (!fmd.isExternalized()) - storeCharField(field, externalVal); - else - storeField(field, fmd.getFieldValue(new Character(externalVal), - _broker)); - } - - public void storeCharField(int field, char curVal) { - lock(); - try { - _single.storeCharField(field, curVal); - replaceField(_pc, _single, field); - setLoaded(field, true); - postLoad(field, null); - } finally { - unlock(); - } - } - - public void storeDouble(int field, double externalVal) { - FieldMetaData fmd = _meta.getField(field); - if (!fmd.isExternalized()) - storeDoubleField(field, externalVal); - else - storeField(field, fmd.getFieldValue(new Double(externalVal), - _broker)); - } - - public void storeDoubleField(int field, double curVal) { - lock(); - try { - _single.storeDoubleField(field, curVal); - replaceField(_pc, _single, field); - setLoaded(field, true); - postLoad(field, null); - } finally { - unlock(); - } - } - - public void storeFloat(int field, float externalVal) { - FieldMetaData fmd = _meta.getField(field); - if (!fmd.isExternalized()) - storeFloatField(field, externalVal); - else - storeField(field, fmd.getFieldValue(new Float(externalVal), - _broker)); - } - - public void storeFloatField(int field, float curVal) { - lock(); - try { - _single.storeFloatField(field, curVal); - replaceField(_pc, _single, field); - setLoaded(field, true); - postLoad(field, null); - } finally { - unlock(); - } - } - - public void storeInt(int field, int externalVal) { - FieldMetaData fmd = _meta.getField(field); - if (!fmd.isExternalized()) - storeIntField(field, externalVal); - else - storeField(field, fmd.getFieldValue(Numbers.valueOf(externalVal), - _broker)); - } - - public void storeIntField(int field, int curVal) { - lock(); - try { - _single.storeIntField(field, curVal); - replaceField(_pc, _single, field); - setLoaded(field, true); - postLoad(field, null); - } finally { - unlock(); - } - } - - public void storeLong(int field, long externalVal) { - FieldMetaData fmd = _meta.getField(field); - if (!fmd.isExternalized()) - storeLongField(field, externalVal); - else - storeField(field, fmd.getFieldValue(Numbers.valueOf(externalVal), - _broker)); - } - - public void storeLongField(int field, long curVal) { - lock(); - try { - _single.storeLongField(field, curVal); - replaceField(_pc, _single, field); - setLoaded(field, true); - postLoad(field, null); - } finally { - unlock(); - } - } - - public void storeObject(int field, Object externalVal) { - FieldMetaData fmd = _meta.getField(field); - externalVal = fmd.order(externalVal); - if (!fmd.isExternalized()) - storeObjectField(field, externalVal); - else - storeField(field, fmd.getFieldValue(externalVal, _broker)); - } - - public void storeObjectField(int field, Object curVal) { - lock(); - try { - _single.storeObjectField(field, curVal); - _single.proxy(true, false); - replaceField(_pc, _single, field); - setLoaded(field, true); - postLoad(field, null); - } finally { - unlock(); - } - } - - public void storeShort(int field, short externalVal) { - FieldMetaData fmd = _meta.getField(field); - if (!fmd.isExternalized()) - storeShortField(field, externalVal); - else - storeField(field, fmd.getFieldValue(new Short(externalVal), - _broker)); - } - - public void storeShortField(int field, short curVal) { - lock(); - try { - _single.storeShortField(field, curVal); - replaceField(_pc, _single, field); - setLoaded(field, true); - postLoad(field, null); - } finally { - unlock(); - } - } - - public void storeString(int field, String externalVal) { - FieldMetaData fmd = _meta.getField(field); - if (!fmd.isExternalized()) - storeStringField(field, externalVal); - else - storeField(field, fmd.getFieldValue(externalVal, _broker)); - } - - public void storeStringField(int field, String curVal) { - lock(); - try { - _single.storeStringField(field, curVal); - replaceField(_pc, _single, field); - setLoaded(field, true); - postLoad(field, null); - } finally { - unlock(); - } - } - - /** - * Store the given field value into the given field manager. - */ - private void storeField(int field, Object val, FieldManager fm) { - FieldMetaData fmd = _meta.getField(field); - if (fmd == null) - throw new UserException(_loc.get("no-field-index", - String.valueOf(field), _meta.getDescribedType())). - setFailedObject(getManagedInstance()); - - switch (fmd.getDeclaredTypeCode()) { - case JavaTypes.BOOLEAN: - boolean bool = val != null && ((Boolean) val).booleanValue(); - fm.storeBooleanField(field, bool); - break; - case JavaTypes.BYTE: - byte b = (val == null) ? 0 : ((Number) val).byteValue(); - fm.storeByteField(field, b); - break; - case JavaTypes.CHAR: - char c = (val == null) ? 0 : ((Character) val).charValue(); - fm.storeCharField(field, c); - break; - case JavaTypes.DOUBLE: - double d = (val == null) ? 0 : ((Number) val).doubleValue(); - fm.storeDoubleField(field, d); - break; - case JavaTypes.FLOAT: - float f = (val == null) ? 0 : ((Number) val).floatValue(); - fm.storeFloatField(field, f); - break; - case JavaTypes.INT: - int i = (val == null) ? 0 : ((Number) val).intValue(); - fm.storeIntField(field, i); - break; - case JavaTypes.LONG: - long l = (val == null) ? 0 : ((Number) val).longValue(); - fm.storeLongField(field, l); - break; - case JavaTypes.SHORT: - short s = (val == null) ? 0 : ((Number) val).shortValue(); - fm.storeShortField(field, s); - break; - case JavaTypes.STRING: - fm.storeStringField(field, (String) val); - break; - default: - fm.storeObjectField(field, val); - } - } - - ///////////// - // Utilities - ///////////// - - /** - * Erase the fact that this instance has been flushed. - */ - void eraseFlush() { - _flags &= ~FLAG_FLUSHED; - _flags &= ~FLAG_FLUSHED_DIRTY; - - int fmds = _meta.getFields().length; - for (int i = 0; i < fmds; i++) - _flush.clear(i); - } - - /** - * Records that all instance fields are/are not loaded. - * Primary key and non-persistent fields are not affected. - */ - void setLoaded(boolean val) { - FieldMetaData[] fmds = _meta.getFields(); - for (int i = 0; i < fmds.length; i++) { - if (!fmds[i].isPrimaryKey() - && fmds[i].getManagement() == fmds[i].MANAGE_PERSISTENT) - setLoaded(i, val); - } - if (!val) { - _flags &= ~FLAG_LOADED; - setDirty(false); - } else - _flags |= FLAG_LOADED; - } - - /** - * Records that all instance fields are/are not dirty, - * and changes the flags of the instance accordingly. - */ [... 3925 lines stripped ...] From commits-return-3413-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Tue Sep 30 19:43:03 2008 Return-Path: <commits-return-3413-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 94285 invoked from network); 30 Sep 2008 19:43:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Sep 2008 19:43:03 -0000 Received: (qmail 5762 invoked by uid 500); 30 Sep 2008 19:43:01 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 5731 invoked by uid 500); 30 Sep 2008 19:43:01 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 5707 invoked by uid 99); 30 Sep 2008 19:43:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Sep 2008 12:43:01 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Sep 2008 19:42:07 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 1BC9C2388A10; Tue, 30 Sep 2008 12:42:12 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r700563 [3/3] - in /openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/TestEmbedded.java Date: Tue, 30 Sep 2008 19:42:11 -0000 To: commits@openjpa.apache.org From: jrbauer@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080930194212.1BC9C2388A10@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Modified: openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/TestEmbedded.java URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/TestEmbedded.java?rev=700563&r1=700562&r2=700563&view=diff ============================================================================== --- openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/TestEmbedded.java (original) +++ openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/TestEmbedded.java Tue Sep 30 12:42:11 2008 @@ -18,7 +18,11 @@ */ package org.apache.openjpa.persistence.embed; +import java.util.List; + import javax.persistence.EntityManager; +import javax.persistence.EntityTransaction; + import org.apache.openjpa.persistence.test.SingleEMFTestCase; public class TestEmbedded extends SingleEMFTestCase { @@ -42,5 +46,71 @@ em.persist(a); em.getTransaction().commit(); } + + /* + * This variation verifies that an embedded entity can be accessed after + * being detached. An entity /w embedded is persisted and then queried. + * The em is closed, detaching the entities, and then a getter is called + * on the embeddeded. If the embedded is still attached (it should not be) + * an IllegalStateException will be thrown. + * + * JIRA Ref: OPENJPA-733 + * Authors: Chris Tillman, Jeremy Bauer + */ + public void testDetachedQueryEmbedded() { + Address a = new Address(); + a.setStreetAddress("456 Main St"); + a.setCity("New York"); + a.setState("NY"); + a.setZip(12955); + Geocode g = new Geocode(); + g.setLatitude(1.0f); + g.setLongtitude(2.0f); + a.setGeocode(g); + + persistAddress(a); + + Address a2 = queryAddresses( + "select address from Address address" + + " where address.streetAddress = '456 Main St'").get(0); + + assertEquals(a2.getGeocode().getLatitude(),1.0f); + } -} \ No newline at end of file + private void persistAddress(Address address) { + final EntityManager em = emf.createEntityManager(); + final EntityTransaction tx = em.getTransaction(); + + tx.begin(); + + try { + em.persist(address); + tx.commit(); + } finally { + if (tx.isActive()) { + tx.rollback(); + } + em.close(); + } + assertEquals(address.getGeocode().getLatitude(),1.0f); + } + + private List<Address> queryAddresses(String query) { + final EntityManager em = emf.createEntityManager(); + final EntityTransaction tx = em.getTransaction(); + + tx.begin(); + + try { + final List<Address> list = (List<Address>) em.createQuery(query) + .getResultList(); + tx.commit(); + return list; + } finally { + if (tx.isActive()) { + tx.rollback(); + } + em.close(); + } + } +} From commits-return-3412-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Tue Sep 30 19:43:03 2008 Return-Path: <commits-return-3412-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 94284 invoked from network); 30 Sep 2008 19:43:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Sep 2008 19:43:03 -0000 Received: (qmail 5739 invoked by uid 500); 30 Sep 2008 19:43:01 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 5720 invoked by uid 500); 30 Sep 2008 19:43:01 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 5706 invoked by uid 99); 30 Sep 2008 19:43:01 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Sep 2008 12:43:01 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Sep 2008 19:42:07 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 0A65B238885D; Tue, 30 Sep 2008 12:42:12 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r700563 [1/3] - in /openjpa/trunk: openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/TestEmbedded.java Date: Tue, 30 Sep 2008 19:42:11 -0000 To: commits@openjpa.apache.org From: jrbauer@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080930194212.0A65B238885D@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: jrbauer Date: Tue Sep 30 12:42:11 2008 New Revision: 700563 URL: http://svn.apache.org/viewvc?rev=700563&view=rev Log: OPENJPA-733: Updated state manager to use actual oid instead of owner oid. Modified: openjpa/trunk/openjpa-kernel/src/main/java/org/apache/openjpa/kernel/StateManagerImpl.java openjpa/trunk/openjpa-persistence-jdbc/src/test/java/org/apache/openjpa/persistence/embed/TestEmbedded.java From commits-return-3414-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org Tue Sep 30 22:17:43 2008 Return-Path: <commits-return-3414-apmail-openjpa-commits-archive=openjpa.apache.org@openjpa.apache.org> Delivered-To: apmail-openjpa-commits-archive@www.apache.org Received: (qmail 88246 invoked from network); 30 Sep 2008 22:17:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Sep 2008 22:17:42 -0000 Received: (qmail 13624 invoked by uid 500); 30 Sep 2008 22:17:41 -0000 Delivered-To: apmail-openjpa-commits-archive@openjpa.apache.org Received: (qmail 13610 invoked by uid 500); 30 Sep 2008 22:17:41 -0000 Mailing-List: contact commits-help@openjpa.apache.org; run by ezmlm Precedence: bulk List-Help: <mailto:commits-help@openjpa.apache.org> List-Unsubscribe: <mailto:commits-unsubscribe@openjpa.apache.org> List-Post: <mailto:commits@openjpa.apache.org> List-Id: <commits.openjpa.apache.org> Reply-To: dev@openjpa.apache.org Delivered-To: mailing list commits@openjpa.apache.org Received: (qmail 13601 invoked by uid 99); 30 Sep 2008 22:17:41 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Sep 2008 15:17:41 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 30 Sep 2008 22:16:46 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 3109623889A0; Tue, 30 Sep 2008 15:16:49 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r700603 - /openjpa/trunk/openjpa-persistence-jdbc/pom.xml Date: Tue, 30 Sep 2008 22:16:49 -0000 To: commits@openjpa.apache.org From: mikedd@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080930221650.3109623889A0@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mikedd Date: Tue Sep 30 15:16:48 2008 New Revision: 700603 URL: http://svn.apache.org/viewvc?rev=700603&view=rev Log: OPENJPA-734 added dbcp.args property in openjpa-persistence-jdbc/pom.xml Modified: openjpa/trunk/openjpa-persistence-jdbc/pom.xml Modified: openjpa/trunk/openjpa-persistence-jdbc/pom.xml URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-persistence-jdbc/pom.xml?rev=700603&r1=700602&r2=700603&view=diff ============================================================================== --- openjpa/trunk/openjpa-persistence-jdbc/pom.xml (original) +++ openjpa/trunk/openjpa-persistence-jdbc/pom.xml Tue Sep 30 15:16:48 2008 @@ -39,6 +39,7 @@ -Dtest.jvm.arguments="-Xmx500m -agentlib:jdwp=transport=dt_socket,server=y,address=8000" --> <test.jvm.arguments>-Xmx500m</test.jvm.arguments> + <dbcp.args>MaxActive=100,MaxIdle=0,MaxWait=10000</dbcp.args> </properties> <profiles> @@ -486,7 +487,7 @@ </property> <property> <name>openjpa.ConnectionProperties</name> - <value>DriverClassName=${connection.driver.name},Url=${connection.url},MaxActive=100,MaxIdle=0,MaxWait=10000,TestOnBorrow=true,Username=${connection.username},Password=${connection.password}</value> + <value>DriverClassName=${connection.driver.name},Url=${connection.url},Username=${connection.username},Password=${connection.password},${dbcp.args}</value> </property> </systemProperties> </configuration>