portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rwat...@apache.org
Subject svn commit: r735948 [2/2] - in /portals/jetspeed-2/portal/branches/JPA_BRANCH: components/jetspeed-capability/ components/jetspeed-capability/src/main/java/org/apache/jetspeed/capabilities/impl/ components/jetspeed-capability/src/main/java/org/apache/j...
Date Tue, 20 Jan 2009 06:54:51 GMT
Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-capability/src/test/java/org/apache/jetspeed/capabilities/TestOpenJPACapability.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-capability/src/test/java/org/apache/jetspeed/capabilities/TestOpenJPACapability.java?rev=735948&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-capability/src/test/java/org/apache/jetspeed/capabilities/TestOpenJPACapability.java
(added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-capability/src/test/java/org/apache/jetspeed/capabilities/TestOpenJPACapability.java
Mon Jan 19 22:54:50 2009
@@ -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.jetspeed.capabilities;
+
+import junit.framework.Test;
+
+import org.apache.jetspeed.capabilities.jpa.CapabilitiesManagerContext;
+
+/**
+ * TestOpenJPACapabilities
+ * 
+ * @author <a href="mailto:rwatler@apache.org">Randy Watler</a>
+ * @version $Id:$
+ */
+public class TestOpenJPACapability extends TestCapability
+{
+    private CapabilitiesManagerContext context;
+
+    /**
+     * Define ordered test case test methods.
+     * 
+     * @return test suite
+     */
+    public static Test suite()
+    {
+        return createFixturedTestSuite(TestOpenJPACapability.class, "firstTestSetup", "lastTestTeardown");
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.capabilities.TestCapabilities#getConfigurations()
+     */
+    protected String[] getConfigurations()
+    {
+        return new String[] {"openjpa-capabilities.xml", "serializer.xml"};
+    }
+
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#startConversationalTxn()
+     */
+    protected void startConversationalTxn()
+    {
+        // create scoped context bean for thread transaction
+        context = (CapabilitiesManagerContext)scm.createPrototypeComponent("capabilitiesManagerContext");
+    }
+    
+    /* (non-Javadoc)
+     * @see org.apache.jetspeed.components.util.jpa.JPADatasourceEnabledSpringTestCase#endConversationalTxn()
+     */
+    protected void endConversationalTxn()
+    {
+        // destroy scoped context bean for thread transaction
+        scm.destroyPrototypeComponent("capabilitiesManagerContext", context);
+    }
+
+    /**
+     * Start the tests.
+     * 
+     * @param args the arguments. Not used
+     */
+    public static void main(String args[])
+    {
+        junit.awtui.TestRunner.main(new String[]{TestOpenJPACapability.class.getName()});
+    }
+}

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-capability/src/test/resources/jndi.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-capability/src/test/resources/jndi.properties?rev=735948&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-capability/src/test/resources/jndi.properties
(added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-capability/src/test/resources/jndi.properties
Mon Jan 19 22:54:50 2009
@@ -0,0 +1,25 @@
+# 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.
+
+# ------------------------------------------------------------------------
+#
+# JNDI Naming Configuration
+#
+# $Id: $
+#
+# ------------------------------------------------------------------------
+
+java.naming.factory.initial=org.apache.naming.java.javaURLContextFactory
+java.naming.factory.url.pkgs=org.apache.naming

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-capability/src/test/resources/jpa-capabilities.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-capability/src/test/resources/jpa-capabilities.xml?rev=735948&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-capability/src/test/resources/jpa-capabilities.xml
(added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-capability/src/test/resources/jpa-capabilities.xml
Mon Jan 19 22:54:50 2009
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:tx="http://www.springframework.org/schema/tx"
+    xsi:schemaLocation="http://www.springframework.org/schema/beans
+      http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+      http://www.springframework.org/schema/tx
+      http://www.springframework.org/schema/tx/spring-tx.xsd">
+
+    <!-- Jetspeed XA DataSource -->
+    <bean id="JetspeedXADS" class="org.springframework.jndi.JndiObjectFactoryBean">
+        <property name="resourceRef" value="false"/>
+        <property name="jndiName" value="java:comp/env/jdbc/jetspeed-xa"/>
+    </bean>
+
+    <!-- JPA Configuration -->
+    <bean id="persistenceUnitManager" class="org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager">
+        <property name="dataSources">
+            <map>
+                <entry key="jetspeed-xa" value-ref="JetspeedXADS"/>
+                <entry key="jetspeed" value-ref="JetspeedDS"/>
+            </map>
+        </property>
+        <property name="defaultDataSource" ref="JetspeedDS"/>
+        <property name="persistenceXmlLocations">
+            <list>
+                <value>classpath*:META-INF/persistence.xml</value>
+            </list>
+        </property>
+    </bean>
+    <bean id="abstractEntityManagerFactory" abstract="true" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+        <property name="persistenceUnitManager" ref="persistenceUnitManager"/>
+    </bean>
+
+    <!-- Spring/Atomikos/JTA Transaction Manager -->
+    <bean id="atomikosUserTransactionService" class="com.atomikos.icatch.config.UserTransactionServiceImp"
init-method="init" destroy-method="shutdownForce">
+        <constructor-arg>
+            <props>
+                <!-- standard atomikos standalone configuration -->
+                <prop key="com.atomikos.icatch.service">com.atomikos.icatch.standalone.UserTransactionServiceFactory</prop>
+                <!-- server/process name overrides for log file names -->
+                <prop key="com.atomikos.icatch.tm_unique_name">${com.atomikos.icatch.tm_unique_name}</prop>
+                <prop key="com.atomikos.icatch.log_base_dir">${com.atomikos.icatch.log_base_dir}</prop>
+                <prop key="com.atomikos.icatch.log_base_name">${com.atomikos.icatch.log_base_name}</prop>
+                <prop key="com.atomikos.icatch.output_dir">${com.atomikos.icatch.output_dir}</prop>
+                <prop key="com.atomikos.icatch.console_file_name">${com.atomikos.icatch.console_file_name}</prop>
+            </props>
+        </constructor-arg>
+    </bean>
+    <bean id="atomikosTransactionManager" class="com.atomikos.icatch.jta.UserTransactionManager"
init-method="init" destroy-method="close" depends-on="atomikosUserTransactionService">
+        <property name="forceShutdown" value="true"/>
+    </bean>
+    <bean id="jtaTransactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
+        <property name="transactionManager" ref="atomikosTransactionManager"/>
+        <property name="userTransactionName" value="java:comp/UserTransaction"/>
+    </bean>
+    <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>
+
+    <!-- Spring Transaction Annotations -->
+    <tx:annotation-driven transaction-manager="jtaTransactionManager"/>
+
+    <!-- JPA/OpenJPA Capabilities Components -->
+    <bean id="client" class="org.apache.jetspeed.capabilities.jpa.ClientImpl" scope="prototype"/>
+    <bean id="mediaType" class="org.apache.jetspeed.capabilities.jpa.MediaTypeImpl" scope="prototype"/>
+    <bean id="mimeType" class="org.apache.jetspeed.capabilities.jpa.MimeTypeImpl" scope="prototype"/>
+    <bean id="capability" class="org.apache.jetspeed.capabilities.jpa.CapabilityImpl"
scope="prototype"/>
+    <bean id="capabilities" name="capabilitiesImpl,org.apache.jetspeed.capabilities.Capabilities"
class="org.apache.jetspeed.capabilities.jpa.JetspeedCapabilities">
+        <constructor-arg index="0"><value>client</value></constructor-arg>
+        <constructor-arg index="1"><value>mediaType</value></constructor-arg>
+        <constructor-arg index="2"><value>mimeType</value></constructor-arg>
+        <constructor-arg index="3"><value>capability</value></constructor-arg>
+    </bean>
+
+    <!-- JPA Capabilities Manager Context -->
+    <bean id="capabilitiesManagerContext" class="org.apache.jetspeed.capabilities.jpa.CapabilitiesManagerContext"
scope="prototype" init-method="initialize" destroy-method="terminate">
+        <property name="capabilitiesManager" ref="capabilities"/>
+    </bean>
+
+</beans>

Added: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-capability/src/test/resources/log4j.properties
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-capability/src/test/resources/log4j.properties?rev=735948&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-capability/src/test/resources/log4j.properties
(added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-capability/src/test/resources/log4j.properties
Mon Jan 19 22:54:50 2009
@@ -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.
+
+# ------------------------------------------------------------------------
+#
+# Logging Configuration
+#
+# $Id: log4j.properties 731466 2009-01-05 06:04:13Z rwatler $
+#
+# ------------------------------------------------------------------------
+
+log4j.rootCategory = ERROR, errorlogging
+
+#log4j.category.openjpa.Tool = INFO, infologging
+#log4j.category.openjpa.Runtime = INFO, infologging
+#log4j.category.openjpa.Remote = WARN, infologging
+#log4j.category.openjpa.DataCache = WARN, infologging
+#log4j.category.openjpa.MetaData = WARN, infologging
+#log4j.category.openjpa.Enhance = WARN, infologging
+#log4j.category.openjpa.Query = WARN, infologging
+#log4j.category.openjpa.jdbc.SQL = WARN, infologging
+#log4j.category.openjpa.jdbc.JDBC = WARN, infologging
+#log4j.category.openjpa.jdbc.Schema = WARN, infologging
+
+log4j.category.org.springframework = DEBUG, infologging
+log4j.additivity.org.springframework = false
+
+log4j.category.openjpa.Tool = TRACE, infologging
+log4j.additivity.openjpa.Tool = false
+log4j.category.openjpa.Runtime = TRACE, infologging
+log4j.additivity.openjpa.Runtime = false
+log4j.category.openjpa.Remote = TRACE, infologging
+log4j.additivity.openjpa.Remote = false
+log4j.category.openjpa.DataCache = TRACE, infologging
+log4j.additivity.openjpa.DataCache = false
+log4j.category.openjpa.MetaData = TRACE, infologging
+log4j.additivity.openjpa.MetaData = false
+log4j.category.openjpa.Enhance = TRACE, infologging
+log4j.additivity.openjpa.Enhance = false
+log4j.category.openjpa.Query = TRACE, infologging
+log4j.additivity.openjpa.Query = false
+log4j.category.openjpa.jdbc.SQL = TRACE, infologging
+log4j.additivity.openjpa.jdbc.SQL = false
+#log4j.category.openjpa.jdbc.JDBC = TRACE, infologging
+log4j.category.openjpa.jdbc.JDBC = DEBUG, infologging
+log4j.additivity.openjpa.jdbc.JDBC = false
+log4j.category.openjpa.jdbc.Schema = TRACE, infologging
+log4j.additivity.openjpa.jdbc.Schema = false
+
+log4j.category.org.apache.jetspeed = DEBUG, infologging
+log4j.additivity.org.apache.jetspeed = false
+
+log4j.category.atomikos = DEBUG, infologging
+log4j.additivity.atomikos = false
+
+log4j.appender.errorlogging = org.apache.log4j.FileAppender
+log4j.appender.errorlogging.file = ${basedir}/target/surefire-reports/tests-error.log
+log4j.appender.errorlogging.layout = org.apache.log4j.PatternLayout
+log4j.appender.errorlogging.layout.conversionPattern = %d [%t] %-5p %c - %m%n
+log4j.appender.errorlogging.append = false
+
+log4j.appender.infologging = org.apache.log4j.FileAppender
+log4j.appender.infologging.file = ${basedir}/target/surefire-reports/tests-info.log
+log4j.appender.infologging.layout = org.apache.log4j.PatternLayout
+log4j.appender.infologging.layout.conversionPattern = %d [%t] %-5p %c - %m%n
+log4j.appender.infologging.append = false

Added: 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=735948&view=auto
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-capability/src/test/resources/openjpa-capabilities.xml
(added)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-capability/src/test/resources/openjpa-capabilities.xml
Mon Jan 19 22:54:50 2009
@@ -0,0 +1,46 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xmlns:tx="http://www.springframework.org/schema/tx"
+    xsi:schemaLocation="http://www.springframework.org/schema/beans
+      http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
+      http://www.springframework.org/schema/tx
+      http://www.springframework.org/schema/tx/spring-tx.xsd">
+
+    <import resource="jpa-capabilities.xml"/>
+
+    <!-- OpenJPA/Atomikos Configuration -->
+    <bean id="jpaCapabilitiesProperties" class="org.apache.jetspeed.components.rdbms.jpa.OpenJPAConfigurationProperties">
+        <property name="jpaProperties">
+            <props>
+		        <prop key="openjpa.ConnectionFactoryMode">managed</prop>
+		        <prop key="openjpa.TransactionMode">managed</prop>
+		        <prop key="openjpa.ManagedRuntime">invocation(TransactionManagerMethod=com.atomikos.icatch.jta.TransactionManagerImp.getTransactionManager)</prop>
+            </props>
+        </property>
+    </bean>
+    <bean id="capabilitiesEntityManagerFactory" parent="abstractEntityManagerFactory">
+        <property name="persistenceUnitName" value="jetspeed-capabilities"/>
+        <property name="jpaProperties" ref="jpaCapabilitiesProperties"/>
+        <property name="jpaDialect">
+            <bean class="org.springframework.orm.jpa.vendor.OpenJpaDialect"/>
+        </property>
+    </bean>
+
+</beans>

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/jpa/FolderImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/jpa/FolderImpl.java?rev=735948&r1=735947&r2=735948&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/jpa/FolderImpl.java
(original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/folder/jpa/FolderImpl.java
Mon Jan 19 22:54:50 2009
@@ -86,8 +86,8 @@
 @Inheritance (strategy=InheritanceType.TABLE_PER_CLASS)
 @Table (name="FOLDER")
 @AttributeOverrides ({@AttributeOverride (name="id", column=@Column(name="FOLDER_ID"))})
-@NamedQueries({@NamedQuery(name="FOLDER_FOLDERS", query="select f from Folder f where f.parent
= :folder"), 
-               @NamedQuery(name="FOLDER", query="select f from Folder f where f.path = :path")})
+@NamedQueries ({@NamedQuery(name="FOLDER_FOLDERS", query="select f from Folder f where f.parent
= :folder"), 
+                @NamedQuery(name="FOLDER", query="select f from Folder f where f.path = :path")})
 public class FolderImpl extends NodeImpl implements Folder
 {
     @Basic

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/LinkImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/LinkImpl.java?rev=735948&r1=735947&r2=735948&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/LinkImpl.java
(original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/LinkImpl.java
Mon Jan 19 22:54:50 2009
@@ -56,8 +56,8 @@
 @Inheritance (strategy=InheritanceType.TABLE_PER_CLASS)
 @Table (name="LINK")
 @AttributeOverrides ({@AttributeOverride (name="id", column=@Column(name="LINK_ID"))})
-@NamedQueries({@NamedQuery(name="FOLDER_LINKS", query="select l from Link l where l.parent
= :folder"),
-               @NamedQuery(name="LINK", query="select l from Link l where l.path = :path")})
+@NamedQueries ({@NamedQuery(name="FOLDER_LINKS", query="select l from Link l where l.parent
= :folder"),
+                @NamedQuery(name="LINK", query="select l from Link l where l.path = :path")})
 public class LinkImpl extends DocumentImpl implements Link
 {
     @Basic

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageImpl.java?rev=735948&r1=735947&r2=735948&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageImpl.java
(original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageImpl.java
Mon Jan 19 22:54:50 2009
@@ -66,8 +66,8 @@
 @Inheritance (strategy=InheritanceType.TABLE_PER_CLASS)
 @Table (name="PAGE")
 @AttributeOverrides ({@AttributeOverride (name="id", column=@Column(name="PAGE_ID"))})
-@NamedQueries({@NamedQuery(name="FOLDER_PAGES", query="select p from Page p where p.parent
= :folder"),
-               @NamedQuery(name="PAGE", query="select p from Page p where p.path = :path")})
+@NamedQueries ({@NamedQuery(name="FOLDER_PAGES", query="select p from Page p where p.parent
= :folder"),
+                @NamedQuery(name="PAGE", query="select p from Page p where p.path = :path")})
 public class PageImpl extends DocumentImpl implements Page
 {
     @Basic

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageSecurityImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageSecurityImpl.java?rev=735948&r1=735947&r2=735948&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageSecurityImpl.java
(original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-page-manager/src/main/java/org/apache/jetspeed/om/page/jpa/PageSecurityImpl.java
Mon Jan 19 22:54:50 2009
@@ -59,8 +59,8 @@
 @Inheritance (strategy=InheritanceType.TABLE_PER_CLASS)
 @Table (name="PAGE_SECURITY")
 @AttributeOverrides ({@AttributeOverride (name="id", column=@Column(name="PAGE_SECURITY_ID"))})
-@NamedQueries({@NamedQuery(name="FOLDER_PAGE_SECURITY", query="select ps from PageSecurity
ps where ps.parent = :folder"),
-               @NamedQuery(name="PAGE_SECURITY", query="select ps from PageSecurity ps where
ps.path = :path")})
+@NamedQueries ({@NamedQuery(name="FOLDER_PAGE_SECURITY", query="select ps from PageSecurity
ps where ps.parent = :folder"),
+                @NamedQuery(name="PAGE_SECURITY", query="select ps from PageSecurity ps where
ps.path = :path")})
 public class PageSecurityImpl extends DocumentImpl implements PageSecurity
 {
     @ManyToOne (targetEntity=FolderImpl.class, fetch=FetchType.LAZY, optional=false, cascade=CascadeType.PERSIST)

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/jpa/AbstractProfilingRule.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/jpa/AbstractProfilingRule.java?rev=735948&r1=735947&r2=735948&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/jpa/AbstractProfilingRule.java
(original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/jpa/AbstractProfilingRule.java
Mon Jan 19 22:54:50 2009
@@ -61,8 +61,8 @@
 @Inheritance (strategy=InheritanceType.SINGLE_TABLE)
 @Table (name="PROFILING_RULE")
 @DiscriminatorColumn (name="CLASS_NAME")
-@NamedQueries({@NamedQuery(name="PROFILING_RULES", query="select pr from ProfilingRule pr"),
-               @NamedQuery(name="PROFILING_RULE", query="select pr from ProfilingRule pr
where pr.id = :id")})
+@NamedQueries ({@NamedQuery(name="PROFILING_RULES", query="select pr from ProfilingRule pr"),
+                @NamedQuery(name="PROFILING_RULE", query="select pr from ProfilingRule pr
where pr.id = :id")})
 public abstract class AbstractProfilingRule extends AbstractBaseProfilingRule implements
ProfilingRule
 {
     private static final long serialVersionUID = 1; 
@@ -85,13 +85,16 @@
     @PostLoad
     private void postLoad()
     {
+        isNew = false;
+        eagerFetchCollections();
+    }    
+    private void eagerFetchCollections()
+    {
         if (criteria != null)
         {
             criteria.size();
-        }
-
-        isNew = false;        
-    }    
+        }        
+    }
     @PrePersist
     private void prePersist()
     {

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/jpa/PrincipalRuleImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/jpa/PrincipalRuleImpl.java?rev=735948&r1=735947&r2=735948&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/jpa/PrincipalRuleImpl.java
(original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-profiler/src/main/java/org/apache/jetspeed/profiler/rules/jpa/PrincipalRuleImpl.java
Mon Jan 19 22:54:50 2009
@@ -45,8 +45,8 @@
 @Entity (name="PrincipalRule")
 @IdClass (value=PrincipalRuleImpl.PrincipalRuleImplId.class)
 @Table (name="PRINCIPAL_RULE_ASSOC")
-@NamedQueries({@NamedQuery(name="PRINCIPAL_RULE", query="select pr from PrincipalRule pr
where pr.principalName = :principalName and pr.locatorName = :locatorName"),
-               @NamedQuery(name="PRINCIPAL_RULES", query="select pr from PrincipalRule pr
where pr.principalName = :principalName")})
+@NamedQueries ({@NamedQuery(name="PRINCIPAL_RULE", query="select pr from PrincipalRule pr
where pr.principalName = :principalName and pr.locatorName = :locatorName"),
+                @NamedQuery(name="PRINCIPAL_RULES", query="select pr from PrincipalRule pr
where pr.principalName = :principalName")})
 public class PrincipalRuleImpl implements PrincipalRule
 {
     private static final long serialVersionUID = 1; 
@@ -70,7 +70,15 @@
     private void postLoad()
     {
         isNew = false;
+        eagerFetchReferences();
     }    
+    private void eagerFetchReferences()
+    {
+        if (profilingRule != null)
+        {
+            profilingRule.getId();
+        }
+    }
     @PrePersist
     private void prePersist()
     {

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletentity/jpa/PortletEntityImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletentity/jpa/PortletEntityImpl.java?rev=735948&r1=735947&r2=735948&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletentity/jpa/PortletEntityImpl.java
(original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletentity/jpa/PortletEntityImpl.java
Mon Jan 19 22:54:50 2009
@@ -45,8 +45,8 @@
  */
 @Entity (name="PortletEntity")
 @Table (name="PORTLET_ENTITY")
-@NamedQueries({@NamedQuery(name="PORTLET_ENTITIES", query="select pe from PortletEntity pe
where pe.appName = :appName and pe.portletName = :portletName"),
-               @NamedQuery(name="PORTLET_ENTITY", query="select pe from PortletEntity pe
where pe.id = :id")})
+@NamedQueries ({@NamedQuery(name="PORTLET_ENTITIES", query="select pe from PortletEntity
pe where pe.appName = :appName and pe.portletName = :portletName"),
+                @NamedQuery(name="PORTLET_ENTITY", query="select pe from PortletEntity pe
where pe.id = :id")})
 public class PortletEntityImpl implements PortletEntity, RenderTrackable
 {
     // Class Members

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/jpa/DatabasePreference.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/jpa/DatabasePreference.java?rev=735948&r1=735947&r2=735948&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/jpa/DatabasePreference.java
(original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletpreferences/jpa/DatabasePreference.java
Mon Jan 19 22:54:50 2009
@@ -48,12 +48,12 @@
  */
 @Entity (name="PortletPreference")
 @Table (name="PORTLET_PREFERENCE")
-@NamedQueries({@NamedQuery(name="PORTLET_PREFERENCES", query="select pp from PortletPreference
pp where pp.dtype = :dtype and pp.applicationName = :applicationName and pp.portletName =
:portletName"),
-               @NamedQuery(name="DELETE_PORTLET_PREFERENCES", query="delete from PortletPreference
pp where pp.dtype = :dtype and pp.applicationName = :applicationName and pp.portletName =
:portletName"),
-               @NamedQuery(name="PORTLET_DTYPE_PREFERENCES", query="select pp from PortletPreference
pp where pp.dtype = :dtype"),
-               @NamedQuery(name="PORTLET_APPLICATION_PREFERENCES", query="select pp from
PortletPreference pp where pp.dtype = :dtype and pp.applicationName = :applicationName"),
-               @NamedQuery(name="DELETE_PORTLET_APPLICATION_PREFERENCES", query="delete from
PortletPreference pp where pp.dtype = :dtype and pp.applicationName = :applicationName"),
-               @NamedQuery(name="FULLY_QUALIFIED_PORTLET_PREFERENCES", query="select pp from
PortletPreference pp where pp.dtype = :dtype and pp.applicationName = :applicationName and
pp.portletName = :portletName and pp.entityId = :entityId and pp.userName = :userName")})
+@NamedQueries ({@NamedQuery(name="PORTLET_PREFERENCES", query="select pp from PortletPreference
pp where pp.dtype = :dtype and pp.applicationName = :applicationName and pp.portletName =
:portletName"),
+                @NamedQuery(name="DELETE_PORTLET_PREFERENCES", query="delete from PortletPreference
pp where pp.dtype = :dtype and pp.applicationName = :applicationName and pp.portletName =
:portletName"),
+                @NamedQuery(name="PORTLET_DTYPE_PREFERENCES", query="select pp from PortletPreference
pp where pp.dtype = :dtype"),
+                @NamedQuery(name="PORTLET_APPLICATION_PREFERENCES", query="select pp from
PortletPreference pp where pp.dtype = :dtype and pp.applicationName = :applicationName"),
+                @NamedQuery(name="DELETE_PORTLET_APPLICATION_PREFERENCES", query="delete
from PortletPreference pp where pp.dtype = :dtype and pp.applicationName = :applicationName"),
+                @NamedQuery(name="FULLY_QUALIFIED_PORTLET_PREFERENCES", query="select pp
from PortletPreference pp where pp.dtype = :dtype and pp.applicationName = :applicationName
and pp.portletName = :portletName and pp.entityId = :entityId and pp.userName = :userName")})
 public class DatabasePreference implements InternalPortletPreference
 {
     // Members

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/jpa/PortletRegistryImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/jpa/PortletRegistryImpl.java?rev=735948&r1=735947&r2=735948&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/jpa/PortletRegistryImpl.java
(original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/components/portletregistry/jpa/PortletRegistryImpl.java
Mon Jan 19 22:54:50 2009
@@ -212,7 +212,7 @@
         preferenceService.removeDefaults(portletApplication);
         // remove portlet application
         EntityManager entityManager = getEntityManager();
-        // update, (potentially detached), portlet application
+        // remove, (potentially detached), portlet application
         if (!((PortletApplicationDefinitionImpl)portletApplication).isNew())
         {
             portletApplication = entityManager.merge(portletApplication);

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/PortletApplicationDefinitionImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/PortletApplicationDefinitionImpl.java?rev=735948&r1=735947&r2=735948&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/PortletApplicationDefinitionImpl.java
(original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/PortletApplicationDefinitionImpl.java
Mon Jan 19 22:54:50 2009
@@ -63,8 +63,8 @@
  */
 @Entity (name="PortletApplication")
 @Table (name="PORTLET_APPLICATION")
-@NamedQueries({@NamedQuery(name="PORTLET_APPLICATION", query="select pa from PortletApplication
pa where pa.name = :name"),
-               @NamedQuery(name="PORTLET_APPLICATIONS", query="select pa from PortletApplication
pa")})
+@NamedQueries ({@NamedQuery(name="PORTLET_APPLICATION", query="select pa from PortletApplication
pa where pa.name = :name"),
+                @NamedQuery(name="PORTLET_APPLICATIONS", query="select pa from PortletApplication
pa")})
 public class PortletApplicationDefinitionImpl extends AbstractPortletApplicationDefinitionImpl
implements PortletApplication, Serializable
 {
     private static final long serialVersionUID = 3762187785710438592L;

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/PortletDefinitionImpl.java
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/PortletDefinitionImpl.java?rev=735948&r1=735947&r2=735948&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/PortletDefinitionImpl.java
(original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/components/jetspeed-registry/src/main/java/org/apache/jetspeed/om/portlet/jpa/PortletDefinitionImpl.java
Mon Jan 19 22:54:50 2009
@@ -67,8 +67,8 @@
  */
 @Entity (name="PortletDefinition")
 @Table (name="PORTLET_DEFINITION")
-@NamedQueries({@NamedQuery(name="PORTLET_DEFINITION", query="select pd from PortletDefinition
pd where pd.app.name = :appName and pd.portletName = :portletName"),
-               @NamedQuery(name="PORTLET_DEFINITIONS", query="select pd from PortletDefinition
pd")})
+@NamedQueries ({@NamedQuery(name="PORTLET_DEFINITION", query="select pd from PortletDefinition
pd where pd.app.name = :appName and pd.portletName = :portletName"),
+                @NamedQuery(name="PORTLET_DEFINITIONS", query="select pd from PortletDefinition
pd")})
 public class PortletDefinitionImpl extends AbstractPortletDefinitionImpl implements PortletDefinition,
Serializable, PortletDefinitionCollectionMember
 {
     private static final long serialVersionUID = 4313127094480444419L;

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/ddl-schema/phase1-schema.xml
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/ddl-schema/phase1-schema.xml?rev=735948&r1=735947&r2=735948&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/ddl-schema/phase1-schema.xml
(original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/ddl-schema/phase1-schema.xml
Mon Jan 19 22:54:50 2009
@@ -32,6 +32,7 @@
         <column name="CHARACTER_SET" size="40" type="VARCHAR"/>
         <column name="TITLE" size="80" type="VARCHAR"/>
         <column name="DESCRIPTION" type="LONGVARCHAR"/>
+        <column name="JPA_VERSION" type="INTEGER"/>
     </table>
     
     <!--
@@ -47,6 +48,7 @@
         <column name="MODEL" size="80" type="VARCHAR"/>
         <column name="VERSION" size="40" type="VARCHAR"/>
         <column name="PREFERRED_MIMETYPE_ID" required="true" type="INTEGER"/>
+        <column name="JPA_VERSION" type="INTEGER"/>
     </table>
     
     <!--
@@ -56,6 +58,7 @@
     <table name="MIMETYPE">
         <column name="MIMETYPE_ID" primaryKey="true" required="true" type="INTEGER"/>
         <column name="NAME" required="true" size="80" type="VARCHAR"/>
+        <column name="JPA_VERSION" type="INTEGER"/>
     </table>
     
     <!--
@@ -65,6 +68,7 @@
     <table name="CAPABILITY">
         <column name="CAPABILITY_ID" primaryKey="true" required="true" type="INTEGER"/>
         <column name="CAPABILITY" required="true" size="80" type="VARCHAR"/>
+        <column name="JPA_VERSION" type="INTEGER"/>
     </table>
     
     <!--
@@ -95,6 +99,10 @@
         <column name="MIMETYPE_ID" required="true" type="INTEGER"/>
     </table>
 
+    <!--
+       Statistics
+    -->
+
 	<table name='PORTLET_STATISTICS'>
 		<column name='IPADDRESS' type='VARCHAR' size="80"/>
 		<column name='USER_NAME' type='VARCHAR' size="80"/>

Modified: portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/ddl/mssql/create-schema.sql
URL: http://svn.apache.org/viewvc/portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/ddl/mssql/create-schema.sql?rev=735948&r1=735947&r2=735948&view=diff
==============================================================================
--- portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/ddl/mssql/create-schema.sql
(original)
+++ portals/jetspeed-2/portal/branches/JPA_BRANCH/jetspeed-portal-resources/src/main/resources/ddl/mssql/create-schema.sql
Mon Jan 19 22:54:50 2009
@@ -25,6 +25,7 @@
     CHARACTER_SET VARCHAR(40),
     TITLE VARCHAR(80),
     DESCRIPTION TEXT,
+    JPA_VERSION INT,
     PRIMARY KEY (MEDIATYPE_ID)
 );
 
@@ -42,6 +43,7 @@
     MODEL VARCHAR(80),
     VERSION VARCHAR(40),
     PREFERRED_MIMETYPE_ID INT NOT NULL,
+    JPA_VERSION INT,
     PRIMARY KEY (CLIENT_ID)
 );
  
@@ -53,6 +55,7 @@
 (
     MIMETYPE_ID INT NOT NULL,
     NAME VARCHAR(80) NOT NULL,
+    JPA_VERSION INT,
     PRIMARY KEY (MIMETYPE_ID)
 );
  
@@ -64,6 +67,7 @@
 (
     CAPABILITY_ID INT NOT NULL,
     CAPABILITY VARCHAR(80) NOT NULL,
+    JPA_VERSION INT,
     PRIMARY KEY (CAPABILITY_ID)
 );
  



---------------------------------------------------------------------
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