Bonjour,
j'essaie de suivre un exemple sur le net et j'ai crée une premiere classe entity bean qui est al suivante:
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66 import java.io.Serializable; import javax.persistence.*; @Entity @Table(name="book") @SequenceGenerator(name = "book_sequence", sequenceName = "book_id_seq") @TableGenerator( name="book_id", table="primary_keys", pkColumnName="key", pkColumnValue="book", valueColumnName="value") public class Book implements Serializable { /** * */ //private static final long serialVersionUID = 7422574264557894633L; private Integer idbook; private String title; private String author; public Book() { super(); } public Book(Integer id, String title, String author) { super(); this.idbook = id; this.title = title; this.author = author; } @Override public String toString() { return "Book: " + getId() + " Title " + getTitle() + " Author " + getAuthor(); } public String getAuthor() { return author; } public void setAuthor(String author) { this.author = author; } @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "book_sequence") public Integer getId() { return idbook; } public void setId(Integer id) { this.idbook = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } }
sauf que le compilateur pointe sur la ligne @Table et m'indique l'erreur suivante: "The table book cannot be found on the database" ...je en comprends pourtant pas c'est quoi la raison sachant que mon fichier persistence.xml est le suivant:
et j'utilise une base mysql qui est bien ptresente et exploitable puisque ej me connecte dessus, et en plus ej peux la visulaiser avec l'outil DB explorer ( j'utilise MyEclipse 6)
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9 <persistence> <persistence-unit name="FirstEjb3Tutorial"> <jta-data-source>java:/ejb3ExampleDS</jta-data-source> <properties> <property name="hibernate.hbm2ddl.auto" value="create-drop"/> </properties> </persistence-unit> </persistence>
je en comprends pas pourquoi cette anomalie?
je suis bloqué !!
merci
Partager