composite keys cannot be autogenerated.
@Table(unique=...) // allows unique constraint on several columns
In that case, I suppose the only way is to manually alter the database
to generate that constraint
Although I am using this option in many places, In this case I want to check Field_A + Field_B = unique and I suppose that can't be done using @Table(uniqueConstraint = ....)
Also how can I give a constraint name of myself instead of the auto generated name.
It can. UniqueConstraint get an array string as column names
But you can't define your own name.