[Struts/Hibernate] Problème de float à l'enregistrement
Bonjour,
Je fais une appli web à l'aide de Struts, Hibernate,Tomcat et Oracle et j'ai un souci à l'enregistrement de float : je perds l'info sur la partie décimale; c'est à dire si je veux enregistrer la valeur 23.12 il va enregistrer 23.0.
Ja'i une classe java Produit qui contient un attribut "prix" de type float:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| public class Produit {
------------
private float prix;
-----------
public float getPrix () {
return prix;
}
public void setPrix (float p) {
prix=p;
}
-------
} |
dans mon fichier de mapping hibernate j'ai :
Code:
1 2 3 4
|
<property name="prix" type="float">
<column name="prix" not-null="true"/>
</property> |
e dans ma table Oracle :
Code:
1 2 3 4 5 6 7
|
create table USER_MAGASIN (
------
prix float,
--------
) |
et dans ma page jsp j'ai le champ "prix":
Code:
td><html:text property="produit.prix" maxlength="20" size="10" /></td>
ou produit fait référence àl'objet produit de l'ActionForm
Si quelqu'un pouvait m'aider ca serai sympa.
Merci d'avance pour vos réponses.