[jboss-cvs] jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/plugin/blogdirectory ...

Christian Bauer christian at hibernate.org
Thu Apr 19 05:32:05 EDT 2007


  User: cbauer  
  Date: 07/04/19 05:32:05

  Modified:    examples/wiki/src/main/org/jboss/seam/wiki/plugin/blogdirectory  
                        BlogDirectory.java BlogEntry.java
  Log:
  Fixed comments and blog directory
  
  Revision  Changes    Path
  1.6       +5 -1      jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/plugin/blogdirectory/BlogDirectory.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: BlogDirectory.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/plugin/blogdirectory/BlogDirectory.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -b -r1.5 -r1.6
  --- BlogDirectory.java	2 Apr 2007 18:25:04 -0000	1.5
  +++ BlogDirectory.java	19 Apr 2007 09:32:05 -0000	1.6
  @@ -63,12 +63,16 @@
       }
   
       private void queryBlogEntries() {
  +        // TODO: This could be done in one query but I'm too lazy to write the GROUP BY clause because Hibernate doesn't do it for me
           List<Document> documents =
                   nodeDAO.findWithParent(Document.class, currentDirectory, currentDocument,
                                          orderByProperty, orderDescending, page * pageSize, pageSize);
  +        Map<Long,Long> commentCounts = nodeDAO.findCommentCount(currentDirectory);
   
           for (Document document : documents) {
  -            blogEntries.add(new BlogEntry(document));
  +            blogEntries.add(
  +                new BlogEntry(document, commentCounts.get(document.getId()) )
  +            );
           }
       }
   
  
  
  
  1.2       +11 -1     jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/plugin/blogdirectory/BlogEntry.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: BlogEntry.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/plugin/blogdirectory/BlogEntry.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -b -r1.1 -r1.2
  --- BlogEntry.java	21 Mar 2007 01:24:48 -0000	1.1
  +++ BlogEntry.java	19 Apr 2007 09:32:05 -0000	1.2
  @@ -7,9 +7,11 @@
   public class BlogEntry implements Serializable {
   
       Document entryDocument;
  +    Long commentCount;
   
  -    public BlogEntry(Document entryDocument) {
  +    public BlogEntry(Document entryDocument, Long commentCount) {
           this.entryDocument = entryDocument;
  +        this.commentCount = commentCount;
       }
   
       public Document getEntryDocument() {
  @@ -19,4 +21,12 @@
       public void setEntryDocument(Document entryDocument) {
           this.entryDocument = entryDocument;
       }
  +
  +    public Long getCommentCount() {
  +        return commentCount;
  +    }
  +
  +    public void setCommentCount(Long commentCount) {
  +        this.commentCount = commentCount;
  +    }
   }
  
  
  



More information about the jboss-cvs-commits mailing list