title: HQL Select using Date as criteria error
body: <p>In HQL, I am trying to use date as a criteria get some data but i am getting an error:</p>
  
  <p>Code:</p>
  
  <pre><code>Date DatePlaced=new Date();
          auction.setDatePlaced(DatePlaced);
          auction.setUser((Users) getThreadLocalRequest().getSession(true).getAttribute("User"));
          UpdateDatabase(auction);
          Session session = gileadHibernateUtil.getSessionFactory().openSession();
          Long UserId=(Long) getThreadLocalRequest().getSession(true).getAttribute("UserId");
          String HQL="From Auction auction where User.UserId="+UserId +" and DatePlaced='"+DatePlaced+"'";
          Auction A1=(Auction) session.createQuery(HQL).list().get(0);
  
  
  Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
      at java.util.ArrayList.RangeCheck(ArrayList.java:547)
      at java.util.ArrayList.get(ArrayList.java:322)
      at com.BiddingSystem.server.ServiceImpl.UpdateAuction(ServiceImpl.java:543)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at net.sf.gilead.gwt.PersistentRemoteService.processCall(PersistentRemoteService.java:174)
  </code></pre>
  
  <p>What is happening here is mainly due to the date but because no data has been found because the date does not match but the data being used to search is the same date i have set above so 1 row should have been returned</p>