实体的id自增策略
主键自增一:
@Id
@SequenceGenerator(name="seq",sequenceName="oracle_seq")
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="seq")
private long id;
普通:
@Id
@Column(length = 20, name = "id")
private String id;
UUID:
@Id
@GenericGenerator(name = "uuid", strategy = "uuid")
@GeneratedValue(generator = "uuid")
@Column(length = 32, name = "s_id")
private String id;
UUID替换掉-:
UUID.randomUUID().toString().replace("-","");

浙公网安备 33010602011771号