Hibernate中以Annotation方式动态更新字段

    技术2025-10-29  5

    JPA  Annotation的Entity里面没有提供,使用Hibernate的Entity即可。

     

     

     

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

     

     

    hibernate-distribution-3.6.0.Final下测试通过

     

    同理动态插入时dynamicInsert = true即可。

     

     

     

    Hibernate文档里有写:

     

    Hibernate goes beyond the JPA specification and provide additional configurations. Some of them are hosted on @org.hibernate.annotations.Entity.

     

    另外也特别提醒了

     

    Although these settings can increase performance in some cases, they can actually decrease performance in others.

    最新回复(0)