I have the following entity:
@Entity
@Table(name = "campaign_content", uniqueConstraints = @UniqueConstraint(columnNames = { "campaignContentId", "campaignId", "fieldTag" }))
public class CampaignContent implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Column(name = "campaign_content_id")
private Integer campaignContentId;
@Column(name = "field_content")
private String fieldContent;
@Column(name = "campaign_id")
private Integer campaignId;
@Column(name = "field_tag")
private String fieldTag;
With getter and setter.
However I get:
caused by: org.hibernate.AnnotationException: Unable to create unique key constraint (campaignContentId, campaignId, fieldTag) on table campaign_content: campaignContentId, campaignId, fieldTag not found
What is wrong?
"campaign_content_id", "campaign_id", "field_tag"
– Shelbyshelden