Correction examen architecture n-tiers Java EE[juin 2016].pdf

This preview shows page 1 - 2 out of 2 pages.

Exercice 1 : (13 points) Question Réponse Note 1 @Entity @Table(name= ‘’t_evenement’’)@Id @GeneratedValue(strategy= GenerationType.IDENTITY) @Column(name="adresseEvenement") @Temporal(TemporalType.DATE) @ManyToMany(mappedBy="evenements") @Entity @Table(name="t_participant") @Id @GeneratedValue(strategy =GenerationType.IDENTITY) @ManyToMany 1 1 PS : attribuer (0/1) si létudiant n’a pas mis l’une des annotations « en gras » 2 Interface serializable : 1 3 @Enumerated 0.5 4 @PersistenceContext em.persist(evenement); em.remove(em.merge(evenement)); 0.5 0.5 1 5 Rôle du contexte de persistance : 1 6 Attached 0.5 7 Detached 0.5 8 Flush () 0.5 9 evenement.setDate(date); em.merge(evenement); 0.5 0.5 10 if (p.getEvenements() == null) { p.setEvenements(new ArrayList<Evenement>()); } p.getEvenements().add(e); em.merge(p); 0.5

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture