roller-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From snoopd...@apache.org
Subject svn commit: r541458 [7/7] - in /roller/trunk: ./ apps/planet/ apps/planet/nbproject/ apps/planet/src/java/META-INF/ apps/planet/src/java/org/apache/roller/planet/business/ apps/planet/src/java/org/apache/roller/planet/business/hibernate/ apps/planet/sr...
Date Thu, 24 May 2007 22:25:15 GMT
Added: roller/trunk/src/org/apache/roller/pojos/WeblogEntryTagAggregateData.orm.xml
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/pojos/WeblogEntryTagAggregateData.orm.xml?view=auto&rev=541458
==============================================================================
--- roller/trunk/src/org/apache/roller/pojos/WeblogEntryTagAggregateData.orm.xml (added)
+++ roller/trunk/src/org/apache/roller/pojos/WeblogEntryTagAggregateData.orm.xml Thu May 24
15:25:10 2007
@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<entity-mappings version="1.0" xmlns="http://java.sun.com/xml/ns/persistence/orm"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd">
+    <description>Persistence Metadata for Roller</description>
+    <persistence-unit-metadata>
+        <persistence-unit-defaults>
+            <access>PROPERTY</access>
+        </persistence-unit-defaults>
+    </persistence-unit-metadata>
+    <package>org.apache.roller.pojos</package>
+    <entity metadata-complete="true" name="WeblogEntryTagAggregateData"
+            class="org.apache.roller.pojos.WeblogEntryTagAggregateData">
+        <table name="roller_weblogentrytagagg"/>
+        <named-query name="WeblogEntryTagAggregateData.getByName&amp;WebsiteOrderByLastUsedDesc">
+            <query>SELECT w FROM WeblogEntryTagAggregateData w WHERE w.name = ?1 AND
w.weblog = ?2 ORDER BY w.lastUsed DESC</query>
+        </named-query>
+        <named-query name="WeblogEntryTagAggregateData.getByName&amp;WebsiteNullOrderByLastUsedDesc">
+            <query>SELECT w FROM WeblogEntryTagAggregateData w WHERE w.name = ?1 AND
w.weblog IS NULL ORDER BY w.lastUsed DESC</query>
+        </named-query>
+        <named-query name="WeblogEntryTagAggregateData.getNameByNameIn&amp;Website">
+            <!-- <query>SELECT DISTINCT w.name FROM WeblogEntryTagAggregateData
w WHERE w.name IN (?1) AND w.weblog = ?2</query> -->
+            <query>SELECT w.name FROM WeblogEntryTagAggregateData w WHERE w.name IN
(?1) AND w.weblog = ?2</query>
+        </named-query>
+        <named-query name="WeblogEntryTagAggregateData.getNameByNameIn&amp;WebsiteNull">
+            <!-- <query>SELECT DISTINCT w.name FROM WeblogEntryTagAggregateData
w WHERE w.name IN (?1) AND w.weblog IS NULL</query> -->
+            <query>SELECT w.name FROM WeblogEntryTagAggregateData w WHERE w.name IN
(?1) AND w.weblog IS NULL</query>
+        </named-query>
+        <named-query name="WeblogEntryTagAggregateData.getPopularTagsByWebsite&amp;StartDate">
+            <query>SELECT w.name, SUM(w.total) FROM WeblogEntryTagAggregateData w WHERE
w.weblog = ?1 AND w.lastUsed &gt;= ?2 GROUP BY w.name, w.total ORDER BY w.total DESC</query>
+        </named-query>
+        <named-query name="WeblogEntryTagAggregateData.getPopularTagsByWebsite">
+            <query>SELECT w.name, SUM(w.total) FROM WeblogEntryTagAggregateData w WHERE
w.weblog = ?1 GROUP BY w.name, w.total ORDER BY w.total DESC</query>
+        </named-query>
+        <named-query name="WeblogEntryTagAggregateData.getPopularTagsByWebsiteNull&amp;StartDate">
+            <query>SELECT w.name, SUM(w.total) FROM WeblogEntryTagAggregateData w WHERE
w.weblog IS NULL AND w.lastUsed &gt;= ?2 GROUP BY w.name, w.total ORDER BY w.total DESC</query>
+        </named-query>
+        <named-query name="WeblogEntryTagAggregateData.getPopularTagsByWebsiteNull">
+            <query>SELECT w.name, SUM(w.total) FROM WeblogEntryTagAggregateData w WHERE
w.weblog IS NULL GROUP BY w.name, w.total ORDER BY w.total DESC</query>
+        </named-query>
+        <named-query name="WeblogEntryTagAggregateData.getTagsByWebsite&amp;NameStartsWith">
+            <query>SELECT w.name, SUM(w.total) FROM WeblogEntryTagAggregateData w WHERE
w.weblog = ?1 AND w.name LIKE ?2 GROUP BY w.name, w.total </query>
+        </named-query>
+        <named-query name="WeblogEntryTagAggregateData.getTagsByWebsite">
+            <query>SELECT w.name, SUM(w.total) FROM WeblogEntryTagAggregateData w WHERE
w.weblog = ?1 GROUP BY w.name, w.total</query>
+        </named-query>
+        <named-query name="WeblogEntryTagAggregateData.getTagsByWebsiteNull&amp;NameStartsWith">
+            <query>SELECT w.name, SUM(w.total) FROM WeblogEntryTagAggregateData w WHERE
w.weblog IS NULL AND w.name LIKE ?2 GROUP BY w.name, w.total</query>
+        </named-query>
+        <named-query name="WeblogEntryTagAggregateData.getTagsByWebsiteNull">
+            <query>SELECT w.name, SUM(w.total) FROM WeblogEntryTagAggregateData w WHERE
w.weblog IS NULL GROUP BY w.name, w.total</query>
+        </named-query>
+        <named-query name="WeblogEntryTagAggregateData.getTagsByWebsite&amp;NameStartsWithOrderByName">
+            <query>SELECT w.name, SUM(w.total) FROM WeblogEntryTagAggregateData w WHERE
w.weblog = ?1 AND w.name LIKE ?2 GROUP BY w.name, w.total ORDER BY w.name</query>
+        </named-query>
+        <named-query name="WeblogEntryTagAggregateData.getTagsByWebsiteOrderByName">
+            <query>SELECT w.name, SUM(w.total) FROM WeblogEntryTagAggregateData w WHERE
w.weblog = ?1 GROUP BY w.name, w.total ORDER BY w.name</query>
+        </named-query>
+        <named-query name="WeblogEntryTagAggregateData.getTagsByWebsiteNull&amp;NameStartsWithOrderByName">
+            <query>SELECT w.name, SUM(w.total) FROM WeblogEntryTagAggregateData w WHERE
w.weblog IS NULL AND w.name LIKE ?2 GROUP BY w.name, w.total ORDER BY w.name</query>
+        </named-query>
+        <named-query name="WeblogEntryTagAggregateData.getTagsByWebsiteNullOrderByName">
+            <query>SELECT w.name, SUM(w.total) FROM WeblogEntryTagAggregateData w WHERE
w.weblog IS NULL GROUP BY w.name, w.total ORDER BY w.name</query>
+        </named-query>
+        <named-query name="WeblogEntryTagAggregateData.updateAddToTotalByName&amp;Weblog">
+            <query>UPDATE WeblogEntryTagAggregateData w SET w.total = w.total + ?1,
w.lastUsed = ?2 WHERE w.name = ?3 AND w.weblog = ?4</query>
+        </named-query>
+        <named-query name="WeblogEntryTagAggregateData.updateAddToTotalByName&amp;WeblogNull">
+            <query>UPDATE WeblogEntryTagAggregateData w SET w.total = w.total + ?1
WHERE w.name = ?2 AND w.weblog IS NULL</query>
+        </named-query>
+        <named-query name="WeblogEntryTagAggregateData.updateMinusFromTotalByName&amp;WeblogNull">
+            <query>UPDATE WeblogEntryTagAggregateData w SET w.total = w.total - ?1
WHERE w.name = ?2 AND w.weblog IS NULL</query>
+        </named-query>
+        <named-query name="WeblogEntryTagAggregateData.removeByTotalLessEqual">
+            <query>DELETE FROM WeblogEntryTagAggregateData w WHERE w.total &lt;=
?1</query>
+        </named-query>
+        <named-query name="WeblogEntryTagAggregateData.removeByWeblog">
+            <query>DELETE FROM WeblogEntryTagAggregateData w WHERE w.weblog = ?1</query>
+        </named-query>
+
+
+        <attributes>
+            <id name="id">
+                <column name="id"/>
+            </id>
+            <basic name="name">
+                <column name="name" insertable="true" updatable="true" unique="false"/>
+            </basic>
+            <basic name="lastUsed">
+                <column name="lastused" insertable="true" updatable="true" unique="false"/>
+            </basic>
+            <basic name="total">
+                <column name="total" insertable="true" updatable="true" unique="false"/>
+            </basic>
+            <many-to-one name="weblog" target-entity="org.apache.roller.pojos.WebsiteData">
+                <join-column name="websiteid" insertable="true" updatable="true" nullable="true"/>
+            </many-to-one>
+        </attributes>
+    </entity>
+</entity-mappings>

Modified: roller/trunk/src/org/apache/roller/pojos/WeblogEntryTagData.java
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/pojos/WeblogEntryTagData.java?view=diff&rev=541458&r1=541457&r2=541458
==============================================================================
--- roller/trunk/src/org/apache/roller/pojos/WeblogEntryTagData.java (original)
+++ roller/trunk/src/org/apache/roller/pojos/WeblogEntryTagData.java Thu May 24 15:25:10 2007
@@ -23,6 +23,7 @@
 import java.sql.Timestamp;
 import org.apache.commons.lang.builder.EqualsBuilder;
 import org.apache.commons.lang.builder.HashCodeBuilder;
+import org.apache.roller.util.UUIDGenerator;
 
 /**
  * Tag bean.
@@ -37,7 +38,7 @@
     implements java.io.Serializable
 {
     private static final long serialVersionUID = -2602052289337573384L;
-    private java.lang.String id = null;
+    private java.lang.String id = UUIDGenerator.generateUUID();
     private WebsiteData website = null;
     private WeblogEntryData weblogEntry = null;
     private UserData user = null;
@@ -54,7 +55,7 @@
                        UserData user, java.lang.String name,
                        Timestamp time)
     {
-        this.id = id;
+        //this.id = id;
         this.website = website;
         this.weblogEntry = weblogEntry;
         this.user = user;
@@ -73,7 +74,7 @@
      * Unique ID and primary key of this Referer.
      *
      * @roller.wrapPojoMethod type="simple"
-     * @hibernate.id column="id" generator-class="uuid.hex" unsaved-value="null"
+     * @hibernate.id column="id" generator-class="assigned"  
      */
     public java.lang.String getId()
     {

Added: roller/trunk/src/org/apache/roller/pojos/WeblogEntryTagData.orm.xml
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/pojos/WeblogEntryTagData.orm.xml?view=auto&rev=541458
==============================================================================
--- roller/trunk/src/org/apache/roller/pojos/WeblogEntryTagData.orm.xml (added)
+++ roller/trunk/src/org/apache/roller/pojos/WeblogEntryTagData.orm.xml Thu May 24 15:25:10
2007
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<entity-mappings version="1.0" xmlns="http://java.sun.com/xml/ns/persistence/orm"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd">
+    <description>Persistence Metadata for Roller</description>
+    <persistence-unit-metadata>
+        <persistence-unit-defaults>
+            <access>PROPERTY</access>
+        </persistence-unit-defaults>
+    </persistence-unit-metadata>
+    <package>org.apache.roller.pojos</package>
+    <entity metadata-complete="true" name="WeblogEntryTagData"
+            class="org.apache.roller.pojos.WeblogEntryTagData">
+        <table name="roller_weblogentrytag"/>
+        <named-query name="WeblogEntryTagData.getByWeblog">
+            <query>SELECT w FROM WeblogEntryTagData w WHERE w.weblog= ?1</query>
+        </named-query>
+        <attributes>
+            <id name="id">
+                <column name="id"/>
+            </id>
+            <basic name="name">
+                <column name="name" insertable="true" updatable="true" unique="false"/>
+            </basic>
+            <basic name="time">
+                <column name="time" insertable="true" updatable="true" unique="false"/>
+            </basic>
+            <many-to-one name="weblog" target-entity="org.apache.roller.pojos.WebsiteData">
+                <join-column name="websiteid" insertable="true" updatable="true" nullable="false"/>
+            </many-to-one>
+            <many-to-one name="weblogEntry" target-entity="org.apache.roller.pojos.WeblogEntryData">
+                <join-column name="entryid" insertable="true" updatable="true"/>
+            </many-to-one>
+            <many-to-one name="user" target-entity="org.apache.roller.pojos.UserData">
+                <join-column name="userid" insertable="true" updatable="true"/>
+            </many-to-one>
+        </attributes>
+    </entity>
+</entity-mappings>

Modified: roller/trunk/src/org/apache/roller/pojos/WeblogTemplate.java
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/pojos/WeblogTemplate.java?view=diff&rev=541458&r1=541457&r2=541458
==============================================================================
--- roller/trunk/src/org/apache/roller/pojos/WeblogTemplate.java (original)
+++ roller/trunk/src/org/apache/roller/pojos/WeblogTemplate.java Thu May 24 15:25:10 2007
@@ -27,6 +27,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.roller.RollerException;
+import org.apache.roller.util.UUIDGenerator;
 
 
 /**
@@ -48,7 +49,7 @@
     private static Log log = LogFactory.getLog(WeblogTemplate.class);
     private static Set requiredTemplates = null;
     
-    private String  id = null;
+    private String id = UUIDGenerator.generateUUID();
     private String  action = null;
     private String  name = null;
     private String  description = null;
@@ -97,7 +98,7 @@
     /**
      * @ejb:persistent-field
      * @hibernate.id column="id"
-     *  generator-class="uuid.hex" unsaved-value="null"
+     *  generator-class="assigned"  
      */
     public java.lang.String getId() {
         return this.id;
@@ -200,16 +201,19 @@
      * @hibernate.property column="updatetime" non-null="true" unique="false"
      */
     public java.util.Date getLastModified() {
-        return (Date)this.lastModified.clone();
+        // don't modify fields directly
+        //return (Date)this.lastModified.clone();
+        return lastModified;
     }
     
     /** @ejb:persistent-field */
     public void setLastModified(final java.util.Date newtime ) {
-        if (newtime != null) {
-            lastModified = (Date)newtime.clone();
-        } else {
-            lastModified = null;
-        }
+        //if (newtime != null) {
+        //    lastModified = (Date)newtime.clone();
+        //} else {
+        //    lastModified = null;
+        //}
+        lastModified = newtime;
     }
     
     

Added: roller/trunk/src/org/apache/roller/pojos/WeblogTemplate.orm.xml
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/pojos/WeblogTemplate.orm.xml?view=auto&rev=541458
==============================================================================
--- roller/trunk/src/org/apache/roller/pojos/WeblogTemplate.orm.xml (added)
+++ roller/trunk/src/org/apache/roller/pojos/WeblogTemplate.orm.xml Thu May 24 15:25:10 2007
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<entity-mappings version="1.0" xmlns="http://java.sun.com/xml/ns/persistence/orm"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd">
+    <description>Persistence Metadata for Roller</description>
+    <persistence-unit-metadata>
+        <persistence-unit-defaults>
+            <access>PROPERTY</access>
+        </persistence-unit-defaults>
+    </persistence-unit-metadata>
+    <package>org.apache.roller.pojos</package>
+    <entity metadata-complete="true" name="WeblogTemplate"
+            class="org.apache.roller.pojos.WeblogTemplate">
+        <table name="webpage"/>
+        <named-query name="WeblogTemplate.getByWebsite">
+            <query>SELECT w FROM WeblogTemplate w WHERE w.website = ?1</query>
+        </named-query>
+        <named-query name="WeblogTemplate.getByWebsiteOrderByName">
+            <query>SELECT w FROM WeblogTemplate w WHERE w.website = ?1 ORDER BY w.name</query>
+        </named-query>
+        <named-query name="WeblogTemplate.getByWebsite&amp;Link">
+            <query>SELECT w FROM WeblogTemplate w WHERE w.website = ?1 AND w.link =
?2</query>
+        </named-query>
+        <named-query name="WeblogTemplate.getByAction">
+            <query>SELECT w FROM WeblogTemplate w WHERE w.website = ?1 AND w.action
= ?2</query>
+        </named-query>
+        <named-query name="WeblogTemplate.getByWebsite&amp;Name">
+            <query>SELECT w FROM WeblogTemplate w WHERE w.website = ?1 AND w.name=
?2</query>
+        </named-query>
+
+        <attributes>
+            <id name="id">
+                <column name="id"/>
+            </id>
+            <basic name="name">
+                <column name="name" insertable="true" updatable="true" unique="false"/>
+            </basic>
+            <basic name="description">
+                <column name="description" insertable="true" updatable="true" unique="false"/>
+            </basic>
+            <basic name="action">
+                <column name="action" insertable="true" updatable="true" unique="false"/>
+            </basic>
+            <basic name="link">
+                <column name="link" insertable="true" updatable="true" unique="false"/>
+            </basic>
+            <basic name="contents">
+                <column name="template" insertable="true" updatable="true" unique="false"/>
+            </basic>
+            <basic name="lastModified">
+                <column name="updatetime" insertable="true" updatable="true" unique="false"/>
+                <temporal>TIMESTAMP</temporal>
+            </basic>
+            <basic name="templateLanguage">
+                <column name="templatelang" insertable="true" updatable="true" unique="false"/>
+            </basic>
+            <basic name="navbar">
+                <column name="navbar" insertable="true" updatable="true" unique="false"/>
+            </basic>
+            <basic name="hidden">
+                <column name="hidden" insertable="true" updatable="true" unique="false"/>
+            </basic>
+            <basic name="decoratorName">
+                <column name="decorator" insertable="true" updatable="true" unique="false"/>
+            </basic>
+            <basic name="outputContentType">
+                <column name="outputtype" insertable="true" updatable="true" unique="false"/>
+            </basic>
+            <many-to-one name="website" target-entity="org.apache.roller.pojos.WebsiteData">
+                <join-column name="websiteid" insertable="true" updatable="true" nullable="false"/>
+            </many-to-one>
+            <transient name="required"/>
+            
+            <transient name="decorator"/>
+        </attributes>
+    </entity>
+</entity-mappings>

Modified: roller/trunk/src/org/apache/roller/pojos/WebsiteData.java
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/pojos/WebsiteData.java?view=diff&rev=541458&r1=541457&r2=541458
==============================================================================
--- roller/trunk/src/org/apache/roller/pojos/WebsiteData.java (original)
+++ roller/trunk/src/org/apache/roller/pojos/WebsiteData.java Thu May 24 15:25:10 2007
@@ -44,6 +44,7 @@
 import org.apache.roller.business.Roller;
 import org.apache.roller.business.themes.ThemeManager;
 import org.apache.roller.business.WeblogManager;
+import org.apache.roller.util.UUIDGenerator;
 import org.apache.roller.util.I18nUtils;
 
 /**
@@ -64,7 +65,7 @@
     private static Log log = LogFactory.getLog(WebsiteData.class);
     
     // Simple properties
-    private String  id               = null;
+    private String  id               = UUIDGenerator.generateUUID();
     private String  handle           = null;
     private String  name             = null;
     private String  description      = null;
@@ -296,7 +297,7 @@
      * @roller.wrapPojoMethod type="simple"
      * @ejb:persistent-field
      * @hibernate.id column="id"
-     *  generator-class="uuid.hex" unsaved-value="null"
+     *  generator-class="assigned"  
      */
     public String getId() {
         return this.id;

Added: roller/trunk/src/org/apache/roller/pojos/WebsiteData.orm.xml
URL: http://svn.apache.org/viewvc/roller/trunk/src/org/apache/roller/pojos/WebsiteData.orm.xml?view=auto&rev=541458
==============================================================================
--- roller/trunk/src/org/apache/roller/pojos/WebsiteData.orm.xml (added)
+++ roller/trunk/src/org/apache/roller/pojos/WebsiteData.orm.xml Thu May 24 15:25:10 2007
@@ -0,0 +1,261 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<entity-mappings version="1.0" xmlns="http://java.sun.com/xml/ns/persistence/orm"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
+    xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_1_0.xsd">
+	<description>Persistence Metadata for Roller</description>
+	<persistence-unit-metadata>
+		<persistence-unit-defaults>
+			<access>PROPERTY</access>
+		</persistence-unit-defaults>
+	</persistence-unit-metadata>
+	<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">
+			<query>SELECT w FROM WebsiteData w WHERE w.handle = ?1</query>
+		</named-query>
+		<named-query name="WebsiteData.getByHandleOrderByHandle">
+			<query>SELECT w FROM WebsiteData w WHERE w.handle = ?1 ORDER BY w.handle</query>
+		</named-query>
+		<named-query name="WebsiteData.getByLetterOrderByHandle">
+			<query>SELECT w FROM WebsiteData w WHERE UPPER(w.handle) like ?1 ORDER BY w.handle</query>
+		</named-query>
+		<named-query name="WebsiteData.getByEndDate&amp;StartDate&amp;Enabled&amp;Active&amp;Permissions.user&amp;Permissions.pendingOrderByDateCreatedDesc">
+			<query>SELECT w FROM WebsiteData w WHERE w.dateCreated &lt; ?1  AND w.dateCreated
&gt; ?2
+                                                 AND w.enabled = ?3  AND w.active = ?4
+                                                 AND EXISTS (SELECT p from PermissionsData
p where
+                                                         p.website = w
+                                                         AND p.user = ?5
+                                                         AND p.pending = ?6 )
+                                               ORDER BY w.dateCreated DESC</query>
+		</named-query>
+		<named-query name="WebsiteData.getByEndDate&amp;Enabled&amp;Permissions.user&amp;Permissions.pendingOrderByDateCreatedDesc">
+			<query>SELECT w FROM WebsiteData w WHERE w.dateCreated &lt; ?1
+                                                 AND w.enabled = ?2
+                                                 AND EXISTS (SELECT p from PermissionsData
p where
+                                                         p.website = w
+                                                         AND p.user = ?3
+                                                         AND p.pending = ?4 )
+                                             ORDER BY w.dateCreated DESC</query>
+		</named-query>
+		<named-query name="WebsiteData.getByEndDate&amp;StartDate&amp;Permissions.user&amp;Permissions.pendingOrderByDateCreatedDesc">
+			<query>SELECT w FROM WebsiteData w WHERE w.dateCreated &lt; ?1  AND w.dateCreated
&gt; ?2
+                                                AND EXISTS (SELECT p from PermissionsData
p where
+                                                         p.website = w
+                                                         AND p.user = ?3
+                                                         AND p.pending = ?4 )
+                                               ORDER BY w.dateCreated DESC</query>
+		</named-query>
+		<named-query name="WebsiteData.getByEndDate&amp;StartDate&amp;Enabled&amp;ActiveOrderByDateCreatedDesc">
+			<query>SELECT w FROM WebsiteData w WHERE w.dateCreated &lt; ?1 AND w.dateCreated
&gt; ?2
+                                                  AND w.enabled = ?3 AND w.active = ?4
+                                                ORDER BY w.dateCreated DESC</query>
+		</named-query>
+		<named-query name="WebsiteData.getByEndDate&amp;StartDate&amp;EnabledOrderByDateCreatedDesc">
+			<query>SELECT w FROM WebsiteData w WHERE w.dateCreated &lt; ?1 AND w.dateCreated
&gt; ?2
+                                                 AND w.enabled = ?3
+                                               ORDER BY w.dateCreated DESC</query>
+		</named-query>
+		<named-query name="WebsiteData.getByEndDate&amp;StartDateOrderByDateCreatedDesc">
+			<query>SELECT w FROM WebsiteData w WHERE w.dateCreated &lt; ?1 AND w.dateCreated
&gt; ?2
+                                               ORDER BY w.dateCreated DESC</query>
+		</named-query>
+		<named-query name="WebsiteData.getByEndDateOrderByDateCreatedDesc">
+			<query>SELECT w FROM WebsiteData w WHERE w.dateCreated &lt; ?1
+                                               ORDER BY w.dateCreated DESC</query>
+		</named-query>
+		<named-query name="WebsiteData.getByEndDate&amp;StartDate&amp;Enabled&amp;Permissions.user&amp;Permissions.pendingOrderByDateCreatedDesc">
+			<query>SELECT w FROM WebsiteData w WHERE w.dateCreated &lt; ?1 AND w.dateCreated
&gt; ?2
+                                                 AND w.enabled = ?3
+                                                 AND EXISTS (SELECT p from PermissionsData
p where
+                                                         p.website = w
+                                                         AND p.user = ?4
+                                                         AND p.pending = ?5 )
+                                               ORDER BY w.dateCreated DESC</query>
+		</named-query>
+		<named-query name="WebsiteData.getByEndDate&amp;StartDate&amp;Active&amp;Permissions.user&amp;Permissions.pendingOrderByDateCreatedDesc">
+			<query>SELECT w FROM WebsiteData w WHERE w.dateCreated &lt; ?1 AND w.dateCreated
&gt; ?2
+                                                 AND w.active = ?3
+                                                 AND EXISTS (SELECT p from PermissionsData
p where
+                                                            p.website = w
+                                                            AND p.user = ?4
+                                                            AND p.pending = ?5 )
+                                              ORDER BY w.dateCreated DESC</query>
+		</named-query>
+		<named-query name="WebsiteData.getByEndDate&amp;StartDate&amp;ActiveOrderByDateCreatedDesc">
+			<query>SELECT w FROM WebsiteData w WHERE w.dateCreated &lt; ?1 AND w.dateCreated
&gt; ?2
+                                                 AND w.active = ?3
+                                               ORDER BY w.dateCreated DESC</query>
+		</named-query>
+		<named-query name="WebsiteData.getByEndDate&amp;Enabled&amp;Active&amp;Permissions.user&amp;Permissions.pendingOrderByDateCreatedDesc">
+			<query>SELECT w FROM WebsiteData w WHERE w.dateCreated &lt; ?1
+                                                AND w.enabled = ?2 AND w.active = ?3
+                                                AND EXISTS (SELECT p from PermissionsData
p where
+                                                           p.website = w
+                                                           AND p.user = ?4
+                                                           AND p.pending = ?5 )
+                                             ORDER BY w.dateCreated DESC</query>
+		</named-query>
+		<named-query name="WebsiteData.getByEndDate&amp;Enabled&amp;ActiveOrderByDateCreatedDesc">
+			<query>SELECT w FROM WebsiteData w WHERE w.dateCreated &lt; ?1
+                                                 AND w.enabled = ?2 AND w.active = ?3
+                                               ORDER BY w.dateCreated DESC</query>
+		</named-query>
+		<named-query name="WebsiteData.getByEndDate&amp;EnabledOrderByDateCreatedDesc">
+			<query>SELECT w FROM WebsiteData w WHERE w.dateCreated &lt; ?1
+                                                 AND w.enabled = ?2
+                                               ORDER BY w.dateCreated DESC</query>
+		</named-query>
+		<named-query name="WebsiteData.getByEndDate&amp;Active&amp;Permissions.user&amp;Permissions.pendingOrderByDateCreatedDesc">
+			<query>SELECT w FROM WebsiteData w WHERE w.dateCreated &lt; ?1
+                                                AND w.active = ?2
+                                                AND EXISTS (SELECT p from PermissionsData
p where
+                                                        p.website = w
+                                                        AND p.user = ?3
+                                                        AND p.pending = ?4 )</query>
+		</named-query>
+		<named-query name="WebsiteData.getByEndDate&amp;ActiveOrderByDateCreatedDesc">
+			<query>SELECT w FROM WebsiteData w WHERE w.dateCreated &lt; ?1
+                                                 AND w.active = ?2
+                                               ORDER BY w.dateCreated DESC</query>
+		</named-query>
+		<named-query name="WebsiteData.getByEndDate&amp;Permissions.user&amp;Permissions.pendingOrderByDateCreatedDesc">
+			<query>SELECT w FROM WebsiteData w WHERE w.dateCreated &lt; ?1
+                                                AND EXISTS (SELECT p from PermissionsData
p where
+                                                        p.website = w
+                                                        AND p.user = ?2
+                                                        AND p.pending = ?3 )
+                                              ORDER BY w.dateCreated DESC</query>
+		</named-query>
+		<named-query name="WebsiteData.getCountAllDistinct">
+			<!-- DISTINCT is not required here -->
+            <query>SELECT COUNT(w) FROM WebsiteData w</query>
+		</named-query>
+		<named-query name="WebsiteData.getCountByHandleLike">
+			<query>SELECT COUNT(w) FROM WebsiteData w WHERE UPPER(w.handle) like ?1</query>
+		</named-query>
+		<attributes>
+			<id name="id">
+				<column name="id"/>
+			</id>
+			<basic name="handle">
+				<column name="handle" insertable="true" updatable="true" unique="true"/>
+			</basic>
+			<basic name="about">
+				<column name="about" insertable="true" updatable="true" unique="false"/>
+			</basic>
+			<basic name="iconPath">
+				<column name="icon" insertable="true" updatable="true" unique="false"/>
+			</basic>
+			<basic name="name">
+				<column name="name" insertable="true" updatable="true" unique="false"/>
+			</basic>
+			<basic name="description">
+				<column name="description" insertable="true" updatable="true" unique="false"/>
+			</basic>
+			<basic name="defaultPageId">
+				<column name="defaultpageid" insertable="true" updatable="true" unique="false"/>
+			</basic>
+			<basic name="weblogDayPageId">
+				<column name="weblogdayid" insertable="true" updatable="true" unique="false"/>
+			</basic>
+			<basic name="enableBloggerApi">
+				<column name="enablebloggerapi" insertable="true" updatable="true" unique="false"/>
+			</basic>
+			<basic name="editorPage">
+				<column name="editorpage" insertable="true" updatable="true" unique="false"/>
+			</basic>
+			<basic name="blacklist">
+				<column name="blacklist" insertable="true" updatable="true" unique="false"/>
+			</basic>
+			<basic name="allowComments">
+				<column name="allowcomments" insertable="true" updatable="true" unique="false"/>
+			</basic>
+			<basic name="defaultAllowComments">
+				<column name="defaultallowcomments" insertable="true" updatable="true" unique="false"/>
+			</basic>
+			<basic name="defaultCommentDays">
+				<column name="defaultcommentdays" insertable="true" updatable="true" unique="false"/>
+			</basic>
+			<basic name="moderateComments">
+				<column name="commentmod" insertable="true" updatable="true" unique="false"/>
+			</basic>
+			<basic name="emailComments">
+				<column name="emailcomments" insertable="true" updatable="true" unique="false"/>
+			</basic>
+			<basic name="emailFromAddress">
+				<column name="emailfromaddress" insertable="true" updatable="true" unique="false"/>
+			</basic>
+			<basic name="emailAddress">
+				<column name="emailaddress" insertable="true" updatable="true" unique="false"/>
+			</basic>
+			<basic name="editorTheme">
+				<column name="editortheme" insertable="true" updatable="true" unique="false"/>
+			</basic>
+			<basic name="locale">
+				<column name="locale" insertable="true" updatable="true" unique="false"/>
+			</basic>
+			<basic name="timeZone">
+				<column name="timeZone" insertable="true" updatable="true" unique="false"/>
+			</basic>
+			<basic name="dateCreated">
+				<column name="datecreated" insertable="true" updatable="true" unique="false"/>
+				<temporal>TIMESTAMP</temporal>
+			</basic>
+			<basic name="defaultPlugins">
+				<column name="defaultplugins" insertable="true" updatable="true" unique="false"/>
+			</basic>
+			<basic name="entryDisplayCount">
+				<column name="displaycnt" insertable="true" updatable="true" unique="false"/>
+			</basic>
+			<basic name="enabled">
+				<column name="isenabled" insertable="true" updatable="true" unique="false"/>
+			</basic>
+			<basic name="active">
+				<column name="isactive" insertable="true" updatable="true" unique="false"/>
+			</basic>
+			<basic name="lastModified">
+				<column name="lastmodified" insertable="true" updatable="true" unique="false"/>
+				<temporal>TIMESTAMP</temporal>
+			</basic>
+			<basic name="enableMultiLang">
+				<column name="enablemultilang" insertable="true" updatable="true" unique="false"/>
+			</basic>
+			<basic name="showAllLangs">
+				<column name="showalllangs" insertable="true" updatable="true" unique="false"/>
+			</basic>
+			<basic name="pageModels">
+				<column name="pagemodels" insertable="true" updatable="true" unique="false"/>
+			</basic>
+			<basic name="customStylesheetPath">
+				<column name="customstylesheet" insertable="true" updatable="true" unique="false"/>
+			</basic>
+			<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>
+			<many-to-one name="bloggerCategory" target-entity="org.apache.roller.pojos.WeblogCategoryData">
+				<join-column name="bloggercatid" insertable="true" updatable="true"/>
+			</many-to-one>
+			<many-to-one name="defaultCategory" target-entity="org.apache.roller.pojos.WeblogCategoryData">
+				<join-column name="defaultcatid" insertable="true" updatable="true"/>
+			</many-to-one>
+			<one-to-many name="permissions" mapped-by="website" target-entity="org.apache.roller.pojos.PermissionsData"
fetch="LAZY">
+			</one-to-many>
+			<transient name="absoluteURL"/>
+			<transient name="adminUserCount"/>
+			<transient name="commentCount"/>
+			<transient name="commentModerationRequired"/>
+			<transient name="todaysHits"/>
+			<transient name="todaysReferrers"/>
+			<transient name="uRL"/>
+			<transient name="userCount"/>
+            <transient name="defaultPage"/>
+			<transient name="entryCount"/>
+            <transient name="initializedPlugins"/>
+			<transient name="pages"/>
+            <transient name="weblogCategories"/>
+            <transient name="localeInstance"/>
+            <transient name="timeZoneInstance" />
+		</attributes>
+	</entity>
+</entity-mappings>

Added: roller/trunk/testdata/WEB-INF/classes/JPAEMF.properties
URL: http://svn.apache.org/viewvc/roller/trunk/testdata/WEB-INF/classes/JPAEMF.properties?view=auto&rev=541458
==============================================================================
--- roller/trunk/testdata/WEB-INF/classes/JPAEMF.properties (added)
+++ roller/trunk/testdata/WEB-INF/classes/JPAEMF.properties Thu May 24 15:25:10 2007
@@ -0,0 +1,26 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+#  contributor license agreements.  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.  For additional information regarding
+# copyright in this work, please see the NOTICE file in the top level
+# directory of this distribution.
+
+# JPA properties file
+#
+# You can set JPA/Toplink, JPA/OpenJPA and JPA/Hibernate properties in your
+# roller-custom.properties override file. For other JPA implementations set
+# properties here and Roller will pick them up.
+
+# Required properties for using OpenJPA with Roller
+openjpa.IgnoreChanges=true
+openjpa.FlushBeforeQueries=true
+#openjpa.Log=DefaultLevel=WARN, Runtime=INFO, Tool=INFO, SQL=TRACE
\ No newline at end of file

Modified: roller/trunk/testdata/roller-custom.properties
URL: http://svn.apache.org/viewvc/roller/trunk/testdata/roller-custom.properties?view=diff&rev=541458&r1=541457&r2=541458
==============================================================================
--- roller/trunk/testdata/roller-custom.properties (original)
+++ roller/trunk/testdata/roller-custom.properties Thu May 24 15:25:10 2007
@@ -1,6 +1,7 @@
 
-# Uncomment this to use JDO backend
-#persistence.roller.classname=org.apache.roller.business.JDO.JDORollerImpl
+persistence.roller.classname=org.apache.roller.business.jpa.JPARollerImpl
+#persistence.roller.classname=org.apache.roller.business.datamapper.jpa.JPARollerImpl
+#persistence.roller.classname=org.apache.roller.business.hibernate.HibernateRollerImpl
 
 # we don't want to start with any folders/bookmarks for testing
 newuser.blogroll=
@@ -8,7 +9,6 @@
 # we don't want to start with any weblog categories for testing
 newuser.categories=
 
-
 search.index.dir=search-index
 
 database.configurationType=jdbc
@@ -19,9 +19,12 @@
 database.jdbc.password=APP
 hibernate.dialect=org.hibernate.dialect.DerbyDialect
 
+#jdbc.driverClass=com.mysql.jdbc.Driver
+#jdbc.connectionURL=jdbc:mysql://localhost:3306/rollertest
+#jdbc.username=scott
+#jdbc.password=tiger
+#hibernate.dialect=org.hibernate.dialect.MySQLDialect
+#openjpa.jdbc.DBDictionary=mysql(SupportsSubselect=false, SearchStringEscape=\\\\)
+
+openjpa.Log=DefaultLevel=WARN, Runtime=INFO, Tool=INFO, SQL=TRACE
 
-#jdbc.driverClass=org.hsqldb.jdbcDriver
-#jdbc.connectionURL=jdbc:hsqldb:hsql://localhost:3219
-#jdbc.username=sa
-#jdbc.password=
-#hibernate.dialect=org.hibernate.dialect.HSQLDialect

Added: roller/trunk/tools/lib/commons-collections-3.2.jar
URL: http://svn.apache.org/viewvc/roller/trunk/tools/lib/commons-collections-3.2.jar?view=auto&rev=541458
==============================================================================
Binary file - no diff available.

Propchange: roller/trunk/tools/lib/commons-collections-3.2.jar
------------------------------------------------------------------------------
    svn:executable = *

Propchange: roller/trunk/tools/lib/commons-collections-3.2.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: roller/trunk/tools/lib/commons-id-0.1-SNAPSHOT.jar
URL: http://svn.apache.org/viewvc/roller/trunk/tools/lib/commons-id-0.1-SNAPSHOT.jar?view=auto&rev=541458
==============================================================================
Binary file - no diff available.

Propchange: roller/trunk/tools/lib/commons-id-0.1-SNAPSHOT.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: roller/trunk/tools/roller-core/roller-core.jar
URL: http://svn.apache.org/viewvc/roller/trunk/tools/roller-core/roller-core.jar?view=auto&rev=541458
==============================================================================
Binary file - no diff available.

Propchange: roller/trunk/tools/roller-core/roller-core.jar
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: roller/trunk/tools/roller-planet/roller-planet-business.jar
URL: http://svn.apache.org/viewvc/roller/trunk/tools/roller-planet/roller-planet-business.jar?view=diff&rev=541458&r1=541457&r2=541458
==============================================================================
Binary files - no diff available.

Added: roller/trunk/web/WEB-INF/classes/JPAEMF.properties
URL: http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/classes/JPAEMF.properties?view=auto&rev=541458
==============================================================================
--- roller/trunk/web/WEB-INF/classes/JPAEMF.properties (added)
+++ roller/trunk/web/WEB-INF/classes/JPAEMF.properties Thu May 24 15:25:10 2007
@@ -0,0 +1,26 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+#  contributor license agreements.  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.  For additional information regarding
+# copyright in this work, please see the NOTICE file in the top level
+# directory of this distribution.
+
+# JPA properties file
+#
+# You can set JPA/Toplink, JPA/OpenJPA and JPA/Hibernate properties in your
+# roller-custom.properties override file. For other JPA implementations set
+# properties here and Roller will pick them up.
+
+# Required properties for using OpenJPA with Roller
+openjpa.IgnoreChanges=true
+openjpa.FlushBeforeQueries=true
+#openjpa.Log=DefaultLevel=WARN, Runtime=INFO, Tool=INFO, SQL=TRACE

Modified: roller/trunk/web/WEB-INF/classes/planet.properties
URL: http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/classes/planet.properties?view=diff&rev=541458&r1=541457&r2=541458
==============================================================================
--- roller/trunk/web/WEB-INF/classes/planet.properties (original)
+++ roller/trunk/web/WEB-INF/classes/planet.properties Thu May 24 15:25:10 2007
@@ -40,7 +40,7 @@
 # properties in this file are accessed like this ...
 #    PlanetConfig.getProperty("propname");
 
-persistence.planet.classname=org.apache.roller.planet.business.hibernate.HibernateRollerPlanetImpl
+persistence.planet.classname=org.apache.roller.planet.business.jpa.JPAPlanetImpl
 
 # You MUST override and set these three properties correctly:
 cache.dir=/var/planet/cache

Modified: roller/trunk/web/WEB-INF/classes/roller.properties
URL: http://svn.apache.org/viewvc/roller/trunk/web/WEB-INF/classes/roller.properties?view=diff&rev=541458&r1=541457&r2=541458
==============================================================================
--- roller/trunk/web/WEB-INF/classes/roller.properties (original)
+++ roller/trunk/web/WEB-INF/classes/roller.properties Thu May 24 15:25:10 2007
@@ -359,7 +359,9 @@
 #----------------------------------
 # Persistence settings
 
-persistence.roller.classname=org.apache.roller.business.hibernate.HibernateRollerImpl
+#persistence.roller.classname=org.apache.roller.business.hibernate.HibernateRollerImpl
+persistence.roller.classname=org.apache.roller.business.jpa.JPARollerImpl
+
 persistence.filemanager.classname=org.apache.roller.business.FileManagerImpl
 
 #----------------------------------



Mime
View raw message