NutzCN Logo
问答 dao.insert凭空出现两个字段
发布于 2675天前 作者 tomcat 1962 次浏览 复制 上一个帖子 下一个帖子
标签:

@Inject
protected Dao dao;

@At
@Ok("json")
@AdaptBy(type = JsonAdaptor.class)
public Object register(@Param("..") NutMap map) {
NutMap resmap = new NutMap();
try {
log.debug("map::" + map);
Sys_member api = menberService.fetch(Cnd.where("phone", "=", map.get("phone")));
if (CheckUtils.isNotBlank(api))
return Result.error("fail");
Sys_member usr = new Sys_member();
usr.setAddress((String)map.get("address"));
// usr.setId(id);
usr.setId(null);
usr.setName((String)map.get("name"));
usr.setPhone((String)map.get("phone"));
usr.setPwd(Util.GetMD5Code(map.get("pwd").toString()));
usr.setIs_del("0");
usr = dao.insert(usr);
resmap.addv("code", 0);
System.out.println(api);
return Result.success("ok");
} catch (Exception e) {
return Result.error("fail");
}
}

log
[DEBUG] 2017-07-20 11:19:23,818 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) - SELECT * FROM sys_member_user WHERE phone=? LIMIT 0, 1
| 1 |
|-------------|
| 15542267521 |
For example:> "SELECT * FROM sys_member_user WHERE phone='15542267521' LIMIT 0, 1 "
E10ADC3949BA59ABBE56E057F20F883E
[DEBUG] 2017-07-20 11:19:37,378 org.quartz.impl.jdbcjobstore.DBSemaphore.obtainLock(DBSemaphore.java:107) - Lock 'STATE_ACCESS' is desired by: QuartzScheduler_defaultScheduler-2011-20170404JD1500520757168_ClusterManager
[DEBUG] 2017-07-20 11:19:37,379 org.quartz.impl.jdbcjobstore.StdRowLockSemaphore.executeSQL(StdRowLockSemaphore.java:92) - Lock 'STATE_ACCESS' is being obtained: QuartzScheduler_defaultScheduler-2011-20170404JD1500520757168_ClusterManager
[DEBUG] 2017-07-20 11:19:37,380 org.quartz.impl.jdbcjobstore.DBSemaphore.obtainLock(DBSemaphore.java:116) - Lock 'STATE_ACCESS' given to: QuartzScheduler_defaultScheduler-2011-20170404JD1500520757168_ClusterManager
[DEBUG] 2017-07-20 11:19:37,382 org.quartz.impl.jdbcjobstore.DBSemaphore.obtainLock(DBSemaphore.java:107) - Lock 'TRIGGER_ACCESS' is desired by: QuartzScheduler_defaultScheduler-2011-20170404JD1500520757168_ClusterManager
[DEBUG] 2017-07-20 11:19:37,383 org.quartz.impl.jdbcjobstore.StdRowLockSemaphore.executeSQL(StdRowLockSemaphore.java:92) - Lock 'TRIGGER_ACCESS' is being obtained: QuartzScheduler_defaultScheduler-2011-20170404JD1500520757168_ClusterManager
[DEBUG] 2017-07-20 11:19:37,386 org.quartz.impl.jdbcjobstore.DBSemaphore.obtainLock(DBSemaphore.java:116) - Lock 'TRIGGER_ACCESS' given to: QuartzScheduler_defaultScheduler-2011-20170404JD1500520757168_ClusterManager
[INFO ] 2017-07-20 11:19:37,386 org.quartz.impl.jdbcjobstore.JobStoreSupport.logWarnIfNonZero(JobStoreSupport.java:3583) - ClusterManager: detected 1 failed or restarted instances.
[INFO ] 2017-07-20 11:19:37,386 org.quartz.impl.jdbcjobstore.JobStoreSupport.clusterRecover(JobStoreSupport.java:3442) - ClusterManager: Scanning for instance "2011-20170404JD1500520637714"'s failed in-progress jobs.
[DEBUG] 2017-07-20 11:19:37,390 org.quartz.impl.jdbcjobstore.JobStoreSupport.logWarnIfNonZero(JobStoreSupport.java:3585) - ClusterManager: ......Freed 0 acquired trigger(s).
[DEBUG] 2017-07-20 11:19:37,390 org.quartz.impl.jdbcjobstore.JobStoreSupport.logWarnIfNonZero(JobStoreSupport.java:3585) - ClusterManager: ......Deleted 0 complete triggers(s).
[DEBUG] 2017-07-20 11:19:37,390 org.quartz.impl.jdbcjobstore.JobStoreSupport.logWarnIfNonZero(JobStoreSupport.java:3585) - ClusterManager: ......Scheduled 0 recoverable job(s) for recovery.
[DEBUG] 2017-07-20 11:19:37,390 org.quartz.impl.jdbcjobstore.JobStoreSupport.logWarnIfNonZero(JobStoreSupport.java:3585) - ClusterManager: ......Cleaned-up 0 other failed job(s).
[DEBUG] 2017-07-20 11:19:37,445 org.quartz.impl.jdbcjobstore.DBSemaphore.releaseLock(DBSemaphore.java:141) - Lock 'TRIGGER_ACCESS' returned by: QuartzScheduler_defaultScheduler-2011-20170404JD1500520757168_ClusterManager
[DEBUG] 2017-07-20 11:19:37,445 org.quartz.impl.jdbcjobstore.DBSemaphore.releaseLock(DBSemaphore.java:141) - Lock 'STATE_ACCESS' returned by: QuartzScheduler_defaultScheduler-2011-20170404JD1500520757168_ClusterManager
[DEBUG] 2017-07-20 11:19:37,445 org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager.manage(JobStoreSupport.java:3877) - ClusterManager: Check-in complete.
[DEBUG] 2017-07-20 11:19:38,437 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) - // NOT SQL // ElFieldMacro=$me.uid()
[DEBUG] 2017-07-20 11:19:38,439 org.nutz.plugins.cache.dao.CachedNutDaoExecutor.exec(CachedNutDaoExecutor.java:110) - Exception when parser SQL sql, skip cache detect!! SQL=RUN
[DEBUG] 2017-07-20 11:19:38,478 org.quartz.impl.jdbcjobstore.JobStoreSupport$ClusterManager.manage(JobStoreSupport.java:3877) - ClusterManager: Check-in complete.
[DEBUG] 2017-07-20 11:19:38,486 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) - // NOT SQL // ElFieldMacro=$me.now()
[DEBUG] 2017-07-20 11:19:38,487 org.nutz.plugins.cache.dao.CachedNutDaoExecutor.exec(CachedNutDaoExecutor.java:110) - Exception when parser SQL sql, skip cache detect!! SQL=RUN
[DEBUG] 2017-07-20 11:19:38,488 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) - // NOT SQL // ElFieldMacro=$me.flag()
[DEBUG] 2017-07-20 11:19:38,489 org.nutz.plugins.cache.dao.CachedNutDaoExecutor.exec(CachedNutDaoExecutor.java:110) - Exception when parser SQL sql, skip cache detect!! SQL=RUN
[DEBUG] 2017-07-20 11:19:38,573 org.nutz.dao.impl.sql.run.NutDaoExecutor.printSQL(NutDaoExecutor.java:388) - INSERT INTO sys_member_user(id,name,phone,pwd,address,is_del,opBy,opAt,delFlag) VALUES(?,?,?,?,?,?,?,?,?)
| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
|------|------|-------------|----------------------------------|------|---|--|------------|-------|
| NULL | test | 15542267521 | E10ADC3949BA59ABBE56E057F20F883E | this | 0 | | 1500520778 | false |
For example:> "INSERT INTO sys_member_user(id,name,phone,pwd,address,is_del,opBy,opAt,delFlag) VALUES('NULL','test','15542267521','E10ADC3949BA59ABBE56E057F20F883E','this','0','',1500520778,false) "
[DEBUG] 2017-07-20 11:19:38,636 org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:97) - SQLException
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown column 'opBy' in 'field list'
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
at com.mysql.jdbc.Util.getInstance(Util.java:408)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:943)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2501)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858)
at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1197)
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:2931)
at com.alibaba.druid.filter.FilterEventAdapter.preparedStatement_execute(FilterEventAdapter.java:440)
at com.alibaba.druid.filter.FilterChainImpl.preparedStatement_execute(FilterChainImpl.java:2929)
at com.alibaba.druid.proxy.jdbc.PreparedStatementProxyImpl.execute(PreparedStatementProxyImpl.java:131)
at com.alibaba.druid.pool.DruidPooledPreparedStatement.execute(DruidPooledPreparedStatement.java:493)
at org.nutz.dao.impl.sql.run.NutDaoExecutor._runPreparedStatement(NutDaoExecutor.java:308)
at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:90)
at org.nutz.plugins.cache.dao.CachedNutDaoExecutor._exec(CachedNutDaoExecutor.java:317)
at org.nutz.plugins.cache.dao.CachedNutDaoExecutor.exec(CachedNutDaoExecutor.java:187)
at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:66)
at org.nutz.dao.impl.interceptor.DaoLogInterceptor.filter(DaoLogInterceptor.java:22)
at org.nutz.dao.DaoInterceptorChain.doChain(DaoInterceptorChain.java:64)
at org.nutz.dao.DaoInterceptorChain.invoke(DaoInterceptorChain.java:139)
at org.nutz.dao.impl.sql.run.NutDaoRunner.runCallback(NutDaoRunner.java:158)
at org.nutz.dao.impl.sql.run.NutDaoRunner._runWithTransaction(NutDaoRunner.java:104)
at org.nutz.dao.impl.sql.run.NutDaoRunner._run(NutDaoRunner.java:88)
at org.nutz.dao.impl.sql.run.NutDaoRunner$1.run(NutDaoRunner.java:74)
at org.nutz.trans.Trans.exec(Trans.java:174)
at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:72)
at org.nutz.dao.impl.DaoSupport.run(DaoSupport.java:245)
at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:257)
at org.nutz.dao.impl.EntityOperator.exec(EntityOperator.java:55)
at org.nutz.dao.impl.NutDao.insert(NutDao.java:148)
at cn.wizzer.app.web.modules.controllers.open.api.test.ApiTestController.register(ApiTestController.java:100)
at cn.wizzer.app.web.modules.controllers.open.api.test.ApiTestController$FM$register$62a45dd556d0f42121639f961f8c6c2d.invoke(ApiTestController.java)
at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:31)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:33)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at cn.wizzer.app.web.commons.processor.XssSqlFilterProcessor.process(XssSqlFilterProcessor.java:35)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at cn.wizzer.app.web.commons.processor.NutShiroProcessor.process(NutShiroProcessor.java:52)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at cn.wizzer.app.web.commons.processor.GlobalsSettingProcessor.process(GlobalsSettingProcessor.java:36)
at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44)
at cn.wizzer.app.web.commons.processor.LogTimeProcessor.process(LogTimeProcessor.java:21)
at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44)
at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67)
at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31)
at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:202)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at cn.wizzer.app.web.commons.filter.RouteFilter.doFilter(RouteFilter.java:31)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:616)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:528)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1100)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:687)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1520)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1476)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)

3 回复

父类的属性吧

BaseModel 应该是三个属性

谢谢两位大佬,已解决,是BaseModel里面的属性我没注意到

添加回复
请先登陆
回到顶部