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