当前位置: 代码迷 >> Java Web开发 >> hibernate JPA 中引语version的用法
  详细解决方案

hibernate JPA 中引语version的用法

热度:637   发布时间:2016-04-14 21:10:20.0
hibernate JPA 中注解version的用法
请使用过的人讲解一下,不要从jpa的注解帮助文档直接copy,那不是我需要的,
------解决思路----------------------
有帮助文档还看不懂 要怎么帮你?
------解决思路----------------------
引用
This annotation specifies the version field or property of an entity class that serves as its optimistic lock value. The version is used to ensure integrity when performing the merge operation and for optimistic concurrency control. 

Only a single Version property or field should be used per class; applications that use more than one Version property or field will not be portable. 

The Version property should be mapped to the primary table for the entity class; applications that map the Version property to a table other than the primary table will not be portable. 

The following types are supported for version properties: int, Integer, short, Short, long, Long, Timestamp. 

    Example:

    @Version
    @Column(name="OPTLOCK")
    protected int getVersionNum() { return versionNum; }
 


Since: 
Java Persistence 1.0


哪看见省略号了。这不就是 hibernate乐观锁吗。
------解决思路----------------------
楼主人品素质太差

引用:
引用
This annotation specifies the version field or property of an entity class that serves as its optimistic lock value. The version is used to ensure integrity when performing the merge operation and for optimistic concurrency control. 

Only a single Version property or field should be used per class; applications that use more than one Version property or field will not be portable. 

The Version property should be mapped to the primary table for the entity class; applications that map the Version property to a table other than the primary table will not be portable. 

The following types are supported for version properties: int, Integer, short, Short, long, Long, Timestamp. 

    Example:

    @Version
    @Column(name="OPTLOCK")
    protected int getVersionNum() { return versionNum; }
 


Since: 
Java Persistence 1.0


哪看见省略号了。这不就是 hibernate乐观锁吗。


完了,你我摊上这2货了。
  相关解决方案