Bonjour,

Je suis en train de développer ma première vraie web application sur netbeans.
j'ai une table dont l'entrée des données se fait en deux phases:
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.catmas.data.fournisseur;
 
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
 
/**
 *
 * @author dsf
 */
@Entity
@Table(name = "commande")
public class Commande implements Serializable {
 
    private static final long serialVersionUID = 1L;
 
    @Id
    private CommandePk commandePk;
    @Basic(optional = false)
    @Column(name = "idcmd", nullable = false, insertable = false, updatable = false)
    private String idcmd;
    @Column(name = "intitule")
    private String intitule;
    @Column(name = "observ")
    private String observ;
    @Column(name = "transport")
    private Double transport;
    @Column(name = "divers")
    private Double divers;
    @Column(name = "transit")
    private Double transit;
    @Column(name = "transitaire")
    private String transitaire;
    @Column(name = "douane")
    private Double douane;
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date datelance;
    @Column(name = "dateprevu")
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date dateprevu;
    @Column(name = "dateeffect")
    @Temporal(javax.persistence.TemporalType.DATE)
    private Date dateeffect;
    @Basic(optional = false)
    @JoinColumn(name = "numprod", referencedColumnName = "idprod", insertable = false, updatable = false)
    @ManyToOne(optional = false, fetch = FetchType.LAZY)
    private Produit idprod;
 
    public Commande() {
    }
 
    public Commande(CommandePk commandePk) {
        this.commandePk = commandePk;
    }
 
    public CommandePk getCommandePk() {
        return commandePk;
    }
 
    public void setCommandePk(CommandePk commandePk) {
        this.commandePk = commandePk;
    }
 
 
 
    public Double getDivers() {
        return divers;
    }
 
    public void setDivers(Double divers) {
        this.divers = divers;
    }
 
    public Double getTransit() {
        return transit;
    }
 
    public void setTransit(Double transit) {
        this.transit = transit;
    }
 
    public String getTransitaire() {
        return transitaire;
    }
 
    public void setTransitaire(String transitaire) {
        this.transitaire = transitaire;
    }
 
    public String getIdcmd() {
        return idcmd;
    }
 
    public void setIdcmd(String idcmd) {
        this.idcmd = idcmd;
    }
 
    public String getIntitule() {
        return intitule;
    }
 
    public void setIntitule(String intitule) {
        this.intitule = intitule;
    }
 
    public String getObserv() {
        return observ;
    }
 
    public void setObserv(String observ) {
        this.observ = observ;
    }
 
 
 
    public Double getTransport() {
        return transport;
    }
 
    public void setTransport(Double transport) {
        this.transport = transport;
    }
 
    public Double getDouane() {
        return douane;
    }
 
    public void setDouane(Double douane) {
        this.douane = douane;
    }
 
    public Date getDatelance() {
        return datelance;
    }
 
    public void setDatelance(Date datelance) {
        this.datelance = datelance;
    }
 
    public Date getDateprevu() {
        return dateprevu;
    }
 
    public void setDateprevu(Date dateprevu) {
        this.dateprevu = dateprevu;
    }
 
    public Date getDateeffect() {
        return dateeffect;
    }
 
    public void setDateeffect(Date dateeffect) {
        this.dateeffect = dateeffect;
    }
 
    public Produit getIdprod() {
        return idprod;
    }
 
    public void setIdprod(Produit idprod) {
        this.idprod = idprod;
    }
 
    @Override
    public int hashCode() {
        int hash = 3;
        hash = 97 * hash + (this.commandePk != null ? this.commandePk.hashCode() : 0);
        return hash;
    }
 
    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Commande other = (Commande) obj;
        if (this.commandePk != other.commandePk && (this.commandePk == null || !this.commandePk.equals(other.commandePk))) {
            return false;
        }
        return true;
    }
 
}
la premiere entrée se fait via la methode
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
public String enregistrerCommande() {
        if (StringUtils.isEmpty(commande.getIdcmd())) {
            MessagesJsf.addErrorMessage("Saisir le numéro de la commande");
            return null;
        }
        if (StringUtils.isEmpty(idprodC)) {
            MessagesJsf.addErrorMessage("Saisir le numéro du produit");
            return null;
        }
        if (!fournisseurService.enregistrer(commande, nouveauCommande, idprodC)) {
            MessagesJsf.addErrorMessage("La commande ne peut pas être enregistrée");
            return null;
        }
        if (listeCommande == null) {
            listeCommande = new ArrayList<Commande>();
        }
        if (nouveauCommande) {
            if (listeCommande == null) {
                listeCommande = new ArrayList<Commande>();
            }
            listeCommande.add(commande);
        }
        nouveauCommande();
        MessagesJsf.addInfoMessage("Opération exécutée avec succès");
        return null;
    }
qui marche très bien. Le problème est que les autres informations telle que la "douane" doivent etre entrées dans la deuxieme phase avec un update table. Mais je ne sais pas comment le faire.

Merci de m'aider à resoudre mon problème.