标签:
1. javax.persistence.GeneratedValue
@Data
@MappedSuperclass
public abstract class UUIDEntity {
@Id
@GeneratedValue(generator = "systemUUID")
@Column(name = "id", length = Constants.UUID_LENGTH)
private String id;
}
2. hibernate generatedValue
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
@Entity @Data @Table(name = "T_TEST")
@GenericGenerator(name="systemUUID",strategy="uuid2")
public class TestEntity extends UUIDEntity {
标签:
原文地址:http://www.cnblogs.com/feika/p/4453183.html