Giter VIP home page Giter VIP logo

Comments (3)

misty000 avatar misty000 commented on June 3, 2024
    <fenix id="insertBlogs">
        INSERT INTO test.t_blog (c_id, c_title, c_content)
        VALUES
        @foreach{item : blogs}
            ( #{ item.id }, #{ item.title }, #{ item.content } )
        @end{','}
    </fenix>
    @Modifying
    @QueryFenix(nativeQuery = true)
    void insertBlogs(@Param("blogs") List<Blog> blogs);

from fenix.

blinkfox avatar blinkfox commented on June 3, 2024

Fenix 中的 #{} 是编译期间替换的,MVEL 模板引擎是识别不了 #{} 的,你把 #{} 换成 @{} 才行。但是,这样也不是占位符形式的。目前是暂时无法实现 @foreach 方式的占位符形式参数了,因为无法在 MVEL 运行期间去替换字符串数据。

JPA 的批量保存直接调用 saveAll 就行了吧,不需要使用这种 MyBatis 里面的原生写法。

from fenix.

blinkfox avatar blinkfox commented on June 3, 2024

大家可以用 2.4.0 版本,Fenix 中新增的更高效的批量增删改的几个方法哈,效率上相比之前的 saveAll 有很大幅度的提升。

from fenix.

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.