[jboss-cvs] jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/model ...

Christian Bauer christian at hibernate.org
Thu Aug 30 12:50:59 EDT 2007


  User: cbauer  
  Date: 07/08/30 12:50:59

  Modified:    examples/wiki/src/main/org/jboss/seam/wiki/core/model    
                        FeedEntry.java Comment.java DatabaseObjects.hbm.xml
                        Document.java
  Log:
  Finished Blosxom importer (not perfect though) and minor bugfixes
  
  Revision  Changes    Path
  1.10      +2 -2      jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/model/FeedEntry.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: FeedEntry.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/model/FeedEntry.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -b -r1.9 -r1.10
  --- FeedEntry.java	17 Aug 2007 13:00:24 -0000	1.9
  +++ FeedEntry.java	30 Aug 2007 16:50:58 -0000	1.10
  @@ -136,8 +136,8 @@
       // Sort by date
       public int compareTo(Object o) {
           FeedEntry other = (FeedEntry)o;
  -        if (getUpdatedDate().getTime() > other.getUpdatedDate().getTime()) return -1;
  -        return (getUpdatedDate().getTime() == other.getUpdatedDate().getTime() ? 0 : 1);
  +        if (getPublishedDate().getTime() > other.getPublishedDate().getTime()) return -1;
  +        return (getPublishedDate().getTime() == other.getPublishedDate().getTime() ? 0 : 1);
       }
   
       public String toString() {
  
  
  
  1.7       +20 -2     jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/model/Comment.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Comment.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/model/Comment.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -b -r1.6 -r1.7
  --- Comment.java	17 Aug 2007 13:00:24 -0000	1.6
  +++ Comment.java	30 Aug 2007 16:50:58 -0000	1.7
  @@ -39,7 +39,7 @@
       @Column(name = "OBJ_VERSION", nullable = false)
       private int version = 0;
   
  -    @ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.PERSIST)
  +    @ManyToOne(fetch = FetchType.LAZY)
       @JoinColumn(name = "DOCUMENT_ID", nullable = false)
       @org.hibernate.annotations.ForeignKey(name = "FK_COMMENT_DOCUMENT_ID")
       private Document document;
  @@ -67,6 +67,9 @@
       @org.hibernate.search.annotations.Field(index = org.hibernate.search.annotations.Index.TOKENIZED)
       private String text;
   
  +    @Column(name = "USE_WIKI_TEXT", nullable = false)
  +    private boolean useWikiText = true;
  +
       @Column(name = "CREATED_ON", nullable = false, updatable = false)
       @org.hibernate.search.annotations.Field(
           index = org.hibernate.search.annotations.Index.UN_TOKENIZED,
  @@ -82,10 +85,17 @@
   
       public Long getId() { return id; }
       public Integer getVersion() { return version; }
  -    public Date getCreatedOn() { return createdOn; }
   
       // Mutable properties
   
  +    public Date getCreatedOn() {
  +        return createdOn;
  +    }
  +
  +    public void setCreatedOn(Date createdOn) {
  +        this.createdOn = createdOn;
  +    }
  +
       public Document getDocument() {
           return document;
       }
  @@ -134,6 +144,14 @@
           this.text = text;
       }
   
  +    public boolean isUseWikiText() {
  +        return useWikiText;
  +    }
  +
  +    public void setUseWikiText(boolean useWikiText) {
  +        this.useWikiText = useWikiText;
  +    }
  +
       // Misc methods
   
       public String toString() {
  
  
  
  1.5       +32 -32    jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/model/DatabaseObjects.hbm.xml
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: DatabaseObjects.hbm.xml
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/model/DatabaseObjects.hbm.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -b -r1.4 -r1.5
  --- DatabaseObjects.hbm.xml	25 Aug 2007 17:59:23 -0000	1.4
  +++ DatabaseObjects.hbm.xml	30 Aug 2007 16:50:58 -0000	1.5
  @@ -176,25 +176,25 @@
       <database-object>
           <create>
               alter table FEEDENTRY drop foreign key FK_FEEDENTRY_DOCUMENT_ID;
  -        </create><drop></drop><dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
  +        </create><drop></drop><dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       </database-object>
       <database-object>
           <create>
               alter table FEEDENTRY
                   add constraint FK_FEEDENTRY_DOCUMENT_ID foreign key (DOCUMENT_ID) references NODE (NODE_ID) on delete set null;
  -        </create><drop></drop><dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
  +        </create><drop></drop><dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       </database-object>
   
       <database-object>
           <create>
               alter table FEED_FEEDENTRY drop foreign key FK_FEED_FEEDENTRY_FEED_ID;
  -        </create><drop></drop><dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
  +        </create><drop></drop><dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       </database-object>
       <database-object>
           <create>
               alter table FEED_FEEDENTRY
                   add constraint FK_FEED_FEEDENTRY_FEED_ID foreign key (FEED_ID) references FEED (FEED_ID) on delete cascade;
  -        </create><drop></drop><dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
  +        </create><drop></drop><dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       </database-object>
   
       <database-object>
  @@ -202,7 +202,7 @@
               alter table FEED_FEEDENTRY drop foreign key FK_FEED_FEEDENTRY_FEEDENTRY_ID;
           </create>
           <drop></drop>
  -        <dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
  +        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       </database-object>
       <database-object>
           <create>
  @@ -210,7 +210,7 @@
                   add constraint FK_FEED_FEEDENTRY_FEEDENTRY_ID foreign key (FEEDENTRY_ID) references FEEDENTRY (FEEDENTRY_ID) on delete cascade;
           </create>
           <drop></drop>
  -        <dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
  +        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       </database-object>
   
       <database-object>
  @@ -218,7 +218,7 @@
               alter table NODE drop foreign key FK_NODE_PARENT_NODE_ID;
           </create>
           <drop></drop>
  -        <dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
  +        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       </database-object>
       <database-object>
           <create>
  @@ -226,7 +226,7 @@
                   add constraint FK_NODE_PARENT_NODE_ID foreign key (PARENT_NODE_ID) references NODE (NODE_ID) on delete cascade;
           </create>
           <drop></drop>
  -        <dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
  +        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       </database-object>
   
       <database-object>
  @@ -234,7 +234,7 @@
               alter table NODE drop foreign key FK_NODE_LAST_MODIFIED_BY_USER_ID;
           </create>
           <drop></drop>
  -        <dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
  +        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       </database-object>
       <database-object>
           <create>
  @@ -242,7 +242,7 @@
                   add constraint FK_NODE_LAST_MODIFIED_BY_USER_ID foreign key (LAST_MODIFIED_BY_USER_ID) references USERS (USER_ID) on delete set null;
           </create>
           <drop></drop>
  -        <dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
  +        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       </database-object>
   
       <database-object>
  @@ -250,14 +250,14 @@
               alter table NODE_DIRECTORY drop foreign key FK_DIRECTORY_DEFAULT_DOCUMENT_ID;
           </create>
           <drop></drop>
  -        <dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
  +        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       </database-object>
       <database-object>
           <create>
               alter table NODE_DIRECTORY add constraint FK_DIRECTORY_DEFAULT_DOCUMENT_ID foreign key (DEFAULT_DOCUMENT_ID) references NODE (NODE_ID) on delete set null;
           </create>
           <drop></drop>
  -        <dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
  +        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       </database-object>
   
       <database-object>
  @@ -265,14 +265,14 @@
               alter table NODE_DOCUMENT drop foreign key FK_NODE_DOCUMENT_DOCUMENT_ID;
           </create>
           <drop></drop>
  -        <dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
  +        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       </database-object>
       <database-object>
           <create>
               alter table NODE_DOCUMENT add constraint FK_NODE_DOCUMENT_DOCUMENT_ID foreign key (DOCUMENT_ID) references NODE (NODE_ID) on delete cascade;
           </create>
           <drop></drop>
  -        <dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
  +        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       </database-object>
   
       <database-object>
  @@ -280,14 +280,14 @@
               alter table NODE_DIRECTORY drop foreign key FK_NODE_DIRECTORY_DIRECTORY_ID;
           </create>
           <drop></drop>
  -        <dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
  +        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       </database-object>
       <database-object>
           <create>
               alter table NODE_DIRECTORY add constraint FK_NODE_DIRECTORY_DIRECTORY_ID foreign key (DIRECTORY_ID) references NODE (NODE_ID) on delete cascade;
           </create>
           <drop></drop>
  -        <dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
  +        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       </database-object>
   
       <database-object>
  @@ -295,14 +295,14 @@
               alter table NODE_FILE drop foreign key FK_NODE_FILE_FILE_ID;
           </create>
           <drop></drop>
  -        <dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
  +        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       </database-object>
       <database-object>
           <create>
               alter table NODE_FILE add constraint FK_NODE_FILE_FILE_ID foreign key (FILE_ID) references NODE (NODE_ID) on delete cascade;
           </create>
           <drop></drop>
  -        <dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
  +        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       </database-object>
   
       <database-object>
  @@ -310,14 +310,14 @@
               alter table PREFERENCE drop foreign key FK_PREFERENCE_NODE_ID;
           </create>
           <drop></drop>
  -        <dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
  +        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       </database-object>
       <database-object>
           <create>
               alter table PREFERENCE add constraint FK_PREFERENCE_NODE_ID foreign key (NODE_ID) references NODE (NODE_ID) on delete cascade;
           </create>
           <drop></drop>
  -        <dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
  +        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       </database-object>
   
       <database-object>
  @@ -325,14 +325,14 @@
               alter table PREFERENCE drop foreign key FK_PREFERENCE_USER_ID;
           </create>
           <drop></drop>
  -        <dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
  +        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       </database-object>
       <database-object>
           <create>
               alter table PREFERENCE add constraint FK_PREFERENCE_USER_ID foreign key (USER_ID) references USERS (USER_ID) on delete cascade;
           </create>
           <drop></drop>
  -        <dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
  +        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       </database-object>
   
       <database-object>
  @@ -340,14 +340,14 @@
               alter table USERS drop foreign key FK_USER_MEMBER_HOME_NODE_ID;
           </create>
           <drop></drop>
  -        <dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
  +        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       </database-object>
       <database-object>
           <create>
               alter table USERS add constraint FK_USER_MEMBER_HOME_NODE_ID foreign key (MEMBER_HOME_NODE_ID) references NODE (NODE_ID) on delete set null;
           </create>
           <drop></drop>
  -        <dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
  +        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       </database-object>
   
       <database-object>
  @@ -355,14 +355,14 @@
               alter table USER_ROLE drop foreign key USER_ROLE_USER_ID;
           </create>
           <drop></drop>
  -        <dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
  +        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       </database-object>
       <database-object>
           <create>
               alter table USER_ROLE add constraint USER_ROLE_USER_ID foreign key (USER_ID) references USERS (USER_ID) on delete cascade;
           </create>
           <drop></drop>
  -        <dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
  +        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       </database-object>
   
       <database-object>
  @@ -370,14 +370,14 @@
               alter table USER_ROLE drop foreign key USER_ROLE_ROLE_ID;
           </create>
           <drop></drop>
  -        <dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
  +        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       </database-object>
       <database-object>
           <create>
               alter table USER_ROLE add constraint USER_ROLE_ROLE_ID foreign key (ROLE_ID) references ROLES (ROLE_ID) on delete cascade;
           </create>
           <drop></drop>
  -        <dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
  +        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       </database-object>
   
       <database-object>
  @@ -385,14 +385,14 @@
               alter table USERS drop foreign key FK_USER_USER_PROFILE_ID;
           </create>
           <drop></drop>
  -        <dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
  +        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       </database-object>
       <database-object>
           <create>
               alter table USERS add constraint FK_USER_USER_PROFILE_ID foreign key (USER_PROFILE_ID) references USER_PROFILE (USER_PROFILE_ID) on delete cascade;
           </create>
           <drop></drop>
  -        <dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
  +        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       </database-object>
   
       <database-object>
  @@ -402,7 +402,7 @@
           <drop>
               drop index IDX_COMPONENT_NAME
           </drop>
  -        <dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
  +        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       </database-object>
   
       <database-object>
  @@ -412,7 +412,7 @@
           <drop>
               drop index IDX_COMPONENT_PROPERTY_NAME
           </drop>
  -        <dialect-scope name="org.hibernate.dialect.MySQLInnoDBDialect"/>
  +        <dialect-scope name="org.hibernate.dialect.MySQL5InnoDBDialect"/>
       </database-object>
   
   </hibernate-mapping>
  
  
  
  1.16      +3 -2      jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/model/Document.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Document.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/model/Document.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -b -r1.15 -r1.16
  --- Document.java	29 Aug 2007 00:29:22 -0000	1.15
  +++ Document.java	30 Aug 2007 16:50:58 -0000	1.16
  @@ -12,6 +12,7 @@
   import javax.persistence.*;
   import javax.persistence.Entity;
   import java.util.List;
  +import java.util.ArrayList;
   
   @Entity
   @DiscriminatorValue("DOCUMENT")
  @@ -44,11 +45,11 @@
       @Column(table = "NODE_DOCUMENT", name = "ENABLE_COMMENT_FORM")
       private Boolean enableCommentForm = true;
   
  -    @OneToMany(mappedBy = "document", fetch = FetchType.LAZY)
  +    @OneToMany(mappedBy = "document", fetch = FetchType.LAZY, cascade = CascadeType.PERSIST)
       @org.hibernate.annotations.OnDelete(action = org.hibernate.annotations.OnDeleteAction.CASCADE)
       @org.hibernate.annotations.OrderBy(clause = "CREATED_ON desc")
       @org.hibernate.annotations.LazyCollection(org.hibernate.annotations.LazyCollectionOption.EXTRA)
  -    private List<Comment> comments;
  +    private List<Comment> comments = new ArrayList<Comment>();
   
       @Column(table = "NODE_DOCUMENT", name = "PLUGINS_USED", nullable = false)
       private String pluginsUsed = "";
  
  
  



More information about the jboss-cvs-commits mailing list