Wednesday, September 15, 2010

javax.jdo.JDOException: Class Date for query has not been resolved.

You have to declare missing imports using query.declareImports(). Example:

Query query = pm.newQuery(
    "SELECT FROM " + Device.class.getCanonicalName() + " WHERE" +
    " lastSeen < dataExpireDate"
);
                 
query.declareImports("import java.util.Date");
query.declareParameters("Date dataExpireDate");

1 comment: