SHARE
TWEET

Untitled

a guest Jan 13th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @Entity
  2. @Table(name="tblSurvey")
  3. public class Survey {
  4.     @Id
  5.     @Column(name="SurveyID")
  6.     private int surveyID;
  7.     @Column(name="Name")
  8.     private String surveyName;
  9.  
  10.     @OneToMany(fetch = FetchType.EAGER, mappedBy = "surveyID", cascade=CascadeType.ALL)
  11.     private List<Question> questionSet;
  12.    
  13.     konstruktor + gettery + settery
  14. }
  15.  
  16.  
  17.  
  18. @Entity
  19. @Table(name="tblQuestion")
  20. public class Question {
  21.     @Id
  22.     //@OneToMany(fetch = FetchType.EAGER, mappedBy = "surveyID", cascade=CascadeType.ALL)
  23.     @Column(name="QuestionID")
  24.     private int questionID;
  25.  
  26.     //@Column(name="SurveyID")
  27.     @ManyToOne
  28.     @JoinColumn(name="SurveyID")
  29.     private int surveyID;
  30.  
  31.     @Column(name="Question")
  32.     private String questionText;
  33.  
  34.     konstruktor + gettery + settery
  35. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top