🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
~~~ package com.first.hotdemo; import javax.persistence.*; import java.math.BigDecimal; @Entity @Table(name = "user", indexes = { @Index(name = "nums", columnList = "num"), @Index(name = "phone", columnList = "phone", unique = true), }) public class UserEntity { @Id @GeneratedValue @Column(columnDefinition = "int(10) unsigned") private Integer id; @Column(nullable = false, columnDefinition = "text") private String content; @Column(nullable = false, columnDefinition = "decimal(8,2) default 0.00 comment '金额'") private BigDecimal money; @Column(nullable = false, columnDefinition = "bigint(10) unsigned default 0 comment '数量'") private Integer num; @Column(nullable = false, columnDefinition = "varchar(11) default '' comment '手机号码' ") private String phone; // @Column(nullable = false, columnDefinition = "varchar(20) DEFAULT '' COMMENT '名字'") // private String name; } ~~~