Przeglądaj źródła

add support for indexes with where clauses

tags/2.0.1
Jonathan Cobb 4 lat temu
rodzic
commit
72f8d102c0
2 zmienionych plików z 2 dodań i 1 usunięć
  1. +1
    -1
      wizard-common/src/main/java/org/cobbzilla/wizard/model/entityconfig/EntityReferences.java
  2. +1
    -0
      wizard-common/src/main/java/org/cobbzilla/wizard/model/entityconfig/annotations/ECIndex.java

+ 1
- 1
wizard-common/src/main/java/org/cobbzilla/wizard/model/entityconfig/EntityReferences.java Wyświetl plik

@@ -120,7 +120,7 @@ public class EntityReferences {
if (statement != null) return statement;

final String indexName = name != null ? name : tableName + "_" + (unique ? "uniq" : "idx") + "_" + columnName;
return "CREATE "+(unique ? "UNIQUE" : "")+" INDEX "+indexName+" "+"ON "+tableName+"(" + columnName + ")";
return "CREATE "+(unique ? "UNIQUE" : "")+" INDEX "+indexName+" "+"ON "+tableName+"(" + columnName + ") "+index.where();
}

private String compositeIndex(Class<? extends Identifiable> clazz, ECIndex index) {


+ 1
- 0
wizard-common/src/main/java/org/cobbzilla/wizard/model/entityconfig/annotations/ECIndex.java Wyświetl plik

@@ -12,5 +12,6 @@ public @interface ECIndex {
boolean unique() default false;
String[] of() default {};
String statement() default "";
String where() default "";

}

Ładowanie…
Anuluj
Zapisz