-->
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: How do I say “lic_expiry_date is null “ in hibernet quer
PostPosted: Tue Jul 03, 2007 10:05 pm 
Newbie

Joined: Tue Jul 03, 2007 9:53 pm
Posts: 2
hibernate-3.2:
I want to write the following query:

Code:
select * from efi_license_type where lic_expiry_date is null

That will return all rows that has lic_expiry_date is null.

Code:
      public static List<EfiLicenseType> getActiveEfiLicenseTypeList(){

            List<EfiLicenseType> efiLicenseTypeList = null;

            try {

                  Query q = HibernateUtil.currentSession().createQuery(

                              "from EfiLicenseType " +

                              "where licExpiryDate is :licExpiryDate " +

                              "order by licTypeId asc ");

                  //GregorianCalendar licExpiryDate = new GregorianCalendar();

                    GregorianCalendar licExpiryDate = null;

                  q.setCalendar("licExpiryDate", licExpiryDate);

                  //q.setCalendar("licExpiryDate", null);

                  efiLicenseTypeList = q.list();

            } catch (HibernateException ex) {

                  throw new InfrastructureException(ex);

            }

            return efiLicenseTypeList;

      }


Thanks

Naz
Code:
Code:


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.