This week only. Pastebin PRO Accounts Christmas Special! Don't miss out!Want more features on Pastebin? Sign Up, it's FREE!
Guest

Document

By: a guest on Apr 26th, 2011  |  syntax: Java  |  size: 1.16 KB  |  views: 42  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. package br.ufpe.nti.usercase.domain;
  2.  
  3. import java.io.Serializable;
  4. import java.util.List;
  5.  
  6. import javax.persistence.CascadeType;
  7. import javax.persistence.Entity;
  8. import javax.persistence.FetchType;
  9. import javax.persistence.GeneratedValue;
  10. import javax.persistence.Id;
  11. import javax.persistence.OneToMany;
  12.  
  13. @Entity
  14. public class Document implements Serializable {
  15.  
  16.         private static final long serialVersionUID = 9001747747976134836L;
  17.  
  18.         @Id
  19.         @GeneratedValue
  20.         private Long id;
  21.         private String title;
  22.         @OneToMany(mappedBy="document", fetch = FetchType.LAZY, cascade = CascadeType.ALL)
  23.         private List<Usercase> usercases;
  24.  
  25.         public Document() {
  26.                 super();
  27.         }
  28.        
  29.         public Document(String title, List<Usercase> usercases) {
  30.                 super();
  31.                 this.title = title;
  32.                 this.usercases = usercases;
  33.         }
  34.  
  35.         public Long getId() {
  36.                 return id;
  37.         }
  38.  
  39.         public void setId(Long id) {
  40.                 this.id = id;
  41.         }
  42.  
  43.         public String getTitle() {
  44.                 return title;
  45.         }
  46.  
  47.         public void setTitle(String title) {
  48.                 this.title = title;
  49.         }
  50.  
  51.         public List<Usercase> getUsercases() {
  52.                 return usercases;
  53.         }
  54.  
  55.         public void setUsercases(List<Usercase> usercases) {
  56.                 this.usercases = usercases;
  57.         }
  58. }
clone this paste RAW Paste Data