【发布时间】:2016-09-05 20:27:03
【问题描述】:
我有一个 Spring Boot 应用程序并使用以下用户模型类。
@Entity
public class User {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String name;
private String emailAddress;
private Boolean active;
private String password;
private boolean techLead;
private boolean sdm;
private boolean admin;
@OneToMany(fetch = FetchType.EAGER)
private Set<Circle> sdmForCircle;
@OneToMany(fetch = FetchType.EAGER)
private Set<Node> techLeadForNode;
@OneToMany(fetch = FetchType.EAGER)
private Set<Operator> userWorkingForOperator;
..................
一旦我加载 Spring Boot 应用程序,它会自动为 sdmForCircle、userWorkingForOperator 和 techLeadForNode 创建表,但这些表是使用不必要的唯一约束创建的。我想停止自动添加独特的约束。
请提出建议。
【问题讨论】:
标签: mysql spring-boot jpa spring-data spring-data-jpa