java专题Java学习笔记

JPA设置主键索引注解

2017-06-28  本文已影响84人  H_Man
import lombok.Data;//这个注解是下载了lombok插件,简化get/set方法
import javax.persistence.*;

/**
* Created by Hman on 2017/6/17.
*/
@Data
@Entity
@Table(name = "TB_STUDENT",indexes = {@Index(name = "TSGS_CODE",columnList = "code")})//索引  name值不能相同,否则无法创建索引
public class GoodsStockDo {
  
  @Id
  @GeneratedValue(strategy = GenerationType.AUTO)
  private Long id;

  private String code;

  private String name;

  private Integer age; 


}
上一篇下一篇

猜你喜欢

热点阅读