The code works if it is changed like below.
String strSql= "select E.* from Export E where E.CreationTime < ?";
DateTimeZone now = new DateTimeZone();
now.add(-60, TimeUnit.Days);
Iterator it = jcsSession.executeObjectQuery(strSql, new Object [] {new Long(now.getUTCMilliSecs())});
while (it.hasNext())
{
Export E = (Export) it.next();
if (E.getDescription()!= null)
{
jcsOut.println(E.getDescription());
E.deleteObject();
jcsSession.persist();
}
}
Regards,
Chandu
Add comment