Encore une nouvelle erreure de mapping
voici mes tables
Mon entity Message contient
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 DROP TABLE IF EXISTS `type`; CREATE TABLE `type` ( `id_type` int(4) NOT NULL AUTO_INCREMENT, `text` text NOT NULL, PRIMARY KEY (`id_type`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS `lang`; CREATE TABLE `lang` ( `id_lang` int(4) NOT NULL AUTO_INCREMENT, `name` text NOT NULL, PRIMARY KEY (`id_lang`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1; DROP TABLE IF EXISTS `message`; CREATE TABLE `message` ( `id_message` int NOT NULL, `text` text NOT NULL, `ref_type` int(4), `ref_lang` int(2) NOT NULL, FOREIGN KEY `FK_MESSAGE_TYPE` (`ref_type`) REFERENCES `type` (`id_type`), PRIMARY KEY (`id_message`,`ref_lang`), FOREIGN KEY `FK_MESSAGE_LANG` (`ref_lang`) REFERENCES `lang` (`id_lang`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Problème quand je déploie :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 @Lob @Column(name = "text", nullable = false) private String text; @JoinColumn(name = "ref_type", referencedColumnName = "id_type") @ManyToOne private Type refType; @JoinColumn(name = "ref_lang", referencedColumnName = "id_lang") @ManyToOne private Lang lang;
En sachant que dans Lang j ai bien
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3 Column name ref_lang of com.recordz.ejb.entity.Message not found in JoinColumns.referencedColumnName org.hibernate.AnnotationException: Column name ref_lang of com.recordz.ejb.entity.Message not found in JoinColumns.referencedColumnName
Quelqu un aurait une idée ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 @Id @Column(name = "id_lang", nullable = false) private Integer idLang;





Répondre avec citation
Partager