Pour contrer mon problème d'update j écris une requête en hql, cependant je ne sais pas comment définir la partie qui contient un @OneToMany

j ai pour l instant ceci

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 
String hql = "UPDATE Localisation SET lieuDit=:lieuDit, coordonneeX=:coordonneeX, coordonneeY=:coordonneeY, provenanceCoordonnees=:provenanceCoordonnees, noSecteur=:noSecteur, noParcelle=:noParcelle, noDetache=:noDetache, surfaceParcelle=:surfaceParcelle, adresse.id=:adresseId WHERE id=:id";
Session session = getSession();
session.getSessionFactory().openSession();
Transaction transaction = session.beginTransaction();
Query query = session.createQuery(hql);
query.setLong("id", parcelle.getId());
query.setString("lieuDit", parcelle.getLieuDit());
query.setInteger("coordonneeX", parcelle.getCoordonneeX());
query.setInteger("coordonneeY", parcelle.getCoordonneeY());
query.setString("provenanceCoordonnees", parcelle.getProvenanceCoordonnees());
query.setString("noSecteur", parcelle.getNoSecteur());
query.setString("noParcelle", parcelle.getNoParcelle());
query.setString("noDetache", parcelle.getNoDetache());
query.setString("surfaceParcelle", parcelle.getSurfaceParcelle());
query.setLong("adresse.id", parcelle.getAdresse().getId());
int rowCount = query.executeUpdate();
LOG.debug("Rows affected: " + rowCount);
mais mon entité possède ceci

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
 
@OneToMany(fetch = FetchType.EAGER)
@Cascade ((org.hibernate.annotations.CascadeType.ALL))
private Set<Localisation> parcellesDetachees;
comment faire pour mettre à jour mes entités Localisation ?

d'avance merci