|
|
|
Schema update tries to add 2 times the same Foreign key.
{code:java} org.hibernate.tool.schema.spi.SchemaManagementException: Unable to execute schema management to JDBC target [alter table step add constraint FKeq3syiydtq52ipcj86hct1d92 foreign key (parent_id) references step]
....
Caused by: org.h2.jdbc.JdbcSQLException: Constraint "FKEQ3SYIYDTQ52IPCJ86HCT1D92" already exists; SQL statement: alter table step add constraint FKeq3syiydtq52ipcj86hct1d92 foreign key (parent_id) references step
{code}
{code:java} @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @DiscriminatorColumn(name = "type") @Table(name = "step") @Entity public abstract class Step implements Serializable {
@Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Column(unique = true, nullable = false) protected Integer id;
@ManyToOne private Step parent; } {code}
{code:java} @DiscriminatorValue("group") @Entity public class GroupStep extends Step {
@OneToMany(mappedBy = "parent") private List<Step> steps; } {code}
|
|
|
|