|
Renaming a foreign key constraint using the JPA2.1 @javax.persistence.ForeignKey annotation does not change the constraint name. The provider default name is still used.
Using the (now deprecated) @org.hibernate.annotations.ForeignKey does work in the same environment.
Basic usage:
import javax.persistence.ForeignKey;
@Entity public class Task implements Serializable { ... @JoinColumn(name = "query_id", nullable = false, foreignKey = @ForeignKey(name = "fk_task_query")) private Query query; ... }
|