portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r748699 - in /portals/jetspeed-2/portal/branches/JPA_BRANCH: components/jetspeed-capability/src/test/resources/ components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/ components/jetspeed-page-manager/src/test/java/org/...
Date Fri, 27 Feb 2009 21:09:33 GMT
Author: rwatler
Date: Fri Feb 27 21:09:32 2009
New Revision: 748699

URL: http://svn.apache.org/viewvc?rev=748699&view=rev
Log:
PostgreSQL support for J2/OpenJPA
---------------------------------------
- add custom DBDictionary for postgres to map boolean to smallint fields as per J2 conventions
- add database configuration detection logic to OpenJPA configuration properties


Added:
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/jpa/database/
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/jpa/database/OpenJPAPostgresDBDictionary.java
Modified:
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-capability/src/test/resources/openjpa-capabilities.xml
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/OpenJPADatabasePageManagerProperties.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/cache/TestOpenJPADatabasePageManagerCache.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/resources/openjpa-database-page-manager-base.xml
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/resources/openjpa-registry.xml
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/jpa/MergingPersistenceUnitManager.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/jpa/OpenJPAConfigurationProperties.java
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/openjpa-registry-base.xml
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/resources/openjpa-security.xml
    portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/resources/openjpa-sso.xml
    portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/capabilities.xml
    portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/page-manager.xml
    portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/profiler.xml
    portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/registry.xml
    portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/security-spi.xml

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-capability/src/test/resources/openjpa-capabilities.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-capability/src/test/resources/openjpa-capabilities.xml?rev=748699&r1=748698&r2=748699&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-capability/src/test/resources/openjpa-capabilities.xml
(original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-capability/src/test/resources/openjpa-capabilities.xml
Fri Feb 27 21:09:32 2009
@@ -34,6 +34,8 @@
 		        <prop key="openjpa.ManagedRuntime">invocation(TransactionManagerMethod=com.atomikos.icatch.jta.TransactionManagerImp.getTransactionManager)</prop>
             </props>
         </property>
+        <property name="persistenceUnitName" value="jetspeed-capabilities"/>
+        <property name="persistenceUnitManager" ref="persistenceUnitManager"/>
     </bean>
     <bean id="capabilitiesEntityManagerFactory" parent="abstractEntityManagerFactory">
         <property name="persistenceUnitName" value="jetspeed-capabilities"/>

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/OpenJPADatabasePageManagerProperties.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/OpenJPADatabasePageManagerProperties.java?rev=748699&r1=748698&r2=748699&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/OpenJPADatabasePageManagerProperties.java
(original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/page/jpa/OpenJPADatabasePageManagerProperties.java
Fri Feb 27 21:09:32 2009
@@ -16,6 +16,8 @@
  */
 package org.apache.jetspeed.page.jpa;
 
+import javax.sql.DataSource;
+
 import org.apache.jetspeed.components.rdbms.jpa.OpenJPAConfigurationProperties;
 
 /**
@@ -37,7 +39,15 @@
     
     private static OpenJPADatabasePageManagerProperties instance;
     
-    public static OpenJPADatabasePageManagerProperties getInstance(final String cachePort,
final String cacheAddresses)
+    /**
+     * Setup configuration properties singleton.
+     * 
+     * @param cachePort distributed cache port.
+     * @param cacheAddresses distributed cache addresses list.
+     * @param dataSource OpenJPA data source or null.
+     * @return configuration properties instance
+     */
+    public static OpenJPADatabasePageManagerProperties getInstance(final String cachePort,
final String cacheAddresses, final DataSource dataSource)
     {
         // construct and return a default instance
         if (instance == null)
@@ -45,6 +55,7 @@
             instance = new OpenJPADatabasePageManagerProperties();
             instance.setCachePort(cachePort);
             instance.setCacheAddresses(cacheAddresses);
+            instance.setDataSource(dataSource);
             instance.afterPropertiesSet();
         }
         return instance;

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/cache/TestOpenJPADatabasePageManagerCache.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/cache/TestOpenJPADatabasePageManagerCache.java?rev=748699&r1=748698&r2=748699&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/cache/TestOpenJPADatabasePageManagerCache.java
(original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/java/org/apache/jetspeed/page/cache/TestOpenJPADatabasePageManagerCache.java
Fri Feb 27 21:09:32 2009
@@ -41,7 +41,7 @@
      */
     protected void setCacheSystemProperties()
     {
-        OpenJPADatabasePageManagerProperties.getInstance("5636", "localhost:5636;localhost:5637");
+        OpenJPADatabasePageManagerProperties.getInstance("5636", "localhost:5636;localhost:5637",
null);
     }
 
     /* (non-Javadoc)

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/resources/openjpa-database-page-manager-base.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/resources/openjpa-database-page-manager-base.xml?rev=748699&r1=748698&r2=748699&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/resources/openjpa-database-page-manager-base.xml
(original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/resources/openjpa-database-page-manager-base.xml
Fri Feb 27 21:09:32 2009
@@ -34,6 +34,8 @@
 		        <prop key="openjpa.ManagedRuntime">invocation(TransactionManagerMethod=com.atomikos.icatch.jta.TransactionManagerImp.getTransactionManager)</prop>
             </props>
         </property>
+        <property name="persistenceUnitName" value="jetspeed-page-manager"/>
+        <property name="persistenceUnitManager" ref="persistenceUnitManager"/>
     </bean>
     <bean id="pageManagerEntityManagerFactory" parent="abstractEntityManagerFactory">
         <property name="persistenceUnitName" value="jetspeed-page-manager"/>

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/resources/openjpa-registry.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/resources/openjpa-registry.xml?rev=748699&r1=748698&r2=748699&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/resources/openjpa-registry.xml
(original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/test/resources/openjpa-registry.xml
Fri Feb 27 21:09:32 2009
@@ -32,6 +32,8 @@
 		        <prop key="openjpa.ManagedRuntime">invocation(TransactionManagerMethod=com.atomikos.icatch.jta.TransactionManagerImp.getTransactionManager)</prop>
             </props>
         </property>
+        <property name="persistenceUnitName" value="jetspeed-registry"/>
+        <property name="persistenceUnitManager" ref="persistenceUnitManager"/>
     </bean>
     <bean id="registryEntityManagerFactory" parent="abstractEntityManagerFactory">
         <property name="persistenceUnitName" value="jetspeed-registry"/>

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/jpa/MergingPersistenceUnitManager.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/jpa/MergingPersistenceUnitManager.java?rev=748699&r1=748698&r2=748699&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/jpa/MergingPersistenceUnitManager.java
(original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/jpa/MergingPersistenceUnitManager.java
Fri Feb 27 21:09:32 2009
@@ -17,8 +17,11 @@
 package org.apache.jetspeed.components.rdbms.jpa;
 
 import java.net.URL;
+import java.util.HashMap;
 import java.util.Map;
 
+import javax.persistence.spi.PersistenceUnitInfo;
+
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager;
@@ -33,12 +36,15 @@
 public class MergingPersistenceUnitManager extends DefaultPersistenceUnitManager
 {
     private static final Log logger = LogFactory.getLog(MergingPersistenceUnitManager.class);
+    
+    private Map<String,PersistenceUnitInfo> persistentUnitInfos;
 
     /**
      * Default constructor.
      */
     public MergingPersistenceUnitManager()
     {
+        persistentUnitInfos = new HashMap<String,PersistenceUnitInfo>();
     }
     
     /* (non-Javadoc)
@@ -136,5 +142,33 @@
                 logger.warn("Merge conflicts found between "+persistenceUnitName+" JPA persistence
units: "+existingPersistenceUnitInfo.getPersistenceUnitRootUrl()+" and "+persistenceUnitInfo.getPersistenceUnitRootUrl());
             }
         }
+        
+        // save persistent unit information for later access
+        persistentUnitInfos.put(persistenceUnitName, persistenceUnitInfo);
+    }
+    
+    /**
+     * Access read-only persistence unit information.
+     * 
+     * @param persistenceUnitName persistence unit name.
+     * @return persistence unit info.
+     */
+    public PersistenceUnitInfo accessPersistenceUnitInfo(String persistenceUnitName)
+    {
+        return persistentUnitInfos.get(persistenceUnitName);
+    }
+
+    /**
+     * Access read-only default persistence unit information.
+     * 
+     * @return default persistence unit info.
+     */
+    public PersistenceUnitInfo accessDefaultPersistenceUnitInfo()
+    {
+        if (persistentUnitInfos.size() == 1)
+        {
+            return persistentUnitInfos.values().iterator().next();
+        }
+        return null;
     }
 }

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/jpa/OpenJPAConfigurationProperties.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/jpa/OpenJPAConfigurationProperties.java?rev=748699&r1=748698&r2=748699&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/jpa/OpenJPAConfigurationProperties.java
(original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/jpa/OpenJPAConfigurationProperties.java
Fri Feb 27 21:09:32 2009
@@ -16,9 +16,16 @@
  */
 package org.apache.jetspeed.components.rdbms.jpa;
 
+import java.sql.SQLException;
+import java.sql.Connection;
+import java.sql.DatabaseMetaData;
 import java.util.Map;
 import java.util.Properties;
 
+import javax.persistence.spi.PersistenceUnitInfo;
+import javax.sql.DataSource;
+
+import org.apache.jetspeed.components.rdbms.jpa.database.OpenJPAPostgresDBDictionary;
 import org.springframework.beans.factory.InitializingBean;
 
 /**
@@ -60,12 +67,21 @@
     protected static final String OPENJPA_REMOTE_COMMIT_PROVIDER_PROP_NAME = "openjpa.RemoteCommitProvider";
     protected static final String OPENJPA_REMOTE_COMMIT_PROVIDER_PROP_DEFAULT_VALUE = "sjvm";
// stand alone default value
     protected static final String OPENJPA_REMOTE_COMMIT_PROVIDER_PROP_TCP_VALUE = "tcp(Port=${"+OPENJPA_CACHE_PORT_PROP_NAME+"},Addresses=${"+OPENJPA_CACHE_ADDRESSES_PROP_NAME+"})";
// distributed TCP configuration value
+    protected static final String OPENJPA_DBDICTIONARY_PROP_NAME = "openjpa.jdbc.DBDictionary";
 
     // Singleton implementation
     
     private static OpenJPAConfigurationProperties instance;
     
-    public static OpenJPAConfigurationProperties getInstance(final String cachePort, final
String cacheAddresses)
+    /**
+     * Setup configuration properties singleton.
+     * 
+     * @param cachePort distributed cache port.
+     * @param cacheAddresses distributed cache addresses list.
+     * @param dataSource OpenJPA data source or null.
+     * @return configuration properties instance
+     */
+    public static OpenJPAConfigurationProperties getInstance(final String cachePort, final
String cacheAddresses, final DataSource dataSource)
     {
         // construct and return a default instance
         if ( instance == null)
@@ -73,6 +89,7 @@
             instance = new OpenJPAConfigurationProperties();
             instance.setCachePort(cachePort);
             instance.setCacheAddresses(cacheAddresses);
+            instance.setDataSource(dataSource);
             instance.afterPropertiesSet();
         }
         return instance;
@@ -86,6 +103,9 @@
     private String cacheTimeout;
     private String cachePort;
     private String cacheAddresses;
+    private DataSource dataSource;
+    private String persistenceUnitName;
+    private MergingPersistenceUnitManager persistenceUnitManager;
     
     // Protocol
     
@@ -231,6 +251,86 @@
             }
             setProperty(OPENJPA_REMOTE_COMMIT_PROVIDER_PROP_NAME, propValue);
         }
+        
+        // determine database URL and product from specified persistence unit
+        // name and manager or data source
+        String databaseUrl = null;
+        String databaseProduct = null;
+        if ((dataSource == null) && (persistenceUnitManager != null))
+        {
+            // get specified or default persistence unit info
+            PersistenceUnitInfo persistenceUnitInfo = null;
+            if (persistenceUnitName != null)
+            {
+                persistenceUnitInfo = persistenceUnitManager.accessPersistenceUnitInfo(persistenceUnitName);
+            }
+            if (persistenceUnitInfo == null)
+            {
+                persistenceUnitInfo = persistenceUnitManager.accessDefaultPersistenceUnitInfo();
               
+            }
+            
+            // get data source from persistence unit info or manager
+            if (persistenceUnitInfo != null)
+            {
+                dataSource = persistenceUnitInfo.getJtaDataSource();
+                if (dataSource == null)
+                {
+                    dataSource = persistenceUnitInfo.getNonJtaDataSource();             
      
+                }
+            }
+            if (dataSource == null)
+            {
+                dataSource = persistenceUnitManager.getDefaultDataSource();
+            }
+        }
+        if (dataSource != null)
+        {
+            // open connection and introspect meta data
+            Connection connection = null;
+            try
+            {
+                // open data source connection
+                connection = dataSource.getConnection();
+                DatabaseMetaData databaseMetaData = connection.getMetaData();
+                databaseUrl = databaseMetaData.getURL();
+                if (databaseUrl != null)
+                {
+                    databaseUrl = databaseUrl.toLowerCase();
+                }
+                databaseProduct = databaseMetaData.getDatabaseProductName();
+                if (databaseProduct != null)
+                {
+                    databaseProduct = databaseProduct.toLowerCase();
+                }
+            }
+            catch (SQLException sqle)
+            {
+                throw new RuntimeException("Unable to introspect OpenJPA data source: "+sqle,
sqle);
+            }
+            finally
+            {
+                // cleanup data source connection
+                if (connection != null)
+                {
+                    try
+                    {
+                        connection.close();
+                    }
+                    catch (SQLException sqle)
+                    {
+                    }
+                }
+            }
+        }
+        
+        // configure OpenJPA database dictionary if necessary
+        // based on database URL or product
+        if (((databaseUrl != null) && databaseUrl.contains("postgres")) || ((databaseProduct
!= null) && databaseProduct.contains("postgres")))
+        {
+            // override default database mapping to ensure boolean types
+            // are mapped to integer/bit column types
+            setProperty(OPENJPA_DBDICTIONARY_PROP_NAME, OpenJPAPostgresDBDictionary.class.getName());
+        }
     }
     
     // Implementation
@@ -321,4 +421,39 @@
     {
         this.cacheAddresses = cacheAddresses;
     }
+
+    /**
+     * Set data source used to determine database type and potentially
+     * override database dictionary settings.
+     * 
+     * @param dataSource the dataSource to set
+     */
+    public void setDataSource(DataSource dataSource)
+    {
+        this.dataSource = dataSource;
+    }
+
+    /**
+     * Set persistence unit name used together with the persistence
+     * unit manager to determine database type and potentially override
+     * database dictionary settings.
+     * 
+     * @param persistenceUnitName the persistenceUnitName to set
+     */
+    public void setPersistenceUnitName(String persistenceUnitName)
+    {
+        this.persistenceUnitName = persistenceUnitName;
+    }
+
+    /**
+     * Set persistence unit manager used together with the persistence
+     * unit name to determine database type and potentially override
+     * database dictionary settings.
+     * 
+     * @param persistenceUnitManager the persistenceUnitManager to set
+     */
+    public void setPersistenceUnitManager(MergingPersistenceUnitManager persistenceUnitManager)
+    {
+        this.persistenceUnitManager = persistenceUnitManager;
+    }
 }

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/jpa/database/OpenJPAPostgresDBDictionary.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/jpa/database/OpenJPAPostgresDBDictionary.java?rev=748699&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/jpa/database/OpenJPAPostgresDBDictionary.java
(added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-rdbms/src/main/java/org/apache/jetspeed/components/rdbms/jpa/database/OpenJPAPostgresDBDictionary.java
Fri Feb 27 21:09:32 2009
@@ -0,0 +1,57 @@
+/*
+ * 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.jetspeed.components.rdbms.jpa.database;
+
+import java.sql.PreparedStatement;
+import java.sql.SQLException;
+
+import org.apache.openjpa.jdbc.schema.Column;
+import org.apache.openjpa.jdbc.sql.PostgresDictionary;
+
+/**
+ * OpenJPAPostgresDBDictionary
+ * 
+ * Extends built-in PostgreSQL dictionary to facilitate J2 usage
+ * of portable SMALLINT fields for boolean object members instead
+ * of the more PostgreSQL conventional BOOLEAN field type.  
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id: $
+ */
+public class OpenJPAPostgresDBDictionary extends PostgresDictionary
+{
+    /**
+     * Default constructor.
+     * 
+     * Override column types used for boolean mapping info.
+     */
+    public OpenJPAPostgresDBDictionary()
+    {
+        bitTypeName = "SMALLINT";
+        booleanTypeName = "SMALLINT";
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.openjpa.jdbc.sql.PostgresDictionary#setBoolean(java.sql.PreparedStatement,
int, boolean, org.apache.openjpa.jdbc.schema.Column)
+     */
+    public void setBoolean(PreparedStatement stmnt, int idx, boolean val, Column col) throws
SQLException
+    {
+        // setting must be done using integer type since we are
+        // overriding boolean with integer field types
+        stmnt.setInt(idx, (val) ? 1 : 0);
+    }
+}

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/openjpa-registry-base.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/openjpa-registry-base.xml?rev=748699&r1=748698&r2=748699&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/openjpa-registry-base.xml
(original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/test/resources/openjpa-registry-base.xml
Fri Feb 27 21:09:32 2009
@@ -34,6 +34,8 @@
 		        <prop key="openjpa.ManagedRuntime">invocation(TransactionManagerMethod=com.atomikos.icatch.jta.TransactionManagerImp.getTransactionManager)</prop>
             </props>
         </property>
+        <property name="persistenceUnitName" value="jetspeed-registry"/>
+        <property name="persistenceUnitManager" ref="persistenceUnitManager"/>
     </bean>
     <bean id="registryEntityManagerFactory" parent="abstractEntityManagerFactory">
         <property name="persistenceUnitName" value="jetspeed-registry"/>

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/resources/openjpa-security.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/resources/openjpa-security.xml?rev=748699&r1=748698&r2=748699&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/resources/openjpa-security.xml
(original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-security/src/test/resources/openjpa-security.xml
Fri Feb 27 21:09:32 2009
@@ -34,6 +34,8 @@
 		        <prop key="openjpa.ManagedRuntime">invocation(TransactionManagerMethod=com.atomikos.icatch.jta.TransactionManagerImp.getTransactionManager)</prop>
             </props>
         </property>
+        <property name="persistenceUnitName" value="jetspeed-security"/>
+        <property name="persistenceUnitManager" ref="persistenceUnitManager"/>
     </bean>
     <bean id="securityEntityManagerFactory" parent="abstractEntityManagerFactory">
         <property name="persistenceUnitName" value="jetspeed-security"/>

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/resources/openjpa-sso.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/resources/openjpa-sso.xml?rev=748699&r1=748698&r2=748699&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/resources/openjpa-sso.xml
(original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-sso/src/test/resources/openjpa-sso.xml
Fri Feb 27 21:09:32 2009
@@ -34,6 +34,8 @@
 		        <prop key="openjpa.ManagedRuntime">invocation(TransactionManagerMethod=com.atomikos.icatch.jta.TransactionManagerImp.getTransactionManager)</prop>
             </props>
         </property>
+        <property name="persistenceUnitName" value="jetspeed-security"/>
+        <property name="persistenceUnitManager" ref="persistenceUnitManager"/>
     </bean>
     <bean id="securityEntityManagerFactory" parent="abstractEntityManagerFactory">
         <property name="persistenceUnitName" value="jetspeed-security"/>

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/capabilities.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/capabilities.xml?rev=748699&r1=748698&r2=748699&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/capabilities.xml
(original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/capabilities.xml
Fri Feb 27 21:09:32 2009
@@ -130,6 +130,8 @@
         <prop key="openjpa.ManagedRuntime">invocation(TransactionManagerMethod=com.atomikos.icatch.jta.TransactionManagerImp.getTransactionManager)</prop>
       </props>
     </property>
+    <property name="persistenceUnitName" value="jetspeed-capabilities"/>
+    <property name="persistenceUnitManager" ref="persistenceUnitManager"/>
   </bean>
   <bean id="capabilitiesEntityManagerFactory" parent="abstractEntityManagerFactory">
     <meta key="j2:cat" value="jpa and (default or capabilities)"/>

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/page-manager.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/page-manager.xml?rev=748699&r1=748698&r2=748699&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/page-manager.xml
(original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/page-manager.xml
Fri Feb 27 21:09:32 2009
@@ -286,6 +286,8 @@
         <prop key="openjpa.ManagedRuntime">invocation(TransactionManagerMethod=com.atomikos.icatch.jta.TransactionManagerImp.getTransactionManager)</prop>
       </props>
     </property>
+    <property name="persistenceUnitName" value="jetspeed-page-manager"/>
+    <property name="persistenceUnitManager" ref="persistenceUnitManager"/>
   </bean>
   <bean id="pageManagerEntityManagerFactory" parent="abstractEntityManagerFactory">
     <meta key="j2:cat" value="jpa and (dbPageManager or pageSerializer)"/>

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/profiler.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/profiler.xml?rev=748699&r1=748698&r2=748699&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/profiler.xml
(original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/profiler.xml
Fri Feb 27 21:09:32 2009
@@ -296,6 +296,8 @@
         <prop key="openjpa.ManagedRuntime">invocation(TransactionManagerMethod=com.atomikos.icatch.jta.TransactionManagerImp.getTransactionManager)</prop>
       </props>
     </property>
+    <property name="persistenceUnitName" value="jetspeed-profiler"/>
+    <property name="persistenceUnitManager" ref="persistenceUnitManager"/>
   </bean>
   <bean id="profilerEntityManagerFactory" parent="abstractEntityManagerFactory">
     <meta key="j2:cat" value="jpa and (default or profiler)"/>

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/registry.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/registry.xml?rev=748699&r1=748698&r2=748699&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/registry.xml
(original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/registry.xml
Fri Feb 27 21:09:32 2009
@@ -212,6 +212,8 @@
         <prop key="openjpa.ManagedRuntime">invocation(TransactionManagerMethod=com.atomikos.icatch.jta.TransactionManagerImp.getTransactionManager)</prop>
       </props>
     </property>
+    <property name="persistenceUnitName" value="jetspeed-registry"/>
+    <property name="persistenceUnitManager" ref="persistenceUnitManager"/>
   </bean>
   <bean id="registryEntityManagerFactory" parent="abstractEntityManagerFactory">
     <meta key="j2:cat" value="jpa and (default or registry)"/>

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/security-spi.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/security-spi.xml?rev=748699&r1=748698&r2=748699&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/security-spi.xml
(original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/assembly/security-spi.xml
Fri Feb 27 21:09:32 2009
@@ -214,6 +214,8 @@
 		<prop key="openjpa.ManagedRuntime">invocation(TransactionManagerMethod=com.atomikos.icatch.jta.TransactionManagerImp.getTransactionManager)</prop>
       </props>
     </property>
+    <property name="persistenceUnitName" value="jetspeed-security"/>
+    <property name="persistenceUnitManager" ref="persistenceUnitManager"/>
   </bean>
   <bean id="securityEntityManagerFactory" parent="abstractEntityManagerFactory">
     <meta key="j2:cat" value="jpa and (default or security)"/>



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-dev-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-dev-help@portals.apache.org


Mime
View raw message