-->
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: Query by example mixed with criteria
PostPosted: Wed Jun 01, 2005 10:57 am 
Regular
Regular

Joined: Thu May 12, 2005 10:12 am
Posts: 71
Location: Buenos Aires, Argentina
Hi,

I had a doubt how to use QBE and Criteria. Suppose I have an object with a Date property. So I end having an object like this

Code:
public class Foo
{
    //private methods and constructor omitted
   public DateTime PointInTime
   {
       get {return mPointInTime;}
       set {mPointInTime = value;}
   }
}


To create a QBE later I do

Code:

Foo f = new Foo()
f.PointInTime = DateTime.Now

ISession session = NHContext.Current.NHibernateSession

Example expample = Example.Create(f).

session.CreateCriteria(f.GetType()).Add(example)


What I dont know is if it is possible to add to the QBE a criteria to be able to retrieve all Foo that have a PointInTime smaller than the one provided in the Foo example. Also, if it is even advisable to use this for a search dialog.

Thanks


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.