NHibernate queries

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • tgadiche
    New Member
    • Aug 2007
    • 1

    #1

    NHibernate queries

    Hi,
    I have a database table called RackLocation which has a column called"isDrop" which is of type boolean. I'm trying to extract all those records from this table whose"isDrop" property is true.

    I used the following queries and none of them worked. Can someone please help me?

    IList RackLocation;
    bool prop = true;
    1. RackList = session.Find("f rom DBRackLocation as rack where rack.isDrop = ?", isDrop,NHiberna teUtil.Boolean) ;

    2. RackList = session.Find("f rom DBRackLocation as rack where rack.isDrop = '" + isDrop + "'");

    3.RackList = session.Find("f rom DBrackLocation as rack where rack.isDrop is true");

    4.RackList = session.Find("f rom DBRackLocation as rack where rack.isDrop is ?", isDrop, NHibernateUtil. Boolean);

    5.RackList = session.Find("f rom DBRackLocation as rack where rack.isDrop = True'");

    6.RackList = session.Find(fr om DBRackLocation as rack where rack.isDrop = ?",new object[] {prop}, new IType[] {NHibernateUtil .Boolean });

    7.RackList = session.Find((" from DBRackLocation as rack where rack.isDrop = ?"), new object[] {prop}, new NHibernate.Type .IType[] { NHibernateUtil. Boolean });

    Thanks,
    TG
Working...