java - Can the input parameters of Spring Data Jpa update operation be passed in as objects?
漂亮男人
漂亮男人 2017-05-17 10:04:29
0
1
693

For example, the following code

    @Query("update BbsPost b set b.content = ?2,b.updateTime = current_timestamp where b.id = ?1")
    @Modifying
    void updatePostContent(Integer id, String content);

The id and content are attributes of the object Book. Can I define the input parameter as Book, just like

void updatePostContent(Book book);

If possible, how to write my update sql?

漂亮男人
漂亮男人

reply all(1)
漂亮男人

Currently modification operations are not possible, only queries can use SPEL expressions.
Official example: https://spring.io/blog/2014/0...

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!