"Create schema" JPA @Index annotations for non-unique index generates "create index" statement with index name surrounded in back ticks which leads to PSQL error. For example, @Entity @Table(indexes = { @javax.persistence.Index(columnList = "name, value") }
) public class TestOne {
@Id private long id;
private String name;
private String value;
public long getId() { return id; }
public void setId(long id) { this.id = id; }
public String getName() { return name; }
public void setName(String name) { this.name = name; }
public String getValue() { return value; }
public void setValue(String value) { this.value = value; }
}
Create schema on Postgresql leads to the following exception. create index `UK_1tugen6192hdwohgooork6lbb` on "TestOne" ("name", "value") Exception in thread "main" java.lang.RuntimeException: javax.persistence.PersistenceException: Unable to execute JPA schema generation create command [create index `UK_1tugen6192hdwohgooork6lbb` on "TestOne" ("name", "value")]. Caused by: org.postgresql.util.PSQLException: ERROR: syntax error at or near "`"
|