These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Problème de requête BETWEEN avec Hibernate 3.0
PostPosted: Mon Jan 21, 2008 5:02 am 
Newbie

Joined: Fri Jan 04, 2008 4:23 am
Posts: 7
Bonjour,

Je cherche à savoir si je peux utiliser le type de requête suivante en Hibernate ?

Code:
if(date1.compareTo("") != 0 && date2.compareTo("") != 0)
                    {
                        session.beginTransaction();                             
                        result = session.createCriteria(classe)
                        .add(Restrictions.between("DDateEffective", stringToDate("01/12/2007"), stringToDate("04/12/2007")))               
                        .list();


Ce ne me renvoie rien alors qu'une requête tapée en ligne de commande : SELECT...FROM MATABLE WHERE D_DATE_EFFECTIVE BETWEEN '01/12/2007' AND '04/12/2007' me renvoie bien quelque chose.

Encore une précision: la base de données est ORACLE10g et le champ DDateEffective est de type java.util.Date. J'utilise la fonction "stringToDate()" pour convertir la chaine que je passe "JJ/MM/AAAA" en type Date mais ça ne change rien apparemment. Oracle ne doit pas savoir comment interpréter ?

Merci pour toute information complémentaire.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.