Git Product home page Git Product logo

Comments (2)

a466350665 avatar a466350665 commented on September 24, 2024

看一下数据库表ID有没有设置自增长

from smart-sso.

kafeihouye avatar kafeihouye commented on September 24, 2024

设置了自增长的。debug了2天,后来才发现是dubbo service 调用的原因。然后在service层调用dao层时保存数据后,再对象.getId() 将主键返回就行了,居然它不自动装载到对象里。例如Service层的代码:public Integer insertSelective(T entity){return dao.insertXz(entity);} 修改为public Integer insertSelective(T entity){dao.insertXz(entity);return entity.getId();} 这样就行了。将之前的返回的受影响的行数变为主键ID即可,不知道为什么在Service层entity不自动装载,我猜测也许就是Dubbo的原因。。哈哈,反正问题是解决了,谢谢楼主回答

from smart-sso.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.