Difference between revisions of "JEE5 Sample"
(→Resourcen) |
|||
Line 1: | Line 1: | ||
Download [http://www.claude-glauser.ch/j2ee/jee5sample/WebLearingPlatformEAR.zip NetBeans Projekt] | Download [http://www.claude-glauser.ch/j2ee/jee5sample/WebLearingPlatformEAR.zip NetBeans Projekt] | ||
+ | |||
+ | == JSF == | ||
+ | |||
+ | == EJB3 == | ||
+ | |||
+ | == JPA == | ||
+ | === Bikirektionale One To Many Beziehung === | ||
+ | |||
+ | In der Klasse Question.java | ||
+ | <source lang="java5"> | ||
+ | @OneToMany(mappedBy="question", cascade = {CascadeType.PERSIST, CascadeType.MERGE} ) | ||
+ | private List<QuestionOption> options = new ArrayList<QuestionOption>(); | ||
+ | </source> | ||
+ | |||
+ | In der Klasse QuestionOption.java | ||
+ | |||
+ | |||
+ | <source lang="java5"> | ||
+ | @ManyToOne(optional=false, fetch = FetchType.EAGER) | ||
+ | @JoinColumn(name="questionid", nullable=false) | ||
+ | private Question question; | ||
+ | </source> | ||
Revision as of 15:53, 23 January 2009
Download NetBeans Projekt
JSF
EJB3
JPA
Bikirektionale One To Many Beziehung
In der Klasse Question.java
@OneToMany(mappedBy="question", cascade = {CascadeType.PERSIST, CascadeType.MERGE} )
private List<QuestionOption> options = new ArrayList<QuestionOption>();
In der Klasse QuestionOption.java
@ManyToOne(optional=false, fetch = FetchType.EAGER)
@JoinColumn(name="questionid", nullable=false)
private Question question;