roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r509897 - in /incubator/roller/branches/roller_4.0/apps/planet: src/java/org/apache/roller/planet/business/datamapper/jpa/ src/java/org/apache/roller/planet/business/jpa/ src/java/org/apache/roller/planet/pojos/ src/sql/ testdata/ testdata/...
Date Wed, 21 Feb 2007 05:04:22 GMT
Author: snoopdave
Date: Tue Feb 20 21:04:20 2007
New Revision: 509897

URL: http://svn.apache.org/viewvc?view=rev&rev=509897
Log:
- Moving jpa package under datamapper
- Fixing problems in mapping files
- Added planet_id_table
- Switched property files to point to Datamapper/JPA implementation
- 100% tests passing again with Datamapper/JPA

Added:
    incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/business/datamapper/jpa/
    incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/business/datamapper/jpa/JPAPlanetImpl.java
      - copied, changed from r509214, incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/business/jpa/JPAPlanetImpl.java
Removed:
    incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/business/jpa/
Modified:
    incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/pojos/PlanetData.orm.xml
    incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/pojos/PlanetEntryData.orm.xml
    incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/pojos/PlanetGroupData.orm.xml
    incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/pojos/PlanetSubscriptionData.orm.xml
    incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/pojos/PropertyData.orm.xml
    incubator/roller/branches/roller_4.0/apps/planet/src/sql/createdb.vm
    incubator/roller/branches/roller_4.0/apps/planet/testdata/JPAEMF.properties
    incubator/roller/branches/roller_4.0/apps/planet/testdata/META-INF/persistence.xml
    incubator/roller/branches/roller_4.0/apps/planet/testdata/planet.properties
    incubator/roller/branches/roller_4.0/apps/planet/web/WEB-INF/classes/planet.properties

Copied: incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/business/datamapper/jpa/JPAPlanetImpl.java
(from r509214, incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/business/jpa/JPAPlanetImpl.java)
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/business/datamapper/jpa/JPAPlanetImpl.java?view=diff&rev=509897&p1=incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/business/jpa/JPAPlanetImpl.java&r1=509214&p2=incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/business/datamapper/jpa/JPAPlanetImpl.java&r2=509897
==============================================================================
--- incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/business/jpa/JPAPlanetImpl.java
(original)
+++ incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/business/datamapper/jpa/JPAPlanetImpl.java
Tue Feb 20 21:04:20 2007
@@ -16,7 +16,7 @@
 * directory of this distribution.
 */
 
-package org.apache.roller.planet.business.jpa;
+package org.apache.roller.planet.business.datamapper.jpa;
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -27,7 +27,7 @@
 import org.apache.roller.planet.business.datamapper.DatamapperPlanetManagerImpl;
 import org.apache.roller.planet.business.Planet;
 import org.apache.roller.planet.business.PlanetManager;
-import org.apache.roller.business.jpa.JPAPersistenceStrategy;
+import org.apache.roller.business.datamapper.jpa.JPAPersistenceStrategy;
 
 
 /**

Modified: incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/pojos/PlanetData.orm.xml
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/pojos/PlanetData.orm.xml?view=diff&rev=509897&r1=509896&r2=509897
==============================================================================
--- incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/pojos/PlanetData.orm.xml
(original)
+++ incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/pojos/PlanetData.orm.xml
Tue Feb 20 21:04:20 2007
@@ -8,18 +8,21 @@
             <access>PROPERTY</access>
         </persistence-unit-defaults>
     </persistence-unit-metadata>
-    <package>org.apache.roller.pojos</package>
-    <entity metadata-complete="true" name=""
+    <package>org.apache.roller.planet.pojos</package>
+    <entity metadata-complete="true" name="PlanetData"
             class="org.apache.roller.planet.pojos.PlanetData">
-        <table name="rag_config"/>
-        <table-generator name="ROLLER-TABLE-GENERATOR" table="ROLLER_ID_TABLE" pk-column-name="pk"
value-column-name="value" pk-column-value="1"/>
+        <table name="rag_planet"/>
+        <table-generator name="PLANET-TABLE-GENERATOR" table="PLANET_ID_TABLE" pk-column-name="pk"
value-column-name="value" pk-column-value="1"/>
         <named-query name="PlanetData.getAll">
             <query>SELECT p FROM PlanetData p</query>
         </named-query>
+        <named-query name="PlanetData.getByHandle">
+            <query>SELECT p FROM PlanetData p WHERE p.handle = ?1</query>
+        </named-query>
         <attributes>
             <id name="id">
                 <column name="id"/>
-                <generated-value strategy="TABLE" generator="ROLLER-TABLE-GENERATOR"/>
+                <generated-value strategy="TABLE" generator="PLANET-TABLE-GENERATOR"/>
             </id>
             <basic name="name">
                 <column name="name" insertable="true" updatable="true" unique="false"/>
@@ -27,7 +30,7 @@
             <basic name="handle">
                 <column name="handle" insertable="true" updatable="true" unique="true"/>
             </basic>
-            <one-to-many name="groups" mapped-by="planet_id" target-entity="org.apache.roller.planet.pojos.PlanetGroupData"
fetch="LAZY">
+            <one-to-many name="groups" mapped-by="planet" target-entity="org.apache.roller.planet.pojos.PlanetGroupData"
fetch="LAZY">
                 <cascade>
                     <cascade-all/>
                 </cascade>

Modified: incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/pojos/PlanetEntryData.orm.xml
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/pojos/PlanetEntryData.orm.xml?view=diff&rev=509897&r1=509896&r2=509897
==============================================================================
--- incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/pojos/PlanetEntryData.orm.xml
(original)
+++ incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/pojos/PlanetEntryData.orm.xml
Tue Feb 20 21:04:20 2007
@@ -8,10 +8,10 @@
             <access>PROPERTY</access>
         </persistence-unit-defaults>
     </persistence-unit-metadata>
-    <package>org.apache.roller.pojos</package>
-    <entity metadata-complete="true" name="" class="org.apache.roller.planet.pojos.PlanetEntryData">
+    <package>org.apache.roller.planet.pojos</package>
+    <entity metadata-complete="true" name="PlanetEntryData" class="org.apache.roller.planet.pojos.PlanetEntryData">
         <table name="rag_entry"/>
-        <table-generator name="ROLLER-TABLE-GENERATOR" table="ROLLER_ID_TABLE" pk-column-name="pk"
value-column-name="value" pk-column-value="1"/>
+        <table-generator name="PLANET-TABLE-GENERATOR" table="PLANET_ID_TABLE" pk-column-name="pk"
value-column-name="value" pk-column-value="1"/>
         <named-query name="PlanetEntryData.getByFeedURL">
             <query>SELECT p FROM PlanetEntryData p WHERE p.subscription.feedURL = ?1</query>
         </named-query>
@@ -46,7 +46,7 @@
         <attributes>
             <id name="id">
                 <column name="id"/>
-                <generated-value strategy="TABLE" generator="ROLLER-TABLE-GENERATOR"/>
+                <generated-value strategy="TABLE" generator="PLANET-TABLE-GENERATOR"/>
             </id>
             <basic name="categoriesString">
                 <column name="categories" insertable="true" updatable="true" unique="false"/>

Modified: incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/pojos/PlanetGroupData.orm.xml
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/pojos/PlanetGroupData.orm.xml?view=diff&rev=509897&r1=509896&r2=509897
==============================================================================
--- incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/pojos/PlanetGroupData.orm.xml
(original)
+++ incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/pojos/PlanetGroupData.orm.xml
Tue Feb 20 21:04:20 2007
@@ -8,10 +8,10 @@
             <access>PROPERTY</access>
         </persistence-unit-defaults>
     </persistence-unit-metadata>
-    <package>org.apache.roller.pojos</package>
+    <package>org.apache.roller.planet.pojos</package>
     <entity metadata-complete="true" name="PlanetGroupData" class="org.apache.roller.planet.pojos.PlanetGroupData">
         <table name="rag_group"/>
-        <table-generator name="ROLLER-TABLE-GENERATOR" table="ROLLER_ID_TABLE" pk-column-name="pk"
value-column-name="value" pk-column-value="1"/>
+        <table-generator name="PLANET-TABLE-GENERATOR" table="PLANET_ID_TABLE" pk-column-name="pk"
value-column-name="value" pk-column-value="1"/>
         <named-query name="PlanetGroupData.getByHandle">
             <query>SELECT p FROM PlanetGroupData p WHERE p.handle = ?1</query>
         </named-query>
@@ -21,7 +21,7 @@
         <attributes>
             <id name="id">
                 <column name="id"/>
-                <generated-value strategy="TABLE" generator="ROLLER-TABLE-GENERATOR"/>
+                <generated-value strategy="TABLE" generator="PLANET-TABLE-GENERATOR"/>
             </id>
             <basic name="categoryRestriction">
                 <column name="cat_restriction" insertable="true" updatable="true" unique="false"/>
@@ -41,6 +41,9 @@
             <basic name="title">
                 <column name="title" insertable="true" updatable="true" unique="false"/>
             </basic>
+            <many-to-one name="planet" target-entity="org.apache.roller.planet.pojos.PlanetData">
+				<join-column name="planet_id" insertable="true" updatable="true" nullable="true"/>
+			</many-to-one>
             <many-to-many name="subscriptions"
                           target-entity="org.apache.roller.planet.pojos.PlanetSubscriptionData"
                           mapped-by="groups"/>

Modified: incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/pojos/PlanetSubscriptionData.orm.xml
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/pojos/PlanetSubscriptionData.orm.xml?view=diff&rev=509897&r1=509896&r2=509897
==============================================================================
--- incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/pojos/PlanetSubscriptionData.orm.xml
(original)
+++ incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/pojos/PlanetSubscriptionData.orm.xml
Tue Feb 20 21:04:20 2007
@@ -8,11 +8,11 @@
             <access>PROPERTY</access>
         </persistence-unit-defaults>
     </persistence-unit-metadata>
-    <package>org.apache.roller.pojos</package>
+    <package>org.apache.roller.planet.pojos</package>
     <entity metadata-complete="true" name="PlanetSubscriptionData"
             class="org.apache.roller.planet.pojos.PlanetSubscriptionData">
         <table name="rag_subscription"/>
-        <table-generator name="ROLLER-TABLE-GENERATOR" table="ROLLER_ID_TABLE" pk-column-name="pk"
value-column-name="value" pk-column-value="1"/>
+        <table-generator name="PLANET-TABLE-GENERATOR" table="PLANET_ID_TABLE" pk-column-name="pk"
value-column-name="value" pk-column-value="1"/>
         <named-query name="PlanetSubscriptionData.getAll">
             <query>SELECT p FROM PlanetSubscriptionData p</query>
         </named-query>
@@ -30,7 +30,7 @@
         <attributes>
             <id name="id">
                 <column name="id"/>
-                <generated-value strategy="TABLE" generator="ROLLER-TABLE-GENERATOR"/>
+                <generated-value strategy="TABLE" generator="PLANET-TABLE-GENERATOR"/>
             </id>
             <basic name="feedURL">
                 <column name="feed_url" insertable="true" updatable="true" unique="false"/>
@@ -61,9 +61,14 @@
                     <inverse-join-column name="group_id"/>
                 </join-table>
             </many-to-many>
+            <one-to-many name="entries" mapped-by="subscription" target-entity="org.apache.roller.planet.pojos.PlanetEntryData"
fetch="LAZY">
+                <cascade>
+                    <cascade-all/>
+                </cascade>
+            </one-to-many>
             <transient name="name"/>
             <transient name="entries"/>
-            <transient name="url"/>
+            <transient name="uRL"/>
         </attributes>
     </entity>
 </entity-mappings>

Modified: incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/pojos/PropertyData.orm.xml
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/pojos/PropertyData.orm.xml?view=diff&rev=509897&r1=509896&r2=509897
==============================================================================
--- incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/pojos/PropertyData.orm.xml
(original)
+++ incubator/roller/branches/roller_4.0/apps/planet/src/java/org/apache/roller/planet/pojos/PropertyData.orm.xml
Tue Feb 20 21:04:20 2007
@@ -11,14 +11,13 @@
     <package>org.apache.roller.planet.pojos</package>
     <entity metadata-complete="true" name="PropertyData"
             class="org.apache.roller.planet.pojos.PropertyData">
-        <table name="roller_properties"/>
-        <named-query name="RollerData.getAll">
+        <table name="rag_properties"/>
+        <named-query name="PropertyData.getAll">
             <query>SELECT r FROM PropertyData r</query>
         </named-query>
         <attributes>
             <id name="name">
                 <column name="name"/>
-                <generated-value strategy="TABLE" generator="ROLLER-TABLE-GENERATOR"/>
             </id>
             <basic name="value">
                 <column name="value" insertable="true" updatable="true" unique="false"/>

Modified: incubator/roller/branches/roller_4.0/apps/planet/src/sql/createdb.vm
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_4.0/apps/planet/src/sql/createdb.vm?view=diff&rev=509897&r1=509896&r2=509897
==============================================================================
--- incubator/roller/branches/roller_4.0/apps/planet/src/sql/createdb.vm (original)
+++ incubator/roller/branches/roller_4.0/apps/planet/src/sql/createdb.vm Tue Feb 20 21:04:20
2007
@@ -9,6 +9,14 @@
 -- *****************************************************
 -- Create the tables and indices
 
+
+create table planet_id_table (
+    pk              int not null primary key,
+    value           int not null
+);
+insert into planet_id_table (pk, value) values (1, 0);
+
+
 create table rag_properties (
     name     varchar(255) not null primary key,
     value    $db.TEXT_SQL_TYPE

Modified: incubator/roller/branches/roller_4.0/apps/planet/testdata/JPAEMF.properties
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_4.0/apps/planet/testdata/JPAEMF.properties?view=diff&rev=509897&r1=509896&r2=509897
==============================================================================
--- incubator/roller/branches/roller_4.0/apps/planet/testdata/JPAEMF.properties (original)
+++ incubator/roller/branches/roller_4.0/apps/planet/testdata/JPAEMF.properties Tue Feb 20
21:04:20 2007
@@ -1,6 +1,5 @@
 toplink.jdbc.driver=org.apache.derby.jdbc.ClientDriver
-toplink.jdbc.url=jdbc:derby://localhost:3219/roller
-#toplink.jdbc.url=jdbc:derby://localhost:1527/roller-jpa
+toplink.jdbc.url=jdbc:derby://localhost:3219/planet
 toplink.jdbc.user=APP
 toplink.jdbc.password=APP
 toplink.logging.level=FINE

Modified: incubator/roller/branches/roller_4.0/apps/planet/testdata/META-INF/persistence.xml
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_4.0/apps/planet/testdata/META-INF/persistence.xml?view=diff&rev=509897&r1=509896&r2=509897
==============================================================================
--- incubator/roller/branches/roller_4.0/apps/planet/testdata/META-INF/persistence.xml (original)
+++ incubator/roller/branches/roller_4.0/apps/planet/testdata/META-INF/persistence.xml Tue
Feb 20 21:04:20 2007
@@ -3,10 +3,11 @@
     <persistence-unit name ="PlanetPU" transaction-type = "RESOURCE_LOCAL">
         <provider>oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider</provider>
         <jta-data-source>jdbc/rollerdb</jta-data-source>
-        <mapping-file>org/apache/roller/planet/pojos/PlanetConfigData.orm.xml</mapping-file>
-        <mapping-file>org/apache/roller/planet/pojos/PlanetEntryData.orm.xml</mapping-file>
+        <mapping-file>org/apache/roller/planet/pojos/PlanetData.orm.xml</mapping-file>
         <mapping-file>org/apache/roller/planet/pojos/PlanetGroupData.orm.xml</mapping-file>
-        <mapping-file>org/apache/roller/planet/pojos/PlanetSubscriptionData.orm.xml</mapping-file>
+        <mapping-file>org/apache/roller/planet/pojos/PropertyData.orm.xml</mapping-file>
+        <mapping-file>org/apache/roller/planet/pojos/PlanetEntryData.orm.xml</mapping-file>
+        <mapping-file>org/apache/roller/planet/pojos/PlanetSubscriptionData.orm.xml</mapping-file>

     </persistence-unit>
     
 </persistence>

Modified: incubator/roller/branches/roller_4.0/apps/planet/testdata/planet.properties
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_4.0/apps/planet/testdata/planet.properties?view=diff&rev=509897&r1=509896&r2=509897
==============================================================================
--- incubator/roller/branches/roller_4.0/apps/planet/testdata/planet.properties (original)
+++ incubator/roller/branches/roller_4.0/apps/planet/testdata/planet.properties Tue Feb 20
21:04:20 2007
@@ -41,8 +41,7 @@
 #    PlanetConfig.getProperty("propname");
 
 # Business layer implementation to be used
-persistence.planet.classname=org.apache.roller.planet.business.hibernate.HibernatePlanetImpl
-#persistence.planet.classname=org.apache.roller.planet.business.jpa.JPAPlanetImpl
+persistence.planet.classname=org.apache.roller.planet.business.datamapper.jpa.JPAPlanetImpl
 
 # You MUST override and set these three properties correctly:
 planet.aggregator.cache.dir=/var/planet/cache

Modified: incubator/roller/branches/roller_4.0/apps/planet/web/WEB-INF/classes/planet.properties
URL: http://svn.apache.org/viewvc/incubator/roller/branches/roller_4.0/apps/planet/web/WEB-INF/classes/planet.properties?view=diff&rev=509897&r1=509896&r2=509897
==============================================================================
--- incubator/roller/branches/roller_4.0/apps/planet/web/WEB-INF/classes/planet.properties
(original)
+++ incubator/roller/branches/roller_4.0/apps/planet/web/WEB-INF/classes/planet.properties
Tue Feb 20 21:04:20 2007
@@ -41,8 +41,7 @@
 #    PlanetConfig.getProperty("propname");
 
 # Business layer implementation to be used
-persistence.planet.classname=\
-org.apache.roller.planet.business.hibernate.HibernatePlanetImpl
+persistence.planet.classname=org.apache.roller.planet.business.datamapper.jpa.JPAPlanetImpl
 
 # choose a url strategy
 urlstrategy.classname=\



Mime
View raw message