\r
// The build script extracts this exact line so be careful editing it\r
// and only use A-Z a-z 0-9 .-_ in the string.\r
- public static final String VERSION = "0.6.1";\r
+ public static final String VERSION = "0.6.2";\r
\r
// The build script extracts this exact line so be careful editing it\r
// and only use A-Z a-z 0-9 .-_ in the string.\r
imports.add(IQTable.class.getCanonicalName());
imports.add(IQIndexes.class.getCanonicalName());
imports.add(IQIndex.class.getCanonicalName());
- imports.add(IQColumn.class.getCanonicalName());
+ imports.add(IQColumn.class.getCanonicalName());
imports.add(IndexType.class.getCanonicalName());
// fields
AnnotationBuilder ap = new AnnotationBuilder();
if (indexes.size() == 1) {
// single index
- ap.append(generateIndexAnnotation(indexes.get(0)));
+ IndexInspector index = indexes.values().toArray(new IndexInspector[1])[0];
+ ap.append(generateIndexAnnotation(index));
ap.append(eol);
} else {
// multiple indexes
ap.addParameter("name", index.name);
}
if (!index.type.equals(IndexType.STANDARD)) {
- ap.addParameter("type", IndexType.class.getSimpleName() + "." + index.type.name());
+ ap.addEnum("type", index.type);
}
if (ap.getCount() > 0) {
// multiple fields specified
- ap.addParameter("values", index.columns);
+ ap.addParameter("value", index.columns);
} else {
// default value
ap.addParameter(null, index.columns);
}
}
}
+
+ void addEnum(String parameter, Enum value) {
+ appendExceptFirst(", ");
+ if (!StringUtils.isNullOrEmpty(parameter)) {
+ append(parameter);
+ append('=');
+ }
+ append(value.getClass().getSimpleName() + "." + value.name());
+ }
}
}
\ No newline at end of file