diff --git a/src/main/java/com/avaje/ebean/annotation/Index.java b/src/main/java/com/avaje/ebean/annotation/Index.java index 02c08e128..ae82a8802 100644 --- a/src/main/java/com/avaje/ebean/annotation/Index.java +++ b/src/main/java/com/avaje/ebean/annotation/Index.java @@ -1,6 +1,7 @@ package com.avaje.ebean.annotation; import java.lang.annotation.ElementType; +import java.lang.annotation.Repeatable; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.Target; @@ -12,6 +13,7 @@ import java.lang.annotation.Target; */ @Target({ElementType.TYPE, ElementType.FIELD}) @Retention(RetentionPolicy.RUNTIME) +@Repeatable(Indices.class) public @interface Index { /** diff --git a/src/main/java/com/avaje/ebean/annotation/Indices.java b/src/main/java/com/avaje/ebean/annotation/Indices.java index 2c119da70..0886482ed 100644 --- a/src/main/java/com/avaje/ebean/annotation/Indices.java +++ b/src/main/java/com/avaje/ebean/annotation/Indices.java @@ -16,5 +16,5 @@ public @interface Indices { /** * Array with {@link Index} definitions. */ - Index[] indices() default {}; + Index[] value() default {}; } diff --git a/src/main/java/com/avaje/ebeaninternal/server/deploy/parse/AnnotationClass.java b/src/main/java/com/avaje/ebeaninternal/server/deploy/parse/AnnotationClass.java index ebaed8e5b..3fe8be9a7 100644 --- a/src/main/java/com/avaje/ebeaninternal/server/deploy/parse/AnnotationClass.java +++ b/src/main/java/com/avaje/ebeaninternal/server/deploy/parse/AnnotationClass.java @@ -121,7 +121,7 @@ public class AnnotationClass extends AnnotationParser { Indices indices = AnnotationBase.findAnnotation(cls, Indices.class); if (indices != null) { - for (Index index: indices.indices()) { + for (Index index: indices.value()) { descriptor.addIndex(new IndexDefinition(index.columnNames(), index.name(), index.unique())); } } diff --git a/src/main/java/com/avaje/ebeaninternal/server/deploy/parse/AnnotationFields.java b/src/main/java/com/avaje/ebeaninternal/server/deploy/parse/AnnotationFields.java index e1328802b..022044ec8 100644 --- a/src/main/java/com/avaje/ebeaninternal/server/deploy/parse/AnnotationFields.java +++ b/src/main/java/com/avaje/ebeaninternal/server/deploy/parse/AnnotationFields.java @@ -312,7 +312,7 @@ public class AnnotationFields extends AnnotationParser { Indices indices = get(prop, Indices.class); if (indices != null) { - for (Index index: indices.indices()) { + for (Index index: indices.value()) { addIndex(prop, index); } }