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

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.

你可能感兴趣的:(Hibernate,jpa,测试,Class,文档,performance)