Bonjour à tous,

Je suis débutant dans l'utilisation d'hibernate.

J'ai une application dont j'aimerais sauvegarder des objets dans une BDD.

J'ai installé Hibernate 3.3.2 + Hibernate tools (utilisant Eclipse) et je n'arrive pas à "exporter" une classe dans ma BDD de manière 'automatique'.

J'ai cru comprendre qu'il fallait mapper ma classe. J'aurais préféré laisser hibernate le faire tout seul (ou un outil annexe), mais pas moyen d'y parvenir.

J'ai tenter la technique du MapGenerator de la FAQ mais il semblerait que c'était pour la version 2 d'hibernate.

J'ai tenté la technique de new Hibernate XML Mapping File, en partant de la classe sélectionné, mais ça ne génère pas automatiquement les attributs.

Quelqu'un aurait-il la solution à mon problème?

Merci d'avance


Classe à mapper :
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
 
package blabla;
 
import java.util.Date;
 
public class IndexData {
 
	private Date date;
	private Float phelix1;
	private Float phelix2;
	private Float dayBase1;
	private Float dayBase2;
 
	public IndexData(Date date,Float phelix1,Float phelix2, Float dayBase1, Float dayBase2){
		this.date=date;
		this.phelix1=phelix1;
		this.phelix2=phelix2;
		this.dayBase1=dayBase1;
		this.dayBase2=dayBase2;
	}
 
	public Date getDate() {
		return date;
	}
 
	public void setDate(Date date) {
		this.date = date;
	}
 
	public Float getPhelix1() {
		return phelix1;
	}
 
	public void setPhelix1(Float phelix1) {
		this.phelix1 = phelix1;
	}
 
	public Float getPhelix2() {
		return phelix2;
	}
 
	public void setPhelix2(Float phelix2) {
		this.phelix2 = phelix2;
	}
 
	public Float getDayBase1() {
		return dayBase1;
	}
 
	public void setDayBase1(Float dayBase1) {
		this.dayBase1 = dayBase1;
	}
 
	public Float getDayBase2() {
		return dayBase2;
	}
 
	public void setDayBase2(Float dayBase2) {
		this.dayBase2 = dayBase2;
	}
 
	public String toString(){
		String retour="";
		retour+="Date : "+date+"\n";
		retour+="Phelix1 : "+phelix1+"\n";
		retour+="Phelix2 : "+phelix2+"\n";
		retour+="DayBase1 : "+dayBase1+"\n";
		retour+="DayBase2 : "+dayBase2+"\n";
		return retour;
	}
 
}