Bonjour
J'ai un soucis à la création d'un OneToMany dans une entity.
Classe Portfolio :
Classe User :
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 @Entity public class Portfolio { @Id private Integer id; private User user; @ManyToOne @JoinColumn(name = "user_fk") public User getUser(){ return user; } public void setUser(User user){ this.user = user; } public void setId(Integer id) { this.id = id; } public Integer getId() { return id; }
Message d'erreur :
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 @Entity public class User { @Id private Integer id; private Collection<Portfolio> portfolios; @OneToMany(mappedBy = "user") public Collection<Portfolio> getPortfolios(){ return portfolios; } public void setPortfolios(Collection<Portfolio> portfolios){ this.portfolios = portfolios; } public void setId(Integer id) { this.id = id; } public Integer getId() { return id; }Merci d'avance pour votre aide.error due to the following reason(s): org.hibernate.MappingException: Could not determine type for: java.util.Collection, at table: User, for columns: [org.hibernate.mapping.Column(portfolios)]
Partager