KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > test > joinfetch > Comment


1 //$Id: Comment.java,v 1.1 2005/05/16 12:08:03 oneovthafew Exp $
2
package org.hibernate.test.joinfetch;
3
4 import java.util.Calendar JavaDoc;
5
6 /**
7  * @author Gavin King
8  */

9 public class Comment {
10     
11     private String JavaDoc text;
12     private Item item;
13     private Calendar JavaDoc timestamp;
14     private Long JavaDoc id;
15
16     public Item getItem() {
17         return item;
18     }
19     public void setItem(Item item) {
20         this.item = item;
21     }
22     public Calendar JavaDoc getTimestamp() {
23         return timestamp;
24     }
25     public void setTimestamp(Calendar JavaDoc timestamp) {
26         this.timestamp = timestamp;
27     }
28     
29     Comment() {}
30     public Comment(Item item, String JavaDoc comment) {
31         this.text = comment;
32         this.item = item;
33         item.getComments().add(this);
34         this.timestamp = Calendar.getInstance();
35     }
36     public Long JavaDoc getId() {
37         return id;
38     }
39     public void setId(Long JavaDoc id) {
40         this.id = id;
41     }
42     public String JavaDoc getText() {
43         return text;
44     }
45     public void setText(String JavaDoc text) {
46         this.text = text;
47     }
48
49 }
50
Popular Tags