roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject svn commit: r487611 - in /incubator/roller/trunk/sandbox/jdobackend: src/org/apache/roller/business/datamapper/ src/org/apache/roller/business/jpa/ src/org/apache/roller/pojos/ web/WEB-INF/classes/
Date Fri, 15 Dec 2006 18:22:57 GMT
Author: clr
Date: Fri Dec 15 10:22:55 2006
New Revision: 487611

URL: http://svn.apache.org/viewvc?view=rev&rev=487611
Log:
Datamapper starts working

Modified:
    incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperRollerImpl.java
    incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperThreadManagerImpl.java
    incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jpa/JPAPersistenceStrategy.java
    incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jpa/JPAQueryImpl.java
    incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/AutoPingData.orm.xml
    incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/BookmarkData.orm.xml
    incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/CommentData.orm.xml
    incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/EntryAttributeData.orm.xml
    incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/FolderData.orm.xml
    incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/HitCountData.orm.xml
    incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/ObjectAuditData.orm.xml
    incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/PermissionsData.orm.xml
    incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/PingCategoryRestrictionData.orm.xml
    incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/PingQueueEntryData.orm.xml
    incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/PingTargetData.orm.xml
    incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/RefererData.orm.xml
    incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/RoleData.orm.xml
    incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/RollerConfigData.orm.xml
    incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/RollerPropertyData.orm.xml
    incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/TaskLockData.orm.xml
    incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/UserData.orm.xml
    incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/WeblogCategoryData.orm.xml
    incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/WeblogEntryData.orm.xml
    incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/WeblogEntryTagAggregateData.orm.xml
    incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/WeblogEntryTagData.orm.xml
    incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/WeblogTemplate.orm.xml
    incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/WebsiteData.orm.xml
    incubator/roller/trunk/sandbox/jdobackend/web/WEB-INF/classes/persistence.xml

Modified: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperRollerImpl.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperRollerImpl.java?view=diff&rev=487611&r1=487610&r2=487611
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperRollerImpl.java
(original)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperRollerImpl.java
Fri Dec 15 10:22:55 2006
@@ -27,6 +27,7 @@
 import org.apache.roller.business.RollerImpl;
 import org.apache.roller.business.UserManager;
 import org.apache.roller.business.WeblogManager;
+import org.apache.roller.business.runnable.ThreadManager;
 import org.apache.roller.business.pings.AutoPingManager;
 import org.apache.roller.business.pings.PingQueueManager;
 import org.apache.roller.business.pings.PingTargetManager;
@@ -56,6 +57,7 @@
     private PingQueueManager pingQueueManager = null;
     private AutoPingManager autoPingManager = null;
     private PingTargetManager pingTargetManager = null;
+    private ThreadManager threadManager = null;
 
     
     protected DatamapperRollerImpl() throws RollerException {
@@ -208,6 +210,21 @@
 
     protected abstract WeblogManager createDatamapperWeblogManager(
             DatamapperPersistenceStrategy strategy);
+
+    /**
+     * @see org.apache.roller.model.Roller#getThreadManager()
+     */
+    public ThreadManager getThreadManager() {
+        if (threadManager == null) {
+            threadManager = createDatamapperThreadManager(strategy);
+        }
+        return threadManager;
+    }
+
+    protected ThreadManager createDatamapperThreadManager(
+            DatamapperPersistenceStrategy strategy) {
+        return new DatamapperThreadManagerImpl(strategy);
+    }
 
     /**
      * This method is deprecated.

Modified: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperThreadManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperThreadManagerImpl.java?view=diff&rev=487611&r1=487610&r2=487611
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperThreadManagerImpl.java
(original)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperThreadManagerImpl.java
Fri Dec 15 10:22:55 2006
@@ -165,14 +165,12 @@
         return locked;
     }
 
-
     private TaskLockData getTaskLockByName(String name) throws RollerException {
-
         // do lookup
-            return (TaskLockData) strategy.newQuery(TaskLockData.class,
-                    "TaskLockData.getByName").setUnique().execute(name);
+        return (TaskLockData) strategy.newQuery(
+                TaskLockData.class, "TaskLockData.getByName").setUnique()
+                .execute(name);
     }
-
 
     private void saveTaskLock(TaskLockData data) throws RollerException {
         this.strategy.store(data);

Modified: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jpa/JPAPersistenceStrategy.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jpa/JPAPersistenceStrategy.java?view=diff&rev=487611&r1=487610&r2=487611
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jpa/JPAPersistenceStrategy.java
(original)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jpa/JPAPersistenceStrategy.java
Fri Dec 15 10:22:55 2006
@@ -69,8 +69,12 @@
     public JPAPersistenceStrategy() throws RollerException {
         Properties emfProps = loadPropertiesFromResourceName(
                 "JPAEMF.properties", getContextClassLoader());
-        this.emf =
+        try {
+            this.emf =
                 Persistence.createEntityManagerFactory("RollerPU", emfProps);
+        } catch (PersistenceException pe) {
+            throw new RollerException(pe);
+        }
     }
 
     /**
@@ -83,7 +87,6 @@
             if (isTransactionActive(em)) {
                 em.getTransaction().commit();
             }
-            em.close();
         } catch (PersistenceException pe) {
             throw new RollerException(pe);
         }

Modified: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jpa/JPAQueryImpl.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jpa/JPAQueryImpl.java?view=diff&rev=487611&r1=487610&r2=487611
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jpa/JPAQueryImpl.java
(original)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jpa/JPAQueryImpl.java
Fri Dec 15 10:22:55 2006
@@ -21,6 +21,7 @@
 
 import javax.persistence.EntityManager;
 import javax.persistence.Query;
+import javax.persistence.NoResultException;
 
 import org.apache.roller.business.datamapper.DatamapperQuery;
 
@@ -91,8 +92,18 @@
      * value of singleResult.
      */
     private Object executeQuery() {
-        return singleResult ? q.getSingleResult() : q.getResultList();
+        Object result = null;
+        if (singleResult) {
+            try {
+                result = q.getSingleResult();
+            } catch (NoResultException e) {
+                // Roller code expects a null for this condition
+                result = null;
+            }
+        } else {
+            result = q.getResultList();
+        }
+        return result;
     }
-
 
 }

Modified: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/AutoPingData.orm.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/AutoPingData.orm.xml?view=diff&rev=487611&r1=487610&r2=487611
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/AutoPingData.orm.xml
(original)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/AutoPingData.orm.xml
Fri Dec 15 10:22:55 2006
@@ -12,6 +12,7 @@
     <entity metadata-complete="true" name="AutoPingData"
             class="org.apache.roller.pojos.AutoPingData">
         <table name="autoping"/>
+        <table-generator name="ROLLER-TABLE-GENERATOR" table="ROLLER_ID_TABLE" pk-column-name="pk"
value-column-name="value" pk-column-value="1"/>
         <named-query name="AutoPingData.getByPingTarget">
             <query>SELECT a FROM AutoPingData a WHERE a.pingTarget = ?1</query>
         </named-query>
@@ -31,6 +32,7 @@
         <attributes>
             <id name="id">
                 <column name="id"/>
+                <generated-value strategy="TABLE" generator="ROLLER-TABLE-GENERATOR"/>
             </id>
             <many-to-one name="website" target-entity="org.apache.roller.pojos.WebsiteData">
                 <join-column name="websiteid" insertable="true" updatable="true" nullable="true"/>

Modified: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/BookmarkData.orm.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/BookmarkData.orm.xml?view=diff&rev=487611&r1=487610&r2=487611
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/BookmarkData.orm.xml
(original)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/BookmarkData.orm.xml
Fri Dec 15 10:22:55 2006
@@ -21,6 +21,7 @@
         <attributes>
             <id name="id">
                 <column name="id"/>
+                <generated-value strategy="TABLE" generator="ROLLER-TABLE-GENERATOR"/>
             </id>
             <basic name="name">
                 <column name="name" insertable="true" updatable="true" unique="false"/>

Modified: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/CommentData.orm.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/CommentData.orm.xml?view=diff&rev=487611&r1=487610&r2=487611
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/CommentData.orm.xml
(original)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/CommentData.orm.xml
Fri Dec 15 10:22:55 2006
@@ -57,6 +57,7 @@
         <attributes>
             <id name="id">
                 <column name="id"/>
+                <generated-value strategy="TABLE" generator="ROLLER-TABLE-GENERATOR"/>
             </id>
             <basic name="name">
                 <column name="name" insertable="true" updatable="true" unique="false"/>

Modified: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/EntryAttributeData.orm.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/EntryAttributeData.orm.xml?view=diff&rev=487611&r1=487610&r2=487611
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/EntryAttributeData.orm.xml
(original)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/EntryAttributeData.orm.xml
Fri Dec 15 10:22:55 2006
@@ -15,6 +15,7 @@
         <attributes>
             <id name="id">
                 <column name="id"/>
+                <generated-value strategy="TABLE" generator="ROLLER-TABLE-GENERATOR"/>
             </id>
             <basic name="name">
                 <column name="name" insertable="true" updatable="true" unique="false"/>

Modified: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/FolderData.orm.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/FolderData.orm.xml?view=diff&rev=487611&r1=487610&r2=487611
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/FolderData.orm.xml
(original)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/FolderData.orm.xml
Fri Dec 15 10:22:55 2006
@@ -20,6 +20,7 @@
         <attributes>
             <id name="id">
                 <column name="id"/>
+                <generated-value strategy="TABLE" generator="ROLLER-TABLE-GENERATOR"/>
             </id>
             <basic name="name">
                 <column name="name" insertable="true" updatable="true" unique="false"/>
@@ -33,7 +34,7 @@
             <many-to-one name="parent" target-entity="org.apache.roller.pojos.FolderData">
                 <join-column name="parentid" insertable="true" updatable="true" nullable="true"/>
             </many-to-one>
-            <one-to-many name="folders" mapped-by="parent" target-entity="org.apache.roller.pojos.FolderData">
+            <one-to-many name="folders" mapped-by="parent" target-entity="org.apache.roller.pojos.FolderData"
 fetch="LAZY">
                 <cascade>
                     <cascade-remove/>
                 </cascade>

Modified: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/HitCountData.orm.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/HitCountData.orm.xml?view=diff&rev=487611&r1=487610&r2=487611
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/HitCountData.orm.xml
(original)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/HitCountData.orm.xml
Fri Dec 15 10:22:55 2006
@@ -26,6 +26,7 @@
         <attributes>
             <id name="id">
                 <column name="id"/>
+                <generated-value strategy="TABLE" generator="ROLLER-TABLE-GENERATOR"/>
             </id>
             <basic name="dailyHits">
                 <column name="dailyhits" insertable="true" updatable="true" unique="false"/>

Modified: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/ObjectAuditData.orm.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/ObjectAuditData.orm.xml?view=diff&rev=487611&r1=487610&r2=487611
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/ObjectAuditData.orm.xml
(original)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/ObjectAuditData.orm.xml
Fri Dec 15 10:22:55 2006
@@ -15,6 +15,7 @@
         <attributes>
             <id name="id">
                 <column name="id"/>
+                <generated-value strategy="TABLE" generator="ROLLER-TABLE-GENERATOR"/>
             </id>
             <basic name="changeTime">
                 <column name="change_time" insertable="true" updatable="true" unique="false"/>

Modified: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/PermissionsData.orm.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/PermissionsData.orm.xml?view=diff&rev=487611&r1=487610&r2=487611
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/PermissionsData.orm.xml
(original)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/PermissionsData.orm.xml
Fri Dec 15 10:22:55 2006
@@ -24,6 +24,7 @@
         <attributes>
             <id name="id">
                 <column name="id"/>
+                <generated-value strategy="TABLE" generator="ROLLER-TABLE-GENERATOR"/>
             </id>
             <basic name="permissionMask">
                 <column name="permission_mask" insertable="true" updatable="true" unique="false"/>

Modified: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/PingCategoryRestrictionData.orm.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/PingCategoryRestrictionData.orm.xml?view=diff&rev=487611&r1=487610&r2=487611
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/PingCategoryRestrictionData.orm.xml
(original)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/PingCategoryRestrictionData.orm.xml
Fri Dec 15 10:22:55 2006
@@ -15,6 +15,7 @@
         <attributes>
             <id name="id">
                 <column name="id"/>
+                <generated-value strategy="TABLE" generator="ROLLER-TABLE-GENERATOR"/>
             </id>
             <many-to-one name="autoping" target-entity="org.apache.roller.pojos.AutoPingData">
                 <join-column name="autopingid" insertable="true" updatable="true" nullable="false"/>

Modified: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/PingQueueEntryData.orm.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/PingQueueEntryData.orm.xml?view=diff&rev=487611&r1=487610&r2=487611
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/PingQueueEntryData.orm.xml
(original)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/PingQueueEntryData.orm.xml
Fri Dec 15 10:22:55 2006
@@ -28,6 +28,7 @@
         <attributes>
             <id name="id">
                 <column name="id"/>
+                <generated-value strategy="TABLE" generator="ROLLER-TABLE-GENERATOR"/>
             </id>
             <basic name="entryTime">
                 <column name="entrytime" insertable="true" updatable="true" unique="false"/>

Modified: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/PingTargetData.orm.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/PingTargetData.orm.xml?view=diff&rev=487611&r1=487610&r2=487611
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/PingTargetData.orm.xml
(original)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/PingTargetData.orm.xml
Fri Dec 15 10:22:55 2006
@@ -24,6 +24,7 @@
         <attributes>
             <id name="id">
                 <column name="id"/>
+                <generated-value strategy="TABLE" generator="ROLLER-TABLE-GENERATOR"/>
             </id>
             <basic name="name">
                 <column name="name" insertable="true" updatable="true" unique="false"/>

Modified: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/RefererData.orm.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/RefererData.orm.xml?view=diff&rev=487611&r1=487610&r2=487611
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/RefererData.orm.xml
(original)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/RefererData.orm.xml
Fri Dec 15 10:22:55 2006
@@ -76,6 +76,7 @@
         <attributes>
             <id name="id">
                 <column name="id"/>
+                <generated-value strategy="TABLE" generator="ROLLER-TABLE-GENERATOR"/>
             </id>
             <basic name="dateString">
                 <column name="datestr" insertable="true" updatable="true" unique="false"/>

Modified: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/RoleData.orm.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/RoleData.orm.xml?view=diff&rev=487611&r1=487610&r2=487611
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/RoleData.orm.xml
(original)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/RoleData.orm.xml
Fri Dec 15 10:22:55 2006
@@ -14,6 +14,7 @@
         <attributes>
             <id name="id">
                 <column name="id"/>
+                <generated-value strategy="TABLE" generator="ROLLER-TABLE-GENERATOR"/>
             </id>
             <basic name="userName">
                 <column name="username" insertable="true" updatable="true" unique="false"/>

Modified: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/RollerConfigData.orm.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/RollerConfigData.orm.xml?view=diff&rev=487611&r1=487610&r2=487611
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/RollerConfigData.orm.xml
(original)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/RollerConfigData.orm.xml
Fri Dec 15 10:22:55 2006
@@ -15,6 +15,7 @@
         <attributes>
             <id name="id">
                 <column name="id"/>
+                <generated-value strategy="TABLE" generator="ROLLER-TABLE-GENERATOR"/>
             </id>
             <basic name="absoluteURL">
                 <column name="absoluteurl" insertable="true" updatable="true" unique="false"/>

Modified: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/RollerPropertyData.orm.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/RollerPropertyData.orm.xml?view=diff&rev=487611&r1=487610&r2=487611
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/RollerPropertyData.orm.xml
(original)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/RollerPropertyData.orm.xml
Fri Dec 15 10:22:55 2006
@@ -18,10 +18,12 @@
         <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"/>
             </basic>
+            <transient name="id"/>
         </attributes>
     </entity>
 </entity-mappings>

Modified: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/TaskLockData.orm.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/TaskLockData.orm.xml?view=diff&rev=487611&r1=487610&r2=487611
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/TaskLockData.orm.xml
(original)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/TaskLockData.orm.xml
Fri Dec 15 10:22:55 2006
@@ -11,25 +11,31 @@
 	<package>org.apache.roller.pojos</package>
 	<entity metadata-complete="true" name="TaskLockData" class="org.apache.roller.pojos.TaskLockData">
 		<table name="roller_tasklock"/>
-		<attributes>
+        <named-query name="TaskLockData.getByName">
+            <query>SELECT t FROM TaskLockData t WHERE t.name = ?1</query>
+        </named-query>
+        <attributes>
 			<id name="id">
 				<column name="id"/>
+				<generated-value strategy="TABLE" generator="ROLLER-TABLE-GENERATOR"/>
 			</id>
 			<basic name="name">
 				<column name="name" insertable="true" updatable="true" unique="true"/>
 			</basic>
 			<basic name="timeAquired">
 				<column name="timeacquired" insertable="true" updatable="true" unique="false"/>
-			</basic>
+                <temporal>TIMESTAMP</temporal>
+            </basic>
 			<basic name="lastRun">
 				<column name="lastrun" insertable="true" updatable="true" unique="false"/>
-			</basic>
+                <temporal>TIMESTAMP</temporal>
+            </basic>
 			<basic name="locked">
 				<column name="islocked" insertable="true" updatable="true" unique="false"/>
 			</basic>
 			<basic name="timeLeased">
 				<column name="timeleased" insertable="true" updatable="true" unique="false"/>
-			</basic>
+            </basic>
 		</attributes>
-	</entity>
+    </entity>
 </entity-mappings>

Modified: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/UserData.orm.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/UserData.orm.xml?view=diff&rev=487611&r1=487610&r2=487611
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/UserData.orm.xml
(original)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/UserData.orm.xml
Fri Dec 15 10:22:55 2006
@@ -81,6 +81,7 @@
         <attributes>
             <id name="id">
                 <column name="id"/>
+                <generated-value strategy="TABLE" generator="ROLLER-TABLE-GENERATOR"/>
             </id>
             <basic name="enabled">
                 <column name="isenabled" insertable="true" updatable="true" unique="false"/>
@@ -108,6 +109,11 @@
                 <column name="timeZone" insertable="true" updatable="true" unique="false"/>
             </basic>
             <one-to-many name="permissions" mapped-by="user" target-entity="org.apache.roller.pojos.PermissionsData"
fetch="LAZY">
+                <cascade>
+                    <cascade-remove/>
+                </cascade>
+            </one-to-many>
+            <one-to-many name="roles" mapped-by="user" target-entity="org.apache.roller.pojos.RoleData"
fetch="LAZY">
                 <cascade>
                     <cascade-remove/>
                 </cascade>

Modified: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/WeblogCategoryData.orm.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/WeblogCategoryData.orm.xml?view=diff&rev=487611&r1=487610&r2=487611
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/WeblogCategoryData.orm.xml
(original)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/WeblogCategoryData.orm.xml
Fri Dec 15 10:22:55 2006
@@ -27,6 +27,7 @@
         <attributes>
             <id name="id">
                 <column name="id"/>
+                <generated-value strategy="TABLE" generator="ROLLER-TABLE-GENERATOR"/>
             </id>
             <basic name="name">
                 <column name="name" insertable="true" updatable="true" unique="false"/>

Modified: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/WeblogEntryData.orm.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/WeblogEntryData.orm.xml?view=diff&rev=487611&r1=487610&r2=487611
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/WeblogEntryData.orm.xml
(original)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/WeblogEntryData.orm.xml
Fri Dec 15 10:22:55 2006
@@ -81,6 +81,7 @@
         <attributes>
             <id name="id">
                 <column name="id"/>
+                <generated-value strategy="TABLE" generator="ROLLER-TABLE-GENERATOR"/>
             </id>
             <basic name="title">
                 <column name="title" insertable="true" updatable="true" unique="false"/>
@@ -139,6 +140,16 @@
             <many-to-one name="creator" target-entity="org.apache.roller.pojos.UserData">
                 <join-column name="userid" insertable="true" updatable="true" nullable="false"/>
             </many-to-one>
+            <one-to-many name="entryAttributes" mapped-by="entry" target-entity="org.apache.roller.pojos.EntryAttributeData"
fetch="LAZY">
+                <cascade>
+                    <cascade-remove/>
+                </cascade>
+            </one-to-many>
+            <one-to-many name="tags" mapped-by="weblogEntry" target-entity="org.apache.roller.pojos.WeblogEntryTagData"
fetch="LAZY">
+                <cascade>
+                    <cascade-remove/>
+                </cascade>
+            </one-to-many>
             <transient name="permaLink"/>
             <transient name="permaLink"/>
             <transient name="commentsLink"/>

Modified: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/WeblogEntryTagAggregateData.orm.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/WeblogEntryTagAggregateData.orm.xml?view=diff&rev=487611&r1=487610&r2=487611
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/WeblogEntryTagAggregateData.orm.xml
(original)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/WeblogEntryTagAggregateData.orm.xml
Fri Dec 15 10:22:55 2006
@@ -85,6 +85,7 @@
         <attributes>
             <id name="id">
                 <column name="id"/>
+                <generated-value strategy="TABLE" generator="ROLLER-TABLE-GENERATOR"/>
             </id>
             <basic name="name">
                 <column name="name" insertable="true" updatable="true" unique="false"/>

Modified: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/WeblogEntryTagData.orm.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/WeblogEntryTagData.orm.xml?view=diff&rev=487611&r1=487610&r2=487611
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/WeblogEntryTagData.orm.xml
(original)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/WeblogEntryTagData.orm.xml
Fri Dec 15 10:22:55 2006
@@ -18,6 +18,7 @@
         <attributes>
             <id name="id">
                 <column name="id"/>
+                <generated-value strategy="TABLE" generator="ROLLER-TABLE-GENERATOR"/>
             </id>
             <basic name="name">
                 <column name="name" insertable="true" updatable="true" unique="false"/>

Modified: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/WeblogTemplate.orm.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/WeblogTemplate.orm.xml?view=diff&rev=487611&r1=487610&r2=487611
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/WeblogTemplate.orm.xml
(original)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/WeblogTemplate.orm.xml
Fri Dec 15 10:22:55 2006
@@ -28,6 +28,7 @@
         <attributes>
             <id name="id">
                 <column name="id"/>
+                <generated-value strategy="TABLE" generator="ROLLER-TABLE-GENERATOR"/>
             </id>
             <basic name="name">
                 <column name="name" insertable="true" updatable="true" unique="false"/>

Modified: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/WebsiteData.orm.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/WebsiteData.orm.xml?view=diff&rev=487611&r1=487610&r2=487611
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/WebsiteData.orm.xml
(original)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/WebsiteData.orm.xml
Fri Dec 15 10:22:55 2006
@@ -11,7 +11,7 @@
     <package>org.apache.roller.pojos</package>
     <entity metadata-complete="true" name="WebsiteData" class="org.apache.roller.pojos.WebsiteData">
         <table name="website"/>
-<!--        <named-query name="WebsiteData.getByHandle&amp;enabled">
+        <named-query name="WebsiteData.getByHandle&amp;enabled">
             <query>SELECT w FROM WebsiteData w WHERE w.handle = ?1 AND w.enabled =
?2</query>
         </named-query>
         <named-query name="WebsiteData.getByHandle">
@@ -88,7 +88,7 @@
         </named-query>
         <named-query name="WebsiteData.getByEndDate&amp;Active&amp;Permissions.user&amp;Permissions.pendingOrderByDateCreatedDesc">
             <query>SELECT w FROM WebsiteData w JOIN w.permissions p WHERE w.dateCreated
&lt; ?1
-                                                 AND w.active ?2
+                                                 AND w.active = ?2
                                                  AND p.user = ?3
                                                  AND p.pending = ?4
                                                ORDER BY w.dateCreated</query>
@@ -112,9 +112,10 @@
         <named-query name="WebsiteData.getCountAllDistinct">
             <query>SELECT COUNT(DISTINCT w) FROM WebsiteData w</query>
         </named-query>
--->        <attributes>
+        <attributes>
             <id name="id">
                 <column name="id"/>
+                <generated-value strategy="TABLE" generator="ROLLER-TABLE-GENERATOR"/>
             </id>
             <basic name="handle">
                 <column name="handle" insertable="true" updatable="true" unique="true"/>

Modified: incubator/roller/trunk/sandbox/jdobackend/web/WEB-INF/classes/persistence.xml
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/web/WEB-INF/classes/persistence.xml?view=diff&rev=487611&r1=487610&r2=487611
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/web/WEB-INF/classes/persistence.xml (original)
+++ incubator/roller/trunk/sandbox/jdobackend/web/WEB-INF/classes/persistence.xml Fri Dec
15 10:22:55 2006
@@ -16,7 +16,8 @@
 	<mapping-file>org/apache/roller/pojos/RoleData.orm.xml                       </mapping-file>
 	<mapping-file>org/apache/roller/pojos/RollerConfigData.orm.xml               </mapping-file>
 	<mapping-file>org/apache/roller/pojos/RollerPropertyData.orm.xml             </mapping-file>
-	<mapping-file>org/apache/roller/pojos/UserData.orm.xml                       </mapping-file>
+    <mapping-file>org/apache/roller/pojos/TaskLockData.orm.xml                   </mapping-file>
+    <mapping-file>org/apache/roller/pojos/UserData.orm.xml                       </mapping-file>
 	<mapping-file>org/apache/roller/pojos/WeblogCategoryData.orm.xml             </mapping-file>
 	<mapping-file>org/apache/roller/pojos/WeblogEntryData.orm.xml                </mapping-file>
 	<mapping-file>org/apache/roller/pojos/WeblogEntryTagData.orm.xml             </mapping-file>



Mime
View raw message