How do I specify a partial index using Hibernate / JPA annotations? E.g. an index with a "where" constraint:
Code:
create unique index ix_primary_email_address on contact_email_address (
contact_id,
is_primary
)
where is_primary = true;
As you can see, this is necessary to express a constraint whereby only a single entry in a table can have a particular boolean flag set to true.
If this is not possible using regular JPA annotations, how can I instruct Hibernate to run custom SQL at table-creation time? I can find documentation on running custom SQL for queries, but nothing for the actual schema generation.