Author: christian.bauer(a)jboss.com
Date: 2009-03-20 21:42:55 -0400 (Fri, 20 Mar 2009)
New Revision: 10196
Modified:
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ForumDAO.java
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ForumQueries.hbm.xml
Log:
Fixed forum queries for PostgreSQL
Modified: trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ForumDAO.java
===================================================================
---
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ForumDAO.java 2009-03-20
23:18:25 UTC (rev 10195)
+++
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ForumDAO.java 2009-03-21
01:42:55 UTC (rev 10196)
@@ -40,7 +40,7 @@
Long forumsCount = (Long)
getSession(true).getNamedQuery("forumsCount")
.setParameter("parentDir", forumsDirectory)
- .setComment("Finding all forums")
+ .setComment("Counting all forums")
.uniqueResult();
return forumsCount > 0l;
}
@@ -69,7 +69,6 @@
getSession(true).getNamedQuery("forumTopicCount")
.setParameter("parentDir", forumsDirectory)
.setComment("Finding topic count for all forums")
- .setCacheable(true)
.setResultTransformer(
new ResultTransformer() {
public Object transformTuple(Object[] result, String[] strings) {
@@ -90,7 +89,6 @@
.setParameter("parentDirId", forumsDirectory.getId())
.setParameter("readAccessLevel", currentAccessLevel)
.setComment("Finding reply count for all forums")
- .setCacheable(true)
.setResultTransformer(
new ResultTransformer() {
public Object transformTuple(Object[] result, String[] strings) {
@@ -112,7 +110,6 @@
.setParameter("parentDirId", forumsDirectory.getId())
.setParameter("readAccessLevel", currentAccessLevel)
.setComment("Finding last topics for all forums")
- .setCacheable(true)
.list();
for (Object[] lastTopicRow : forumsAndLastTopics) {
if (forumInfoMap.containsKey((Long)lastTopicRow[0])) {
@@ -126,7 +123,6 @@
.setParameter("parentDirId", forumsDirectory.getId())
.setParameter("readAccessLevel", currentAccessLevel)
.setComment("Finding last replies for all forums")
- .setCacheable(true)
.setResultTransformer(
new ResultTransformer() {
public Object transformTuple(Object[] result, String[] strings) {
Modified:
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ForumQueries.hbm.xml
===================================================================
---
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ForumQueries.hbm.xml 2009-03-20
23:18:25 UTC (rev 10195)
+++
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ForumQueries.hbm.xml 2009-03-21
01:42:55 UTC (rev 10196)
@@ -15,12 +15,11 @@
<query name="forumsCount">
select count(d.id)
from
- WikiDirectory d fetch all properties,
+ WikiDirectory d,
WikiMenuItem m
where
d = m.directory
and d.parent = :parentDir
- order by m.displayPosition asc
</query>
<query name="forums">
@@ -95,7 +94,6 @@
dlast0.PARENT_NODE_ID = dir0.NODE_ID and
dlast0.READ_ACCESS_LEVEL <= :readAccessLevel
order by dlast0.CREATED_ON desc limit 1
)
- group by dir0.NODE_ID
</sql-query>
<sql-query name="forumLastReply">
@@ -370,7 +368,7 @@
limit 1
)
group by
- cl1.OBJ_VERSION, cl1.RATING, cl1.AREA_NR, cl1.NAME, cl1.WIKINAME,
cl1.MESSAGE_ID, cl1.CREATED_ON, cl1.CREATED_BY_USER_ID, cl1.LAST_MODIFIED_ON,
+ cl1.NODE_ID, cl1.OBJ_VERSION, cl1.RATING, cl1.AREA_NR, cl1.NAME,
cl1.WIKINAME, cl1.MESSAGE_ID, cl1.CREATED_ON, cl1.CREATED_BY_USER_ID,
cl1.LAST_MODIFIED_ON,
cl1.LAST_MODIFIED_BY_USER_ID, cl1.WRITE_ACCESS_LEVEL, cl1.READ_ACCESS_LEVEL,
cl1.WRITE_PROTECTED, cl1.PARENT_NODE_ID,
cl0.SUBJECT, cl0.FROM_USER_NAME, cl0.FROM_USER_EMAIL, cl0.FROM_USER_HOMEPAGE,
cl0.USE_WIKI_TEXT, cl0.NS_LEFT, cl0.NS_RIGHT, cl0.NS_THREAD,