Following error occures
Caused by: org.hibernate.tool.schema.spi.SchemaManagementException:Export identifier [order_signal] encountered more than once
I have the following classes:
@Entity
@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS)
public abstract class TransactionComponent {
@Id
@GeneratedValue(strategy = GenerationType.TABLE)
@Column(name = "id", updatable = false, nullable = false)
protected Long id;
...
}
@Entity
@JsonRootName("OrderSignalDAO")
public class OrderSignal extends TransactionComponent {
...
}
@Entity(name = "TransferSignal")
public class TransferSignal extends TransactionComponent {
....
}
In class OrderSignal there is no other @Id and there is no getter/setter for id in TransactionComponent as well.
Why does this error occures? What does it mean? How to fix it?
One Scenario I came across in which the above issue happens is say the entity class would be as follows
`@Entity
@Table(name = "universe")
public class Universe {
@GenericGenerator(
name = "universeSequenceGenerator",
strategy = "org.hibernate.id.enhanced.SequenceStyleGenerator",
parameters = {
@Parameter(name = "sequence_name", value = "universe"),
@Parameter(name = "initial_value", value = "1"),
@Parameter(name = "increment_size", value = "1")
}
)
@Id
@GeneratedValue(generator = "universeSequenceGenerator")
private Integer id;
private String name;
....`
In above scenario the following error would be thrown Caused by: org.hibernate.tool.schema.spi.SchemaManagementException:Export identifier [universe] encountered more than once
It is because of @Parameter(name = "sequence_name", value = "universe")
, when we change this to @Parameter(name = "sequence_name", value = "universeSeq")
the error disappears. If the entity name matches anywhere in the parameter names or etc,. then this might occur.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With