4 Replies Latest reply on Feb 18, 2005 1:14 PM by Dzung Hoang

    Dynamic Query Search - @jboss.query

    Dzung Hoang Newbie

      I used the following EJB-QL in the dynamic query search (I tried it in finder method and it worked):

      "select object(a) from TestDateSchema as a where a.tstampDate > ?1 and a.tstampDate < ?2" --- where a.tstampDate is java.sql.Timestamp and two arguments (?1 = start date and ?2 = end date)...

      ...and here is the statement to get a collection...

      java.sql.Timestamp gotTimestamp;

      Collection lc = myBeanHome.getGeneric(jbossql.toString(), args);

      ...and Iteration and while loop...

      while(iter1.hasNext()){
      TestDateLocal mydate = (TestDateLocal)iter1.next();
      gotTimestamp = mydate.getTstampDate(); // This statement returns error
      } }

      TestDateLocal (extends EJBLocalObject) has the getTstampDate method and this method returns the following message:

      java.lang.NullPointerException
      at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:44)
      at $Proxy1.getKey(Unknown Source)
      at com.testdate.TestDateClient.testBean(TestDateClient.java:127)
      at com.testdate.TestDateClient.main(TestDateClient.java:145)


      I had checked entire EJBsrc folder for all files but I came up nothing...Please let me know if you have encountered this problem before.

      Thanks...