modification d'une date avec conversion vers mysql
Bonsoir , j'essaye de modifier une date , donc j'ai utiliser la méthode suivante:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
public void updateDate(Date date_form)
{
Session session = HibernateUtil.currentSession();
Transaction tx = session.beginTransaction();
String d=null;
SimpleDateFormat f = new SimpleDateFormat("YYYY-MM-dd HH:mm:ss");
d=f.format(date_form);
String hqlUpdate = "update t_formation set date_form = '"+ d +"'";
session.createQuery( hqlUpdate ).executeUpdate();
tx.commit();
session.close();
} |
et je l'ai appelé ici:
Code:
1 2 3 4 5 6
|
public String modiferDate()
{
formationdao.updateDate(formation.getDate_form());
return "Authentification";
} |
et j'obtiens l'erreur suivante:
t_formation is not mapped [update t_formation set date_form = '2013-05-12 04:35:00 ']
j'espère trouver quelqu'un pour m'aider, merci