It seems you want to create partial indexes ( CREATE INDEX ... ON ... WHERE) using JPA constraint definitions.
They are specific enough for PostgreSQL and are not specified by JPA. To create them you need to use your own syntax. I do not think JPA offers any functions for defining an index.
, . CONSTRAINT constraint_name UNIQUE(columns) PostgreSQL. , PostgreSQL .
:
JPA , JPA, DDL, .. , JPA , . DDL EclipseLink; , Hibernate, OpenJPA - , EclipseLink.
JPA - , pg_catalog.pg_index. , EntityManager SQL CREATE UNIQUE INDEX. A @Startup @Singleton bean , EJB3.1. . PostgreSQL pg_catalog.pg_index. , , :
SELECT EXISTS(
SELECT 1
FROM pg_index
WHERE indexrelid = 'public.indexname'::regclass
);
, , , , . pg_index , , . - indpred; , .