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

Christian Bauer christian at hibernate.org
Fri Nov 9 10:02:07 EST 2007


  User: cbauer  
  Date: 07/11/09 10:02:07

  Modified:    examples/wiki/src/main/org/jboss/seam/wiki/core/model  
                        FeedEntry.java Feed.java
  Log:
  Access control for feeds and feed entries, JBSEAM-2114
  
  Revision  Changes    Path
  1.12      +22 -3     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.11
  retrieving revision 1.12
  diff -u -b -r1.11 -r1.12
  --- FeedEntry.java	14 Oct 2007 11:06:42 -0000	1.11
  +++ FeedEntry.java	9 Nov 2007 15:02:07 -0000	1.12
  @@ -13,7 +13,15 @@
   import java.io.Serializable;
   
   @Entity
  - at Table(name = "FEEDENTRY")
  + at Table(
  +    name = "FEEDENTRY",
  +    uniqueConstraints = {
  +        // An entry can either be for a document (DOCUMENT_ID 123, COMMENT_IDENTIFIER null)
  +        // or a comment (DOCUMENT_ID 123, COMMENT_IDENTIFIER 456). Duplicate comment identifiers
  +        // for the same document are not allowed.
  +        @UniqueConstraint(columnNames = {"DOCUMENT_ID", "COMMENT_IDENTIFIER"})
  +    }
  +)
   public class FeedEntry implements Serializable, Comparable {
   
       public static final String END_TEASER_MARKER = "[<=endTeaser]";
  @@ -32,7 +40,7 @@
       private String link;
   
       @Column(name = "TITLE", nullable = false)
  -    @Length(min = 3, max = 255)
  +    @Length(min = 3, max = 1024)
       private String title;
   
       @Column(name = "AUTHOR", nullable = false)
  @@ -54,10 +62,13 @@
       private String descriptionValue;
   
       @ManyToOne(fetch = FetchType.LAZY)
  -    @JoinColumn(name = "DOCUMENT_ID")
  +    @JoinColumn(name = "DOCUMENT_ID", nullable = false)
       @org.hibernate.annotations.ForeignKey(name = "FK_FEEDENTRY_DOCUMENT_ID")
       private Document document;
   
  +    @Column(name = "COMMENT_IDENTIFIER", nullable = true)
  +    private Long commentIdentifier;
  +
       public FeedEntry() {}
   
       // Immutable properties
  @@ -144,6 +155,14 @@
           this.document = document;
       }
   
  +    public Long getCommentIdentifier() {
  +        return commentIdentifier;
  +    }
  +
  +    public void setCommentIdentifier(Long commentIdentifier) {
  +        this.commentIdentifier = commentIdentifier;
  +    }
  +
       // Sort by date
       public int compareTo(Object o) {
           FeedEntry other = (FeedEntry)o;
  
  
  
  1.7       +1 -0      jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/model/Feed.java
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: Feed.java
  ===================================================================
  RCS file: /cvsroot/jboss/jboss-seam/examples/wiki/src/main/org/jboss/seam/wiki/core/model/Feed.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -b -r1.6 -r1.7
  --- Feed.java	27 Aug 2007 03:09:19 -0000	1.6
  +++ Feed.java	9 Nov 2007 15:02:07 -0000	1.7
  @@ -12,6 +12,7 @@
   
   @Entity
   @Table(name = "FEED")
  + at org.hibernate.annotations.BatchSize(size = 10)
   public class Feed implements Serializable {
   
       @Id
  
  
  



More information about the jboss-cvs-commits mailing list