You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by cl...@apache.org on 2006/12/14 22:12:48 UTC
svn commit: r487352 - in /incubator/roller/trunk/sandbox/jdobackend: custom/
src/org/apache/roller/business/datamapper/
src/org/apache/roller/business/jpa/ src/org/apache/roller/pojos/
web/WEB-INF/classes/
Author: clr
Date: Thu Dec 14 13:12:47 2006
New Revision: 487352
URL: http://svn.apache.org/viewvc?view=rev&rev=487352
Log:
Datamapper JPA ready for testing
Added:
incubator/roller/trunk/sandbox/jdobackend/custom/
incubator/roller/trunk/sandbox/jdobackend/custom/custom-ant.xmlf
incubator/roller/trunk/sandbox/jdobackend/custom/custom-build-business.xmlf
incubator/roller/trunk/sandbox/jdobackend/custom/custom-jars.xmlf
incubator/roller/trunk/sandbox/jdobackend/web/WEB-INF/classes/JDOPMF.properties
incubator/roller/trunk/sandbox/jdobackend/web/WEB-INF/classes/JPAEMF.properties
Modified:
incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperRefererManagerImpl.java
incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jpa/JPAWeblogManagerImpl.java
incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/pojos/CommentData.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/RefererData.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/WebsiteData.orm.xml
incubator/roller/trunk/sandbox/jdobackend/web/WEB-INF/classes/persistence.xml
Added: incubator/roller/trunk/sandbox/jdobackend/custom/custom-ant.xmlf
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/custom/custom-ant.xmlf?view=auto&rev=487352
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/custom/custom-ant.xmlf (added)
+++ incubator/roller/trunk/sandbox/jdobackend/custom/custom-ant.xmlf Thu Dec 14 13:12:47 2006
@@ -0,0 +1,359 @@
+
+<!-- Additional Ant tasks to include in build script -->
+
+
+<!-- ====================================================================== -->
+<!-- Example Netbeans debugging targets -->
+<!-- ====================================================================== -->
+
+<!-- Netbeans debug single class
+-->
+<target name="debug-selected-files" if="netbeans.home" depends="build-tests"
+ description="Debug a Single File">
+ <fail unless="classname">Must set property 'classname'</fail>
+ <antcall target="start-db" />
+ <antcall target="init-db" />
+ <nbjpdastart name="${classname}" addressproperty="jpda.address" transport="dt_socket">
+ <classpath>
+ <path refid="tests.run.path"/>
+ </classpath>
+ </nbjpdastart>
+ <java classname="${classname}" fork="true" dir="${build.tests}">
+ <jvmarg value="-Xdebug"/>
+ <jvmarg value="-Xnoagent"/>
+ <jvmarg value="-Djava.compiler=none"/>
+ <jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
+ <jvmarg value="-Dcatalina.base=${build.tests}"/>
+ <jvmarg value="-Dro.build=${ro.build}"/>
+ <jvmarg value="-Droller.custom.config=${build.tests}/roller-custom.properties"/>
+ <classpath>
+ <path refid="tests.run.path"/>
+ </classpath>
+ </java>
+ <antcall target="stop-db" />
+</target>
+
+<!-- Netbeans debug single test class
+-->
+<target name="test-selected-files" if="netbeans.home" depends="build-tests"
+ description="Test/debug a Single File">
+ <fail unless="classname">Must set property 'classname'</fail>
+ <antcall target="start-db" />
+ <antcall target="init-db" />
+ <nbjpdastart name="junit.textui.TestRunner" addressproperty="jpda.address" transport="dt_socket">
+ <classpath>
+ <path refid="tests.run.path"/>
+ </classpath>
+ </nbjpdastart>
+ <java classname="junit.textui.TestRunner" fork="true" dir="${build.tests}">
+ <arg value="${classname}" />
+ <jvmarg value="-Xdebug"/>
+ <jvmarg value="-Xnoagent"/>
+ <jvmarg value="-Djava.compiler=none"/>
+ <jvmarg value="-Xrunjdwp:transport=dt_socket,address=${jpda.address}"/>
+ <jvmarg value="-Dcatalina.base=${build.tests}"/>
+ <jvmarg value="-Dro.build=${ro.build}"/>
+ <jvmarg value="-Droller.custom.config=${build.tests}/roller-custom.properties"/>
+ <classpath>
+ <path refid="tests.run.path"/>
+ </classpath>
+ </java>
+ <antcall target="stop-db" />
+</target>
+
+<!--
+<target name="debug" depends="compile, deploy" if="netbeans.home" description="Debug Project">
+ <nbjpdaconnect name="${app.name}" host="${jpda.host}" address="${jpda.address}" transport="dt_socket">
+ <classpath refid="${run.classpath}"/>
+ <sourcepath refid="${debug.sourcepath}"/>
+ </nbjpdaconnect>
+ <nbbrowse url="${client.url}"/>
+</target>
+-->
+
+
+<!-- ====================================================================== -->
+<!-- Glassfish deployment example -->
+<!-- ====================================================================== -->
+
+<!-- up to date as of Nov. 17, 2006 -->
+
+<!-- Glassfish targets assume you're runnign with "asant" -->
+
+<target name="deploy-glassfish" depends="stage-webapp">
+ <jar basedir="${build.webapp}" destfile="roller.war" includes="**/**" />
+ <sun-appserv-deploy
+ file="roller.war"
+ passwordfile="${asant.passwordfile}"
+ asinstalldir="${glassfish.home}" />
+</target>
+
+<target name="undeploy-glassfish">
+ <sun-appserv-undeploy
+ file="roller.war"
+ passwordfile="${asant.passwordfile}"
+ asinstalldir="${glassfish.home}" />
+</target>
+
+<target name="redeploy-glassfish" depends="build">
+ <jar basedir="${build.webapp}" destfile="roller.war" includes="**/**" update="yes" />
+ <sun-appserv-update file="roller.war" />
+</target>
+
+
+<!-- ====================================================================== -->
+<!-- Other examples -->
+<!-- ====================================================================== -->
+
+<!-- generate JDO mappings
+<target name="gen-jdomappings" description="XDoclet Generate JDO mappings">
+ <taskdef name="jdodoclet"
+ classname="xdoclet.modules.jdo.JdoDocletTask"
+ classpathref="xdoclet.path" />
+ <jdodoclet
+ destdir="${build.compile_beans}"
+ mergedir="./metadata/xdoclet"
+ excludedtags="@version,@author"
+ addedtags="@xdoclet-generated at ${TODAY}"
+ force="true">
+ <fileset dir="./src" includes="org/roller/pojos/WeblogTemplate.java" />
+ <fileset dir="./src" includes="org/roller/pojos/*Data.java" />
+ <fileset dir="./src" includes="org/roller/pojos/*Assoc.java" />
+ <fileset dir="./src" includes="org/roller/business/*Data.java" />
+ &custom-gen-beans;
+ <jdometadata jdoSpec="2.0" />
+ </jdodoclet>
+</target>
+-->
+
+<!-- Extend the init-hsqldb target to include custom tables
+<target name="init-hsqldb-ex" depends="init-hsqldb" >
+ <sql driver="org.hsqldb.jdbcDriver"
+ url="jdbc:hsqldb:hsql://localhost:3219"
+ userid="sa" password="" onerror="continue"
+ src="./build/roller/WEB-INF/dbscripts/hsql/droptables-planet.sql"
+ classpath="${ro.tools}/buildtime/hsqldb.jar" />
+ <sql driver="org.hsqldb.jdbcDriver"
+ url="jdbc:hsqldb:hsql://localhost:3219"
+ userid="sa" password=""
+ src="./build/roller/WEB-INF/dbscripts/hsql/createdb-planet.sql"
+ classpath="${ro.tools}/buildtime/hsqldb.jar" />
+</target>
+-->
+
+<!--
+<target name="deploy" depends="compile" description="Deploy application to servlet container">
+ <deploy url="${manager.url}"
+ username="${manager.username}"
+ password="${manager.password}"
+ path="${app.path}"
+ localWar="file://${build.home}"/>
+</target>
+-->
+
+<!-- ====================================================================== -->
+<!-- Tomcat deployment example -->
+<!-- ====================================================================== -->
+
+<!-- out of date -->
+
+<target name="deploy-tomcat">
+
+ <!-- Fixup the web.xml so that it is ready for deployment -->
+ <replace file="${staging}/WEB-INF/web.xml"
+ token="<!-- TOMCAT_RESOURCE_REF -->">
+ <replacevalue><![CDATA[
+ <resource-ref>
+ <res-ref-name>jdbc/rollerdb</res-ref-name>
+ <res-type>javax.sql.DataSource</res-type>
+ <res-auth>Container</res-auth>
+ </resource-ref>
+ ]]></replacevalue>
+ </replace>
+ <fixcrlf srcdir="${staging}/WEB-INF" eol="lf" includes="**/*.xml" />
+
+ <!-- ask Tomcat manager to UN-DEPLOY Roller
+ <get src="http://localhost:${catalina.port}/manager/remove?path=/${webapp.name}"
+ dest="remove-out.txt"
+ username="${catalina.username}" password="${catalina.password}" />
+ <loadfile property="remove-out" srcFile="remove-out.txt"/>
+ <echo>${remove-out}</echo> -->
+
+ <!-- copy Roller files to Tomcat directory -->
+ <mkdir dir="${catalina.home}/webapps/${webapp.name}"/>
+ <copy todir="${catalina.home}/webapps/${webapp.name}">
+ <fileset dir="${staging}" includes="**/**"/>
+ </copy>
+
+ <!-- ask Tomcat manager to RE-DEPLOY Roller
+ <get src="http://localhost:${catalina.port}/manager/install?path=/${webapp.name}&war=file://${catalina.home}/webapps/${webapp.name}"
+ dest="install-out.txt"
+ username="${catalina.username}" password="${catalina.password}" />
+ <loadfile property="install-out" srcFile="install-out.txt"/>
+ <echo>${install-out}</echo> -->
+
+</target>
+
+
+<!-- ====================================================================== -->
+<!-- Resin deployment example -->
+<!-- ====================================================================== -->
+
+<!-- out of date -->
+
+<target name="deploy-resin">
+
+ <property name="webapps" value="${resin.home}/webapps"/>
+
+ <replace file="${staging}/WEB-INF/web.xml"
+ token="<!-- RESIN_LOGGER -->">
+ <replacevalue><![CDATA[
+ <access-log href="WEB-INF/logs/access.log" />
+ <stdout-log href="WEB-INF/logs/stdout.log" />
+ <stderr-log href="WEB-INF/logs/error.log" />
+ <resource-ref>
+ <res-ref-name>jdbc/rollerdb</res-ref-name>
+ <res-type>javax.sql.ConnectionPoolDataSource</res-type>
+ <init-param driver-name="org.gjt.mm.mysql.jdbc2.optional.MysqlConnectionPoolDataSource"/>
+ <init-param serverName="localhost"/>
+ <init-param user="${resin.username}"/>
+ <init-param password="${resin.password}"/>
+ <init-param port="3306"/>
+ <init-param databaseName="roller" />
+ </resource-ref>
+ ]]></replacevalue>
+ </replace>
+
+ <replace file="${staging}/WEB-INF/web.xml"
+ token="<!-- RESIN_AUTHENTICATOR -->">
+ <replacevalue><![CDATA[
+ <authenticator>
+ <class-name>com.caucho.http.security.XmlAuthenticator</class-name>
+ <init-param user="${resin.username}:${resin.password}:editor" />
+ </authenticator>
+ ]]></replacevalue>
+ </replace>
+
+ <fixcrlf srcdir="${staging}/WEB-INF" eol="lf" includes="**/*.xml" />
+
+ <copy todir="${staging}">
+ <fileset dir="../docs" includes="**/*.html"/>
+ <fileset dir="../docs" includes="**/*.gif"/>
+ <fileset dir="../docs" includes="**/*.jpg"/>
+ </copy>
+
+ <copy todir="${staging}/WEB-INF" overwrite="yes" >
+ <fileset dir="./resin" includes="velocity.properties"/>
+ <fileset dir="./resin" includes="database.xml"/>
+ </copy>
+
+ <mkdir dir="${webapps}/roller"/>
+ <copy todir="${webapps}/roller">
+ <fileset dir="${staging}" includes="**/**"/>
+ </copy>
+
+</target>
+
+
+<!-- ********************************************************************* -->
+<!-- Remote ISP via FTP deployment -->
+<!-- ********************************************************************* -->
+
+<!-- out of date -->
+
+<target name="deploy-isp">
+
+ <replace file="${staging}/WEB-INF/web.xml"
+ token="<!-- TOMCAT_RESOURCE_REF -->">
+ <replacevalue><![CDATA[
+ <resource-ref>
+ <res-ref-name>jdbc/rollerdb</res-ref-name>
+ <res-type>javax.sql.DataSource</res-type>
+ <res-auth>Container</res-auth>
+ </resource-ref>
+ ]]></replacevalue>
+ </replace>
+
+ <fixcrlf srcdir="${staging}/WEB-INF" eol="lf" includes="**/*.xml" />
+
+ <ftp server="${ftp.host}"
+ remotedir="/public_html"
+ userid="${ftp.username}"
+ password="${ftp.password}"
+ ignoreNoncriticalErrors="yes"
+ depends="yes"
+ verbose="yes">
+ <fileset dir="${staging}">
+
+ <!-- copy everything
+ <include name="**"/>
+ -->
+
+ <!-- copy only code changes -->
+ <exclude name="**/web.xml"/>
+ <exclude name="**/roller-config.xml"/>
+ <exclude name="**/oscache.propertiesl"/>
+ <exclude name="**/log4j.properties"/>
+ <include name="**/*.xml"/>
+ <include name="**/*.vm"/>
+ <include name="**/*.tld"/>
+ <include name="**/*.css"/>
+ <include name="**/*.html"/>
+ <include name="**/*.htm"/>
+ <include name="**/*.jsp"/>
+ <include name="**/*.gif"/>
+ <include name="**/*.png"/>
+ <include name="**/WEB-INF/lib/rollerweb.jar"/>
+ <include name="**/WEB-INF/lib/rollerbeans.jar"/>
+
+ <exclude name="**/newuser.jsp"/>
+
+ </fileset>
+ </ftp>
+</target>
+
+<!-- ********************************************************************* -->
+<!-- Added for DataMapper work Need not checkin -->
+<!-- ********************************************************************* -->
+
+<target name="gen-jpa-mapping" description="Generate JPA mapping files from hiberatem mappings">
+ <xslt basedir="${build.compile.business}/org/apache/roller/pojos" includes="*.hbm.xml"
+ destdir="${build.compile.business}/org/apache/roller/pojos/jpa" style="sandbox/jdobackend/HibernateToJPA.xsl">
+ <xmlcatalog>
+ <dtd publicId="-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ location="sandbox/jdobackend/hibernate-mapping-3.0.dtd"/>
+ </xmlcatalog>
+ <mapper type="glob" from="*.hbm.xml" to="*.orm.xml"/>
+ </xslt>
+
+ <xslt basedir="${build.compile.business}/org/apache/roller/planet/pojos/" includes="*.hbm.xml"
+ destdir="${build.compile.business}/org/apache/roller/planet/pojos/jpa" style="sandbox/jdobackend/HibernateToJPA.xsl">
+ <xmlcatalog>
+ <dtd publicId="-//Hibernate/Hibernate Mapping DTD 3.0//EN"
+ location="sandbox/jdobackend/hibernate-mapping-3.0.dtd"/>
+ </xmlcatalog>
+ <mapper type="glob" from="*.hbm.xml" to="*.orm.xml"/>
+ </xslt>
+
+</target>
+
+ <!-- enhance persistent classes for use with JDO -->
+<target name="jdo-enhance">
+ <java classname="org.jpox.enhancer.JPOXEnhancer" fork="true">
+ <classpath>
+ <path location="${basedir}/sandbox/jdobackend/lib/jpox-enhancer-1.1.0.jar"/>
+ <path location="${basedir}/sandbox/jdobackend/lib/jpox-1.1.0.jar"/>
+ <path location="${basedir}/sandbox/jdobackend/lib/bcel-5.1.jar"/>
+ <path location="${basedir}/sandbox/jdobackend/lib/jdo2-api-2.0.jar"/>
+ <path location="${ro.tools}/lib/log4j-1.2.11.jar"/>
+ <fileset refid="commons.jars" />
+ <path location="${ro.tools}/lib/rome-0.8.jar"/>
+ <path location="${build.compile.business}"/>
+ </classpath>
+ <arg value="-v"/>
+ <arg file="${build.compile.business}/package.jdo"/>
+ </java>
+</target>
+
+<target name="debug-ant">
+</target>
\ No newline at end of file
Added: incubator/roller/trunk/sandbox/jdobackend/custom/custom-build-business.xmlf
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/custom/custom-build-business.xmlf?view=auto&rev=487352
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/custom/custom-build-business.xmlf (added)
+++ incubator/roller/trunk/sandbox/jdobackend/custom/custom-build-business.xmlf Thu Dec 14 13:12:47 2006
@@ -0,0 +1,47 @@
+
+<!-- Do custom build work for business layer -->
+
+<!-- EXAMPLE: compile jdobackend from sandbox -->
+<echo>Entering custom build for Datamapper.....</echo>
+<javac destdir="${build.compile.business}"
+ debug="${build.debug}"
+ source="${build.sourcelevel}"
+ deprecation="${build.deprecation}">
+
+ <src path="sandbox/jdobackend/src" />
+
+ <classpath>
+ <path refid="business.path"/>
+ <fileset dir="${build.lib}" includes="*.jar" />
+ &custom-jars;
+ </classpath>
+
+</javac>
+
+<echo>Copying *orm.xml.....</echo>
+<copy todir="${build.compile.business}/org/apache/roller/pojos">
+ <fileset dir="${basedir}/sandbox/jdobackend/src/org/apache/roller/pojos">
+ <include name = "*.orm.xml"/>
+ </fileset>
+</copy>
+
+<echo>Copying persistence.xml.....</echo>
+<mkdir dir="${build.compile.business}/META-INF"/>
+<copy todir="${build.compile.business}/META-INF" file="${basedir}/sandbox/jdobackend/web/WEB-INF/classes/persistence.xml">
+</copy>
+
+<!--
+ copy package.jdo, package.orm, jdo.properties
+ Above files in sandbox/jdobackend/web should get into ${ro.src}
+ Once that happnes, the copy below is not required
+-->
+<copy todir="${build.compile.business}" verbose="true">
+ <fileset dir="${basedir}/sandbox/jdobackend/web/WEB-INF/classes"
+ includes = "jdo.properties package.jdo package.orm JDOPMF.properties JPAEMF.properties"/>
+</copy>
+
+<!-- enhance the data classes -->
+<!-- <antcall target="jdo-enhance" /> -->
+
+<echo>Leaving custom build for Datamapper.....</echo>
+
Added: incubator/roller/trunk/sandbox/jdobackend/custom/custom-jars.xmlf
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/custom/custom-jars.xmlf?view=auto&rev=487352
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/custom/custom-jars.xmlf (added)
+++ incubator/roller/trunk/sandbox/jdobackend/custom/custom-jars.xmlf Thu Dec 14 13:12:47 2006
@@ -0,0 +1,5 @@
+
+<!-- Custom jars added to Roller's standard set -->
+
+<!-- EXAMPLE: jdobackend libraries -->
+<fileset dir="${basedir}/sandbox/jdobackend/lib" includes="*.jar" />
Modified: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperRefererManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperRefererManagerImpl.java?view=diff&rev=487352&r1=487351&r2=487352
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperRefererManagerImpl.java (original)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/datamapper/DatamapperRefererManagerImpl.java Thu Dec 14 13:12:47 2006
@@ -340,10 +340,10 @@
public List getReferersToEntry(String entryid) throws RollerException {
if (null == entryid)
throw new RollerException("entryid is null");
-
+ //TODO: DataMapperPort: Change calling code to pass WebLogEntryData instead of id
return (List) strategy.newQuery(RefererData.class,
- "RefererData.getByEntryId&TitleNotNull&ExcerptNotNullOrderByTotalHitsDesc").
- execute(entryid);
+ "RefererData.getByWeblogEntry&TitleNotNull&ExcerptNotNullOrderByTotalHitsDesc").
+ execute(strategy.load(WeblogEntryData.class,entryid));
}
/**
Modified: incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jpa/JPAWeblogManagerImpl.java
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jpa/JPAWeblogManagerImpl.java?view=diff&rev=487352&r1=487351&r2=487352
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jpa/JPAWeblogManagerImpl.java (original)
+++ incubator/roller/trunk/sandbox/jdobackend/src/org/apache/roller/business/jpa/JPAWeblogManagerImpl.java Thu Dec 14 13:12:47 2006
@@ -124,9 +124,9 @@
}
if (sortby != null && sortby.equals("updateTime")) {
- queryString.append("ORDER BY updateTime ");
+ queryString.append("ORDER BY e.updateTime ");
} else {
- queryString.append("ORDER BY pubTime ");
+ queryString.append("ORDER BY e.pubTime ");
}
if (sortOrder != null && sortOrder.equals(ASCENDING)) {
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=487352&r1=487351&r2=487352
==============================================================================
--- 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 Thu Dec 14 13:12:47 2006
@@ -18,40 +18,40 @@
<query>SELECT COUNT(DISTINCT c) FROM CommentData c WHERE c.weblogEntry.website = ?1</query>
</named-query>
<named-query name="CommentData.getMostCommentedWebsiteByEndDate">
- <query>SELECT COUNT(DISTINCT c), c.weblogEntry.website.id, c.weblogEntry.website.name, c.weblogEntry.website.description
+ <query>SELECT COUNT(DISTINCT c), c.weblogEntry.website.id, c.weblogEntry.website.handle, c.weblogEntry.website.name
FROM CommentData c WHERE c.weblogEntry.pubTime < ?1
- GROUP BY c.weblogEntry.website.id, c.weblogEntry.website.name, c.weblogEntry.website.description
+ GROUP BY c.weblogEntry.website.id, c.weblogEntry.website.handle, c.weblogEntry.website.name
</query>
</named-query>
<named-query name="CommentData.getMostCommentedWebsiteByEndDate&StartDate">
- <query>SELECT COUNT(DISTINCT c), c.weblogEntry.website.id, c.weblogEntry.website.name, c.weblogEntry.website.description
+ <query>SELECT COUNT(DISTINCT c), c.weblogEntry.website.id, c.weblogEntry.website.handle, c.weblogEntry.website.name
FROM CommentData c WHERE c.weblogEntry.pubTime < ?1 AND c.weblogEntry.pubTime > ?2
- GROUP BY c.weblogEntry.website.id, c.weblogEntry.website.name, c.weblogEntry.website.description
+ GROUP BY c.weblogEntry.website.id, c.weblogEntry.website.handle, c.weblogEntry.website.name
</query>
</named-query>
<named-query name="CommentData.getMostCommentedWeblogEntryByEndDate">
- <query>SELECT COUNT(DISTINCT c), c.weblogEntry.website.id, c.weblogEntry.website.anchor, c.weblogEntry.website.title
+ <query>SELECT COUNT(DISTINCT c), c.weblogEntry.website.handle, c.weblogEntry.anchor, c.weblogEntry.title
FROM CommentData c WHERE c.weblogEntry.pubTime < ?1
- GROUP BY c.weblogEntry.website.id, c.weblogEntry.website.anchor, c.weblogEntry.website.title
+ GROUP BY c.weblogEntry.website.handle, c.weblogEntry.anchor, c.weblogEntry.title
</query>
</named-query>
<named-query name="CommentData.getMostCommentedWeblogEntryByEndDate&StartDate">
- <query>SELECT COUNT(DISTINCT c), c.weblogEntry.website.id, c.weblogEntry.website.anchor, c.weblogEntry.website.title
+ <query>SELECT COUNT(DISTINCT c), c.weblogEntry.website.handle, c.weblogEntry.anchor, c.weblogEntry.title
FROM CommentData c WHERE c.weblogEntry.pubTime < ?1 AND c.weblogEntry.pubTime > ?2
- GROUP BY c.weblogEntry.website.id, c.weblogEntry.website.anchor, c.weblogEntry.website.title
+ GROUP BY c.weblogEntry.website.handle, c.weblogEntry.anchor, c.weblogEntry.title
</query>
</named-query>
<named-query name="CommentData.getMostCommentedWeblogEntryByWebsite&EndDate">
- <query>SELECT COUNT(DISTINCT c), c.weblogEntry.website.id, c.weblogEntry.website.anchor, c.weblogEntry.website.title
- FROM CommentData c WHERE c.weblogEntry.website = ? 1 AND c.weblogEntry.pubTime < ?2
- GROUP BY c.weblogEntry.website.id, c.weblogEntry.website.anchor, c.weblogEntry.website.title
+ <query>SELECT COUNT(DISTINCT c), c.weblogEntry.website.handle, c.weblogEntry.anchor, c.weblogEntry.title
+ FROM CommentData c WHERE c.weblogEntry.website = ?1 AND c.weblogEntry.pubTime < ?2
+ GROUP BY c.weblogEntry.website.handle, c.weblogEntry.anchor, c.weblogEntry.title
</query>
</named-query>
<named-query name="CommentData.getMostCommentedWeblogEntryByWebsite&EndDate&StartDate">
- <query>SELECT COUNT(DISTINCT c), c.weblogEntry.website.id, c.weblogEntry.website.anchor, c.weblogEntry.website.title
- FROM CommentData c WHERE c.weblogEntry.website = ? 1
+ <query>SELECT COUNT(DISTINCT c), c.weblogEntry.website.handle, c.weblogEntry.anchor, c.weblogEntry.title
+ FROM CommentData c WHERE c.weblogEntry.website = ?1
AND c.weblogEntry.pubTime < ?2 AND c.weblogEntry.pubTime > ?3
- GROUP BY c.weblogEntry.website.id, c.weblogEntry.website.anchor, c.weblogEntry.website.title
+ GROUP BY c.weblogEntry.website.handle, c.weblogEntry.anchor, c.weblogEntry.title
</query>
</named-query>
<attributes>
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=487352&r1=487351&r2=487352
==============================================================================
--- 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 Thu Dec 14 13:12:47 2006
@@ -38,7 +38,8 @@
<cascade-remove/>
</cascade>
</one-to-many>
- <one-to-many name="bookmarks" mapped-by="folder" target-entity="org.apache.roller.pojos.BookmarkData" order-by="name">
+ <one-to-many name="bookmarks" mapped-by="folder" target-entity="org.apache.roller.pojos.BookmarkData" fetch="LAZY">
+ <order-by>name</order-by>
<cascade>
<cascade-remove/> <!--cascade="all-delete-orphan" -->
</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=487352&r1=487351&r2=487352
==============================================================================
--- 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 Thu Dec 14 13:12:47 2006
@@ -16,12 +16,12 @@
</named-query>
<named-query name="HitCountData.getByWeblogEnabledTrueAndActiveTrue&DailyHitsGreaterZero&WeblogLastModifiedGreaterOrderByDailyHitsDesc">
<query>SELECT h FROM HitCountData h WHERE h.weblog.enabled = true AND h.weblog.active = true
- AND h.weblog.lastModified > ?1 AND h.dailyhits > 0
- ORDER BY h.dailyhits DESC
+ AND h.weblog.lastModified > ?1 AND h.dailyHits > 0
+ ORDER BY h.dailyHits DESC
</query>
- <named-query name="HitCountData.updateDailyHitCountZero">
- <query>UPDATE HitCountData h SET h.dailyHits = 0</query>
- </named-query>
+ </named-query>
+ <named-query name="HitCountData.updateDailyHitCountZero">
+ <query>UPDATE HitCountData h SET h.dailyHits = 0</query>
</named-query>
<attributes>
<id name="id">
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=487352&r1=487351&r2=487352
==============================================================================
--- 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 Thu Dec 14 13:12:47 2006
@@ -11,8 +11,8 @@
<package>org.apache.roller.pojos</package>
<entity metadata-complete="true" name="RefererData" class="org.apache.roller.pojos.RefererData">
<table name="referer"/>
- <named-query name="RefererData.getByEntryId&TitleNotNull&EcerptNotNullOrderByTotalHitsDesc">
- <query>SELECT r FROM RefererData r WHERE r.entryId = ?1 AND r.title NOT NULL AND r.ecerpt NOT NULL
+ <named-query name="RefererData.getByWeblogEntry&TitleNotNull&EcerptNotNullOrderByTotalHitsDesc">
+ <query>SELECT r FROM RefererData r WHERE r.weblogEntry = ?1 AND r.title IS NOT NULL AND r.excerpt IS NOT NULL
ORDER BY r.totalHits DESC</query>
</named-query>
<named-query name="RefererData.getByWeblogEntry">
@@ -35,14 +35,14 @@
<query>SELECT r FROM RefererData r WHERE r.website = ?1 AND r.dateString = ?2 AND r.refererPermalink = ?3</query>
</named-query>
<named-query name="RefererData.getByWebsite&RefererURL">
- <query>SELECT r FROM RefererData r WHERE r.website = ?1 AND r.refererURL = ?2</query>
+ <query>SELECT r FROM RefererData r WHERE r.website = ?1 AND r.refererUrl = ?2</query>
</named-query>
<named-query name="RefererData.getByWebsite&RequestURL&RefererURL">
- <query>SELECT r FROM RefererData r WHERE r.website = ?1 AND r.requestURL = ?2 AND r.refererURL = ?3</query>
+ <query>SELECT r FROM RefererData r WHERE r.website = ?1 AND r.requestUrl = ?2 AND r.refererUrl = ?3</query>
</named-query>
<named-query name="RefererData.getByWebsite&RequestURL&TitleOrExcerpt">
- <query>SELECT r FROM RefererData r WHERE r.website = ?1 AND r.requestURL = ?2
- AND (r.title = ?3 OR r.Excerpt = ?4)</query>
+ <query>SELECT r FROM RefererData r WHERE r.website = ?1 AND r.requestUrl = ?2
+ AND (r.title = ?3 OR r.excerpt = ?4)</query>
</named-query>
<named-query name="RefererData.getHotWeblogsByWebsite.enabled&Website.active&Website.lastModifiedGreater">
<query>SELECT COUNT(DISTINCT r), r.website.id, r.website.name, r.website.handle
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=487352&r1=487351&r2=487352
==============================================================================
--- 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 Thu Dec 14 13:12:47 2006
@@ -30,7 +30,7 @@
<query>SELECT u FROM UserData u WHERE u.enabled = ?1 AND u.dateCreated < ?2 AND u.dateCreated > ?3 ORDER BY u.dateCreated DESC</query>
</named-query>
<named-query name="UserData.getByEnabled&Permissions.website">
- <query>SELECT u FROM UserData u WHERE u.enabled = ?1 AND u.permissions.website = ?2</query>
+ <query>SELECT u FROM UserData u JOIN u.permissions p WHERE u.enabled = ?1 AND p.website = ?2</query>
</named-query>
<named-query name="UserData.getByEnabled&UserNameOrEmailAddressStartsWith">
<query>SELECT u FROM UserData u WHERE u.enabled = ?1 AND (u.userName LIKE ?2 OR u.emailAddress LIKE ?2)</query>
@@ -54,15 +54,15 @@
<query>SELECT u FROM UserData u WHERE u.userName= ?1 ORDER BY u.userName</query>
</named-query>
<named-query name="UserData.getByPermissions.website">
- <query>SELECT u FROM UserData u WHERE u.permissions.website = ?1</query>
+ <query>SELECT u FROM UserData u JOIN u.permissions p WHERE p.website = ?1</query>
</named-query>
<named-query name="UserData.getByPermissions.website&Enabled&EndDate&StartDate">
- <query>SELECT u FROM UserData u WHERE u.permissions.website = ?1 AND u.enabled = ?2
+ <query>SELECT u FROM UserData u JOIN u.permissions p WHERE p.website = ?1 AND u.enabled = ?2
AND u.dateCreated < ?3 AND u.dateCreated > ?4
</query>
</named-query>
<named-query name="UserData.getByPermissions.website&EndDate&StartDate">
- <query>SELECT u FROM UserData u WHERE u.permissions.website = ?1
+ <query>SELECT u FROM UserData u JOIN u.permissions p WHERE p.website = ?1
AND u.dateCreated < ?2 AND u.dateCreated > ?3
</query>
</named-query>
@@ -76,7 +76,7 @@
<query>SELECT COUNT(u) FROM UserData u WHERE UPPER(u.userName) LIKE ?1</query>
</named-query>
<named-query name="UserData.getCountEnabledDistinct">
- <query>SELECT COUNT(DISTINCT u) FROM UserData WHERE u.enabled = ?1</query>
+ <query>SELECT COUNT(DISTINCT u) FROM UserData u WHERE u.enabled = ?1</query>
</named-query>
<attributes>
<id name="id">
@@ -107,6 +107,11 @@
<basic name="timeZone">
<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>
</attributes>
</entity>
</entity-mappings>
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=487352&r1=487351&r2=487352
==============================================================================
--- 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 Thu Dec 14 13:12:47 2006
@@ -46,7 +46,7 @@
<many-to-one name="parent" target-entity="org.apache.roller.pojos.WeblogCategoryData">
<join-column name="parentid" insertable="true" updatable="true" nullable="true"/>
</many-to-one>
- <one-to-many name="weblogCategories" mapped-by="parent" target-entity="org.apache.roller.pojos.WeblogCategoryData">
+ <one-to-many name="weblogCategories" mapped-by="parent" target-entity="org.apache.roller.pojos.WeblogCategoryData" fetch="LAZY">
<cascade>
<cascade-remove/>
</cascade>
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=487352&r1=487351&r2=487352
==============================================================================
--- 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 Thu Dec 14 13:12:47 2006
@@ -16,53 +16,53 @@
<query>SELECT w FROM WeblogEntryData w WHERE w.category = ?1</query>
</named-query>
<named-query name="WeblogEntryData.getByCategory.pathLike&Website">
- <query>SELECT w FROM WeblogEntryData w WHERE w.path LIKE '?1%' AND w.website = ?2</query>
+ <query>SELECT w FROM WeblogEntryData w WHERE w.category.path LIKE '?1%' AND w.website = ?2</query>
</named-query>
<named-query name="WeblogEntryData.getByPinnedToMainOrderByPubTimeDesc">
- <query>SELECT w FROM WeblogEntryData w WHERE w.pinnedToMain = ?1 ORDER BY w.pubtime DESC</query>
+ <query>SELECT w FROM WeblogEntryData w WHERE w.pinnedToMain = ?1 ORDER BY w.pubTime DESC</query>
</named-query>
<named-query name="WeblogEntryData.getByWebsite&Status&PubTimeGreaterThen&CategoryOrderByPubTimeAsc">
<query>SELECT w FROM WeblogEntryData w WHERE w.website = ?1 AND w.status = ?2 AND w.pubTime > ?3 AND w.category = ?4
- ORDER BY w.pubtime ASC</query>
+ ORDER BY w.pubTime ASC</query>
</named-query>
<named-query name="WeblogEntryData.getByWebsite&Status&PubTimeGreaterThen&Category&LocaleLikeOrderByPubTimeAsc">
<query>SELECT w FROM WeblogEntryData w WHERE w.website = ?1 AND w.status = ?2 AND w.pubTime > ?3 AND w.category = ?4
AND UPPER(w.locale) LIKE '?5%'
- ORDER BY w.pubtime ASC</query>
+ ORDER BY w.pubTime ASC</query>
</named-query>
<named-query name="WeblogEntryData.getByWebsite&Status&PubTimeGreaterThenOrderByPubTimeAsc">
<query>SELECT w FROM WeblogEntryData w WHERE w.website = ?1 AND w.status = ?2 AND w.pubTime > ?3
- ORDER BY w.pubtime ASC</query>
+ ORDER BY w.pubTime ASC</query>
</named-query>
<named-query name="WeblogEntryData.getByWebsite&Status&PubTimeGreaterThen&LocaleLikeOrderByPubTimeAsc">
<query>SELECT w FROM WeblogEntryData w WHERE w.website = ?1 AND w.status = ?2 AND w.pubTime > ?3
AND UPPER(w.locale) LIKE '?4%'
- ORDER BY w.pubtime ASC</query>
+ ORDER BY w.pubTime ASC</query>
</named-query>
<named-query name="WeblogEntryData.getByWebsite&Status&PubTimeLessEqualOrderByPubTimeDesc">
<query>SELECT w FROM WeblogEntryData w WHERE w.website = ?1 AND w.status = ?2 AND w.pubTime <= ?3
- ORDER BY w.pubtime DESC</query>
+ ORDER BY w.pubTime DESC</query>
</named-query>
<named-query name="WeblogEntryData.getByWebsite&Status&PubTimeLessEqual&CategoryOrderByPubTimeDesc">
<query>SELECT w FROM WeblogEntryData w WHERE w.website = ?1 AND w.status = ?2 AND w.pubTime <= ?3 AND w.category = ?4
- ORDER BY w.pubtime DESC</query>
+ ORDER BY w.pubTime DESC</query>
</named-query>
<named-query name="WeblogEntryData.getByWebsite&Status&PubTimeLessEqual&Category&LocaleLikeOrderByPubTimeDesc">
<query>SELECT w FROM WeblogEntryData w WHERE w.website = ?1 AND w.status = ?2 AND w.pubTime <= ?3 AND w.category = ?4
AND UPPER(w.locale) LIKE '?5%'
- ORDER BY w.pubtime DESC</query>
+ ORDER BY w.pubTime DESC</query>
</named-query>
<named-query name="WeblogEntryData.getByWebsite&Status&PubTimeLessThenOrderByPubTimeDesc">
<query>SELECT w FROM WeblogEntryData w WHERE w.website = ?1 AND w.status = ?2 AND w.pubTime < ?3
- ORDER BY w.pubtime DESC</query>
+ ORDER BY w.pubTime DESC</query>
</named-query>
<named-query name="WeblogEntryData.getByWebsite&Status&PubTimeLessThen&LocaleLikeOrderByPubTimeDesc">
<query>SELECT w FROM WeblogEntryData w WHERE w.website = ?1 AND w.status = ?2 AND w.pubTime < ?3
AND UPPER(w.locale) LIKE '?4%'
- ORDER BY w.pubtime DESC</query>
+ ORDER BY w.pubTime DESC</query>
</named-query>
<named-query name="WeblogEntryData.getByWeblogEntry&Anchor">
- <query>SELECT w FROM WeblogEntryData w WHERE w.weblogEntry = ?1 AND w.anchor = ?2</query>
+ <query>SELECT w FROM WeblogEntryData w WHERE w.website = ?1 AND w.anchor = ?2</query>
</named-query>
<named-query name="WeblogEntryData.getByWebsite">
<query>SELECT w FROM WeblogEntryData w WHERE w.website = ?1</query>
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=487352&r1=487351&r2=487352
==============================================================================
--- 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 Thu Dec 14 13:12:47 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&enabled">
+<!-- <named-query name="WebsiteData.getByHandle&enabled">
<query>SELECT w FROM WebsiteData w WHERE w.handle = ?1 AND w.enabled = ?2</query>
</named-query>
<named-query name="WebsiteData.getByHandle">
@@ -24,15 +24,15 @@
<query>SELECT w FROM WebsiteData w WHERE w.handle = ?1 ORDER BY w.handle</query>
</named-query>
<named-query name="WebsiteData.getByEndDate&StartDate&Enabled&Active&Permissions.user&Permissions.pendingOrderByDateCreatedDesc">
- <query>SELECT w FROM WebsiteData w WHERE w.dateCreated < ?1 AND w.dateCreated > ?2
- AND w.enabled = ?3 AND w.active ?4
- AND w.persmissions.user = ?5
- AND w.permission.pending = ?6
+ <query>SELECT w FROM WebsiteData w JOIN w.permissions p WHERE w.dateCreated < ?1 AND w.dateCreated > ?2
+ AND w.enabled = ?3 AND w.active = ?4
+ AND p.user = ?5
+ AND p.pending = ?6
ORDER BY w.dateCreated</query>
</named-query>
<named-query name="WebsiteData.getByEndDate&StartDate&Enabled&ActiveOrderByDateCreatedDesc">
<query>SELECT w FROM WebsiteData w WHERE w.dateCreated < ?1 AND w.dateCreated > ?2
- AND w.enabled = ?3 AND w.active ?4
+ AND w.enabled = ?3 AND w.active = ?4
ORDER BY w.dateCreated</query>
</named-query>
<named-query name="WebsiteData.getByEndDate&StartDate&EnabledOrderByDateCreatedDesc">
@@ -49,36 +49,36 @@
ORDER BY w.dateCreated</query>
</named-query>
<named-query name="WebsiteData.getByEndDate&StartDate&Enabled&Permissions.user&Permissions.pendingOrderByDateCreatedDesc">
- <query>SELECT w FROM WebsiteData w WHERE w.dateCreated < ?1 AND w.dateCreated > ?2
+ <query>SELECT w FROM WebsiteData w JOIN w.permissions p WHERE w.dateCreated < ?1 AND w.dateCreated > ?2
AND w.enabled = ?3
- AND w.persmissions.user = ?4
- AND w.permission.pending = ?5
+ AND p.user = ?4
+ AND p.pending = ?5
ORDER BY w.dateCreated</query>
</named-query>
<named-query name="WebsiteData.getByEndDate&StartDate&Active&Permissions.user&Permissions.pendingOrderByDateCreatedDesc">
- <query>SELECT w FROM WebsiteData w WHERE w.dateCreated < ?1 AND w.dateCreated > ?2
- AND w.active ?3
- AND w.persmissions.user = ?4
- AND w.permission.pending = ?5
+ <query>SELECT w FROM WebsiteData w JOIN w.permissions p WHERE w.dateCreated < ?1 AND w.dateCreated > ?2
+ AND w.active = ?3
+ AND p.user = ?4
+ AND p.pending = ?5
ORDER BY w.dateCreated</query>
</named-query>
<named-query name="WebsiteData.getByEndDate&StartDate&ActiveOrderByDateCreatedDesc">
<query>SELECT w FROM WebsiteData w WHERE w.dateCreated < ?1 AND w.dateCreated > ?2
- AND w.active ?3
+ AND w.active = ?3
ORDER BY w.dateCreated</query>
</named-query>
<named-query name="WebsiteData.getByEndDate&Enabled&Active&Permissions.user&Permissions.pendingOrderByDateCreatedDesc">
- <query>SELECT w FROM WebsiteData w WHERE w.dateCreated < ?1
- AND w.enabled = ?2 AND w.active ?3
- AND w.persmissions.user = ?4
- AND w.permission.pending = ?5
+ <query>SELECT w FROM WebsiteData w JOIN w.permissions p WHERE w.dateCreated < ?1
+ AND w.enabled = ?2 AND w.active = ?3
+ AND p.user = ?4
+ AND p.pending = ?5
ORDER BY w.dateCreated</query>
</named-query>
<named-query name="WebsiteData.getByEndDate&Enabled&ActiveOrderByDateCreatedDesc">
<query>SELECT w FROM WebsiteData w WHERE w.dateCreated < ?1
- AND w.enabled = ?2 AND w.active ?3
+ AND w.enabled = ?2 AND w.active = ?3
ORDER BY w.dateCreated</query>
</named-query>
<named-query name="WebsiteData.getByEndDate&EnabledOrderByDateCreatedDesc">
@@ -87,10 +87,10 @@
ORDER BY w.dateCreated</query>
</named-query>
<named-query name="WebsiteData.getByEndDate&Active&Permissions.user&Permissions.pendingOrderByDateCreatedDesc">
- <query>SELECT w FROM WebsiteData w WHERE w.dateCreated < ?1
+ <query>SELECT w FROM WebsiteData w JOIN w.permissions p WHERE w.dateCreated < ?1
AND w.active ?2
- AND w.persmissions.user = ?3
- AND w.permission.pending = ?4
+ AND p.user = ?3
+ AND p.pending = ?4
ORDER BY w.dateCreated</query>
</named-query>
<named-query name="WebsiteData.getByEndDate&ActiveOrderByDateCreatedDesc">
@@ -99,9 +99,9 @@
ORDER BY w.dateCreated</query>
</named-query>
<named-query name="WebsiteData.getByEndDate&Permissions.user&Permissions.pendingOrderByDateCreatedDesc">
- <query>SELECT w FROM WebsiteData w WHERE w.dateCreated < ?1
- AND w.persmissions.user = ?2
- AND w.permission.pending = ?3
+ <query>SELECT w FROM WebsiteData w JOIN w.permissions p WHERE w.dateCreated < ?1
+ AND p.user = ?2
+ AND p.pending = ?3
ORDER BY w.dateCreated</query>
</named-query>
<named-query name="WebsiteData.getByEndDate&EnabledOrderByDateCreatedDesc">
@@ -112,7 +112,7 @@
<named-query name="WebsiteData.getCountAllDistinct">
<query>SELECT COUNT(DISTINCT w) FROM WebsiteData w</query>
</named-query>
- <attributes>
+--> <attributes>
<id name="id">
<column name="id"/>
</id>
@@ -212,6 +212,12 @@
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">
+ <cascade>
+ <cascade-remove/>
+ </cascade>
+ </one-to-many>
+
</attributes>
</entity>
</entity-mappings>
Added: incubator/roller/trunk/sandbox/jdobackend/web/WEB-INF/classes/JDOPMF.properties
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/web/WEB-INF/classes/JDOPMF.properties?view=auto&rev=487352
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/web/WEB-INF/classes/JDOPMF.properties (added)
+++ incubator/roller/trunk/sandbox/jdobackend/web/WEB-INF/classes/JDOPMF.properties Thu Dec 14 13:12:47 2006
@@ -0,0 +1,16 @@
+javax.jdo.PersistenceManagerFactoryClass=org.jpox.PersistenceManagerFactoryImpl
+javax.jdo.option.ConnectionUserName=sa
+javax.jdo.option.ConnectionURL=jdbc:hsqldb:hsql://localhost:3219
+javax.jdo.option.ConnectionDriverName=org.hsqldb.jdbcDriver
+
+
+org.jpox.validateTables=false
+org.jpox.validateConstraints=false
+org.jpox.autoCreateSchema=false
+org.jpox.autoCreateTables=false
+org.jpox.autoCreateConstraints=false
+org.jpox.autoCreateColumns=false
+org.jpox.rdbms.CheckExistTablesOrViews=false
+org.jpox.autoStartMechanism=None
+#org.jpox.connectionPoolingType=DBCP
+#org.jpox.connectionPoolingType=C3P0
Added: incubator/roller/trunk/sandbox/jdobackend/web/WEB-INF/classes/JPAEMF.properties
URL: http://svn.apache.org/viewvc/incubator/roller/trunk/sandbox/jdobackend/web/WEB-INF/classes/JPAEMF.properties?view=auto&rev=487352
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/web/WEB-INF/classes/JPAEMF.properties (added)
+++ incubator/roller/trunk/sandbox/jdobackend/web/WEB-INF/classes/JPAEMF.properties Thu Dec 14 13:12:47 2006
@@ -0,0 +1,6 @@
+toplink.jdbc.driver=org.apache.derby.jdbc.ClientDriver
+toplink.jdbc.url=jdbc:derby://localhost:3219/roller
+toplink.jdbc.user=APP
+toplink.jdbc.password=APP
+toplink.logging.level=FINEST
+
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=487352&r1=487351&r2=487352
==============================================================================
--- incubator/roller/trunk/sandbox/jdobackend/web/WEB-INF/classes/persistence.xml (original)
+++ incubator/roller/trunk/sandbox/jdobackend/web/WEB-INF/classes/persistence.xml Thu Dec 14 13:12:47 2006
@@ -1,36 +1,38 @@
<persistence xmlns="http://java.sun.com/xml/ns/persistence" version="1.0">
<persistence-unit name ="RollerPU" transaction-type = "RESOURCE_LOCAL">
<provider>oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider</provider>
- <mapping-file>META-INF/AutoPingData.orm.xml </mapping-file>
- <mapping-file>META-INF/BookmarkData.orm.xml </mapping-file>
- <mapping-file>META-INF/CommentData.orm.xml </mapping-file>
- <mapping-file>META-INF/EntryAttributeData.orm.xml </mapping-file>
- <mapping-file>META-INF/FolderData.orm.xml </mapping-file>
- <mapping-file>META-INF/HitCountData.orm.xml </mapping-file>
- <mapping-file>META-INF/ObjectAuditData.orm.xml </mapping-file>
- <mapping-file>META-INF/PermissionsData.orm.xml </mapping-file>
- <mapping-file>META-INF/PingCategoryRestrictionData.orm.xml </mapping-file>
- <mapping-file>META-INF/PingQueueEntryData.orm.xml </mapping-file>
- <mapping-file>META-INF/PingTargetData.orm.xml </mapping-file>
- <mapping-file>META-INF/RefererData.orm.xml </mapping-file>
- <mapping-file>META-INF/RoleData.orm.xml </mapping-file>
- <mapping-file>META-INF/RollerConfigData.orm.xml </mapping-file>
- <mapping-file>META-INF/RollerPropertyData.orm.xml </mapping-file>
- <mapping-file>META-INF/UserData.orm.xml </mapping-file>
- <mapping-file>META-INF/WeblogCategoryData.orm.xml </mapping-file>
- <mapping-file>META-INF/WeblogEntryData.orm.xml </mapping-file>
- <mapping-file>META-INF/WeblogEntryTagData.orm.xml </mapping-file>
- <mapping-file>META-INF/WeblogTemplate.orm.xml </mapping-file>
- <mapping-file>META-INF/WebsiteData.orm.xml </mapping-file>
- <mapping-file>META-INF/PlanetConfigData.orm.xml </mapping-file>
- <mapping-file>META-INF/PlanetEntryData.orm.xml </mapping-file>
- <mapping-file>META-INF/PlanetGroupData.orm.xml </mapping-file>
- <mapping-file>META-INF/PlanetSubscriptionData.orm.xml </mapping-file>
+ <mapping-file>org/apache/roller/pojos/AutoPingData.orm.xml </mapping-file>
+ <mapping-file>org/apache/roller/pojos/BookmarkData.orm.xml </mapping-file>
+ <mapping-file>org/apache/roller/pojos/CommentData.orm.xml </mapping-file>
+ <mapping-file>org/apache/roller/pojos/EntryAttributeData.orm.xml </mapping-file>
+ <mapping-file>org/apache/roller/pojos/FolderData.orm.xml </mapping-file>
+ <mapping-file>org/apache/roller/pojos/HitCountData.orm.xml </mapping-file>
+ <mapping-file>org/apache/roller/pojos/ObjectAuditData.orm.xml </mapping-file>
+ <mapping-file>org/apache/roller/pojos/PermissionsData.orm.xml </mapping-file>
+ <mapping-file>org/apache/roller/pojos/PingCategoryRestrictionData.orm.xml </mapping-file>
+ <mapping-file>org/apache/roller/pojos/PingQueueEntryData.orm.xml </mapping-file>
+ <mapping-file>org/apache/roller/pojos/PingTargetData.orm.xml </mapping-file>
+ <mapping-file>org/apache/roller/pojos/RefererData.orm.xml </mapping-file>
+ <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/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>
+ <mapping-file>org/apache/roller/pojos/WeblogTemplate.orm.xml </mapping-file>
+ <mapping-file>org/apache/roller/pojos/WebsiteData.orm.xml </mapping-file>
+<!--
+ <mapping-file>org/apache/roller/pojos/PlanetConfigData.orm.xml </mapping-file>
+ <mapping-file>org/apache/roller/pojos/PlanetEntryData.orm.xml </mapping-file>
+ <mapping-file>org/apache/roller/pojos/PlanetGroupData.orm.xml </mapping-file>
+ <mapping-file>org/apache/roller/pojos/PlanetSubscriptionData.orm.xml </mapping-file>
+-->
<properties>
- <property name="toplink.jdbc.driver" value="org.hsqldb.jdbcDriver"/>
- <property name="toplink.jdbc.url" value="jdbc:hsqldb:hsql://localhost:3219"/>
- <property name="toplink.jdbc.user" value="sa"/>
- <property name="toplink.jdbc.password" value=""/>
+ <property name="toplink.jdbc.driver" value="org.apache.derby.jdbc.ClientDriver"/>
+ <property name="toplink.jdbc.url" value="jdbc:derby://localhost:3219/roller"/>
+ <property name="toplink.jdbc.user" value="APP"/>
+ <property name="toplink.jdbc.password" value="APP"/>
<property name="toplink.logging.level" value="FINEST"/>
</properties>
</persistence-unit>
Re: svn commit: r487352 - in /incubator/roller/trunk/sandbox/jdobackend: custom/ src/org/apache/roller/business/datamapper/ src/org/apache/roller/business/jpa/ src/org/apache/roller/pojos/ web/WEB-INF/classes/
Posted by Dave <sn...@gmail.com>.
On 12/14/06, clr@apache.org <cl...@apache.org> wrote:
> Author: clr
> Date: Thu Dec 14 13:12:47 2006
> New Revision: 487352
>
> URL: http://svn.apache.org/viewvc?view=rev&rev=487352
> Log:
> Datamapper JPA ready for testing
Most excellent news!