安照NutzBook教程添加任务类,一直是以下提示
@Inject
protected Dao dao;
public void execute(JobExecutionContext context) throws JobExecutionException {
log.debug("clean Non-Active User , start");
Date deadtime = new Date(System.currentTimeMillis() - 60*1000L); // 一天, 测试的时候可以改成1小时之类的
Cnd cnd = Cnd.where("userId", ">", 3).and("createTime", "<", deadtime).and(Cnd.exps("emailChecked", "=", false).or("email", "IS", null));
int deleted = dao.clear(UserProfile.class, cnd);
log.debugf("delete %d UserProfile", deleted);
Sql sql = Sqls.create("delete from $user_table where id > 10 and not exists (select 1 from $user_profile_table where $user_table.id = uid ) and ct < @deadtime");
sql.vars().set("user_table", dao.getEntity(User.class).getTableName());
sql.vars().set("user_profile_table", dao.getEntity(UserProfile.class).getTableName());
sql.params().set("deadtime", deadtime);
dao.execute(sql);
log.debugf("delete %d User", sql.getUpdateCount());
log.debug("clean Non-Active User , Done");
}
[DEBUG] 16:18:00.007 org.nutz.ioc.loader.combo.ComboIocLoader.load(ComboIocLoader.java:163) - Found IocObject(cleanNonActiveUserJob) in AnnotationIocLoader(packages=[com.gree])
[DEBUG] 16:18:00.007 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:215) - >> Make...'cleanNonActiveUserJob'<class com.gree.quartz.job.CleanNonActiveUserJob>
[DEBUG] 16:18:00.007 org.nutz.ioc.impl.ScopeContext.save(ScopeContext.java:64) - Save object 'cleanNonActiveUserJob' to [app]
[DEBUG] 16:18:00.008 org.nutz.ioc.aop.impl.DefaultMirrorFactory.getMirror(DefaultMirrorFactory.java:70) - Load class com.gree.quartz.job.CleanNonActiveUserJob without AOP
[DEBUG] 16:18:00.013 com.gree.quartz.job.CleanNonActiveUserJob.execute(CleanNonActiveUserJob.java:33) - clean Non-Active User , start
[DEBUG] 16:19:00.001 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:157) - Get 'cleanNonActiveUserJob'<class com.gree.quartz.job.CleanNonActiveUserJob>
[DEBUG] 16:19:00.003 com.gree.quartz.job.CleanNonActiveUserJob.execute(CleanNonActiveUserJob.java:33) - clean Non-Active User , start
[DEBUG] 16:20:00.001 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:157) - Get 'cleanNonActiveUserJob'<class com.gree.quartz.job.CleanNonActiveUserJob>
[DEBUG] 16:20:00.002 com.gree.quartz.job.CleanNonActiveUserJob.execute(CleanNonActiveUserJob.java:33) - clean Non-Active User , start