Procházet zdrojové kódy

add support for indexes with where clauses

tags/2.0.1
Jonathan Cobb před 4 roky
rodič
revize
72f8d102c0
2 změnil soubory, kde provedl 2 přidání a 1 odebrání
  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 Zobrazit soubor

@@ -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 Zobrazit soubor

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

}

Načítá se…
Zrušit
Uložit