tu lance ton application avec java ou javaw.exe? Si tu ne vois rien dans la console, tu ne vois probablement pas non plus l'exception qui te fait renvoyer une liste vide.
tu lance ton application avec java ou javaw.exe? Si tu ne vois rien dans la console, tu ne vois probablement pas non plus l'exception qui te fait renvoyer une liste vide.
moi je teste ma methode dans une jsp
Tout comme tes classes mappée, ta classe dialect doit être compilée et mise dans le classpath de ton "run" (j'ignore d'ailleurs de quoi il s'agit)
mais le problème c'est que je peux pas toucher à la structure de la table.
J'ai fais exactement ce que vous avez dit avec :
<generator class="assigned" /> sur un champs unique.
Mais quand je lance une requete pas de resultat![]()
faut voir
- le mapping
- la structure
- la requete hql
- le sql généré par hibernate (show_sql à true dans la config)
voila la structure de ma table :
Sachant que les types sont proprietaire à hyperfile.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5 UtilCode : text UtilPrenom : text UtilNom : text UtilPwd : text UtilGpe : text
Ma classe :
Mon fichier hbm.xml :
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89 public class Utilisateur implements java.io.Serializable { private String utilcode; private String utilprenom; private String utilnom; private String utilpwd; private String utilgpe; public Utilisateur() { } public Utilisateur(String utilcode, String utilprenom, String utilnom, String utilpwd, String utilgpe) { this.utilcode = utilcode; this.utilprenom = utilprenom; this.utilnom = utilnom; this.utilpwd = utilpwd; this.utilgpe = utilgpe; } /** * @return the utilcode */ public String getUtilcode() { return utilcode; } /** * @param utilcode the utilcode to set */ public void setUtilcode(String utilcode) { this.utilcode = utilcode; } /** * @return the utilprenom */ public String getUtilprenom() { return utilprenom; } /** * @param utilprenom the utilprenom to set */ public void setUtilprenom(String utilprenom) { this.utilprenom = utilprenom; } /** * @return the utilnom */ public String getUtilnom() { return utilnom; } /** * @param utilnom the utilnom to set */ public void setUtilnom(String utilnom) { this.utilnom = utilnom; } /** * @return the utilpwd */ public String getUtilpwd() { return utilpwd; } /** * @param utilpwd the utilpwd to set */ public void setUtilpwd(String utilpwd) { this.utilpwd = utilpwd; } /** * @return the utilgpe */ public String getUtilgpe() { return utilgpe; } /** * @param utilgpe the utilgpe to set */ public void setUtilgpe(String utilgpe) { this.utilgpe = utilgpe; } }
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 <?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd"> <!-- Generated 18 juin 2009 11:44:53 by Hibernate Tools 3.2.1.GA --> <hibernate-mapping> <class name="com.outilrequete.model.Utilisateur" table="R_utilisateur" catalog="Base"> <id name="utilcode" type="String"> <column name="UtilCode" /> <generator class="assigned" /> </id> <property name="utilprenom" type="string"> <column name="UtilPrenom" length="50" not-null="true" /> </property> <property name="utilnom" type="string"> <column name="UtilNom" length="50" not-null="true" /> </property> <property name="utilpwd" type="string"> <column name="UtilPwd" length="30" not-null="true" /> </property> <property name="utilgpe" type="string"> <column name="UtilGpe" length="30" not-null="true" /> </property> </class> </hibernate-mapping>
il manque:
- l'appel que tu fait
- le sql généré par hibernate
Partager