-->
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: Requête IQuery
PostPosted: Thu Jun 15, 2006 5:33 am 
Newbie

Joined: Thu Jun 15, 2006 5:27 am
Posts: 13
Bonjour, je suis nouveau sur Hibernate mais j'utilise la version NHibernate.
En fait, j'ai fait un exemple de mapping objet/relationnel avec NHibernate sous .NET et ça s'est bien passé (Console Application).

Je voulais mainteant faire un exemple web, mais j'ai des soucis avec des requêtes.

J'ai la requête suivante mais je ne comprends pas pourquoi la sélection ne se fait pas bien. Auparavant, le requête s'exécutait bien avec session.Find() mais depuis que j'utilise session.CreateQuery() avec la clause "where", j'ai l'affichage de toutes les données sans la prise en compte de where:
Code:
public void PrintEntries(DateTime date, GridView gv)
        {
            using (ISession session = sessionFactory.OpenSession())
            using (ITransaction tx = session.BeginTransaction())
            {
                IQuery cq = session.CreateQuery("from Collabs as c where c.Date < :Date");
                cq.SetDateTime("Date", date);
                gv.DataSource = cq.List();
                gv.DataBind();
                tx.Commit();
            }
        }


Code:
agence.PrintEntries(DateTime.Parse("21 / 03 / 2006"), GridView1);


J'ai besoin d'aide SVP merci.


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.