Unique constraints on multiple columns

How do I create unique constraints or indexes on multiple columns?
I tried to add manually as follows:
2020-12-26 22_09_49-limpidk1 – Product.java com.company.limpidk1.main

But it got reset back to original code after I switched to design tab in IDE.
2

Really appreciate your help
Thanks

Hi,
Try this format, it works for me:

@JmixEntity
@Table(name = "IKNA_CARD", uniqueConstraints = {
        @UniqueConstraint(name = "UC_CARD_DECK_QUESTION", 
                columnNames = {"DECK_ID", "QUESTION"})
})
@Entity(name = "ikna_Card")
public class Card {
3 Likes

Thank you so much for your help. It worked beautifully.

1 Like