Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

Source code: org/hibernate/test/lazycache/Document.java


1   //$Id: Document.java 7772 2005-08-05 23:03:46Z oneovthafew $
2   package org.hibernate.test.lazycache;
3   
4   import java.util.Date;
5   
6   /**
7    * @author Gavin King
8    */
9   public class Document {
10    
11    private Long id;
12    private String name;
13    private String upperCaseName;
14    private String summary;
15    private String text;
16    private Date lastTextModification;
17    
18    public Document(String name, String summary, String text) {
19      lastTextModification = new Date();
20      this.name = name;
21      upperCaseName = name.toUpperCase();
22      this.summary = summary;
23      this.text = text;
24    }
25    
26    Document() {}
27    
28    public Date getLastTextModification() {
29      return lastTextModification;
30    }
31  
32    /**
33     * @return Returns the id.
34     */
35    public Long getId() {
36      return id;
37    }
38    /**
39     * @param id The id to set.
40     */
41    public void setId(Long id) {
42      this.id = id;
43    }
44    /**
45     * @return Returns the name.
46     */
47    public String getName() {
48      return name;
49    }
50    /**
51     * @param name The name to set.
52     */
53    public void setName(String name) {
54      this.name = name;
55    }
56    /**
57     * @return Returns the summary.
58     */
59    public String getSummary() {
60      return summary;
61    }
62    /**
63     * @param summary The summary to set.
64     */
65    public void setSummary(String summary) {
66      this.summary = summary;
67    }
68    /**
69     * @return Returns the text.
70     */
71    public String getText() {
72      return text;
73    }
74    /**
75     * @param text The text to set.
76     */
77    private void setText(String text) {
78      this.text = text;
79    }
80    /**
81     * @return Returns the upperCaseName.
82     */
83    public String getUpperCaseName() {
84      return upperCaseName;
85    }
86    /**
87     * @param upperCaseName The upperCaseName to set.
88     */
89    public void setUpperCaseName(String upperCaseName) {
90      this.upperCaseName = upperCaseName;
91    }
92    
93    public void updateText(String newText) {
94      if ( !newText.equals(text) ) {
95        this.text = newText;
96        lastTextModification = new Date();
97      }
98    }
99    
100 }