0
点赞
收藏
分享

微信扫一扫

Java Persistence / JPA: @Column vs @Basic


JPA中Column和Basic的区别是什么? 请看一下下面的代码:

@Basic(fetch=FetchType.LAZY)
@Column(name="WIBBLE")

@Basic(fetch=FetchType.LAZY)
@Column(name="WIBBLE")

  • @Basic signifies that an attribute is to be persisted and a standard mapping is to be used. It has parameters which allow you to specify whether the attribute is to be lazily loaded and whether it's nullable.
  • @Column allows you to specify the name of the column in the database to which the attribute is to be persisted.


举报

相关推荐

0 条评论