You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Mike Young <mi...@e-mage.com.au> on 2004/06/23 13:34:53 UTC

How to use criteria.addLessOrEqualThan(colname,date)

Hi,
I am trying to write a query to find all records from a table that have an
expiry date of less than or equal to todays date.

e.g. select col1,col2 from orders where expires <= "2003-06-23"

if I use ....

----- snip -----
  long currentTime = System.currentTimeMillis(); java.sql.Date
  sysdate = new java.sql.Date(currentTime-(currentTime % 86400000));

  try{
     // Build up criteria to query orders
     criteria.addLessOrEqualThan("expires",sysdate);

----- snip -----

then as soon as the criteria.addLessOrEqualThan line is run I get

	Unhandled Exception thrown: class java.lang.NullPointerException

anybody got any suggestions please?


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-user-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-user-help@db.apache.org