Unable to create unique key constraint not found
The name of the column is campaign_content_id
, not campaignContentId
. Same thing for the other columns, of course. The columnNames
attribute expects an array of ... column names. Not an array of Java field or property names.
In my case this code works, one physical table field name and one entity object member field name.
@Table(uniqueConstraints={@UniqueConstraint(columnNames = {"account_id" , "measureDate"})})
but this code doesn't work at all with same exception.
@Table(uniqueConstraints={@UniqueConstraint(columnNames = {"account_id" , "measure_date"})})
Someone reported this bug to hibernate. Check this. https://forum.hibernate.org/viewtopic.php?f=9&t=986581&view=next
I use
- spring boot
- spring data
- mysql