Redundant data in update statements

前端 未结 2 763
逝去的感伤
逝去的感伤 2020-12-01 09:45

Hibernate generates UPDATE statements, which include all columns, regardless of whether I\'m changing the value in that columns, eg:

tx.begin();         


        
2条回答
  •  臣服心动
    2020-12-01 10:32

    You can use hibernate annotation @Entity:

    @org.hibernate.annotations.Entity(dynamicUpdate = true)
    public class Item
    

    This will update only the changed fields.

提交回复
热议问题