salut

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
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
public class Lodger implements Serializable {
 
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long lodgerId;
 
    @OneToOne
    private LodgerStatus lodgerStatus;
 
    private LocalDate entryDate;
 
    private LocalDate releaseDate;
 
    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "lodger", orphanRemoval = true)
    private List<IdentityCard> identityCardList;
 
    @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true)
    private OldAddress oldAddress;
 
    @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
    private Vehicle vehicle;
 
    @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY, orphanRemoval = true)
    private Phone phone;
 
    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "lodger", orphanRemoval = true)
    private List<Appointment> appointmentList;
 
    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "lodger", orphanRemoval = true)
    private List<Reference> referenceList;
 
    @OneToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, fetch = FetchType.LAZY, mappedBy = "lodger", orphanRemoval = true)
    @OrderBy
    private List<Bail> bailList;
 
    @OneToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, fetch = FetchType.LAZY, mappedBy = "lodger", orphanRemoval = true)
    private List<AccountOperation> accountOperationList;
 
    @ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE}, mappedBy = "lodger")
    private List<Contact> contactList;
 
    @OneToMany(fetch = FetchType.LAZY)
    private List<Consultation> consultationList;
 
    @OneToOne(mappedBy = "lodger", fetch = FetchType.LAZY)
    private Drug drug;
 
    @OneToOne(fetch = FetchType.LAZY, mappedBy="lodger")
    private RentAmount rentAmount;
}
j'ai fait la requête jpl suivante
Code : Sélectionner tout - Visualiser dans une fenêtre à part
select l from Lodger l where l.birthdate != null and l.releaseDate is null and substring(l.birthdate,6,2)=:month and substring(l.birthdate,9,2)=:day
or plus de 255 requêtes a lieu

l'implémentation que j'utilise est hibernate, j'utilise spring, spring data.

Tous est en lazy, je ne comprend pas pourquoi il y a autant de requête...