Author: christian.bauer(a)jboss.com
Date: 2009-04-15 03:12:00 -0400 (Wed, 15 Apr 2009)
New Revision: 10421
Modified:
trunk/examples/wiki/src/main/org/jboss/seam/wiki/util/WikiMySQL5HibernateDialect.java
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ForumDAO.java
Log:
Minor bugfixes
Modified:
trunk/examples/wiki/src/main/org/jboss/seam/wiki/util/WikiMySQL5HibernateDialect.java
===================================================================
---
trunk/examples/wiki/src/main/org/jboss/seam/wiki/util/WikiMySQL5HibernateDialect.java 2009-04-15
06:41:39 UTC (rev 10420)
+++
trunk/examples/wiki/src/main/org/jboss/seam/wiki/util/WikiMySQL5HibernateDialect.java 2009-04-15
07:12:00 UTC (rev 10421)
@@ -36,6 +36,6 @@
// Create all tables as default UTF8!
@Override
public String getTableTypeString() {
- return " ENGINE=InnoDB DEFAULT CHARSET=utf8";
+ return " ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE utf8_general_ci";
}
}
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-04-15
06:41:39 UTC (rev 10420)
+++
trunk/examples/wiki/src/plugin/org/jboss/seam/wiki/plugin/forum/ForumDAO.java 2009-04-15
07:12:00 UTC (rev 10421)
@@ -36,17 +36,25 @@
}
public Long findForumPostingsCount(List<WikiDirectory> forumDirectories, User
user) {
- return (Long)
getSession(true).getNamedQuery("forumTopicsForUserCount")
- .setParameterList("parentDirectories", forumDirectories)
- .setParameter("user", user)
- .setComment("Finding forum topcis count for user: " + user)
- .uniqueResult();
+ if (forumDirectories == null || forumDirectories.size() == 0) {
+ return 0l;
+ } else {
+ return (Long)
getSession(true).getNamedQuery("forumTopicsForUserCount")
+ .setParameterList("parentDirectories", forumDirectories)
+ .setParameter("user", user)
+ .setComment("Finding forum topcis count for user: " +
user)
+ .uniqueResult();
+ }
}
public List<TopicInfo> findForumPostings(List<WikiDirectory>
forumDirectories, User user, int firstResult, int maxResults) {
final Map<Long, TopicInfo> topicInfoMap = new LinkedHashMap();
+ if (forumDirectories == null || forumDirectories.size() == 0) {
+ return Collections.EMPTY_LIST;
+ }
+
getSession(true).getNamedQuery("forumTopicsForUser")
.setParameterList("parentDirectories", forumDirectories)
.setParameter("user", user)
Show replies by date