-
-
Notifications
You must be signed in to change notification settings - Fork 98
Closed
Labels
javaPull requests that update Java codePull requests that update Java code
Milestone
Description
I think you can modify example in https://nitrite.dizitart.com/java-sdk/repository/entity/index.html#indices to not use wrapper @indices. I've looked into code and I think you load @Index annotations with and without @indices, so no code should is needed.
Before Java 8, a container annotation was required as wrapper to use multiple instances of the same annotation. As of Java 8, this is no longer necessary. Instead, these annotations should be used directly without a wrapper, resulting in cleaner and more readable code.
This:
@Indices({
@Index(fields = "id", type = IndexType.UNIQUE),
@Index(fields = "partNumber", type = IndexType.UNIQUE),
})
public class MyClass implements Serializable
can be replaced with:
@Index(fields = "id", type = IndexType.UNIQUE)
@Index(fields = "partNumber", type = IndexType.UNIQUE)
public class MyClass implements Serializable
https://docs.oracle.com/javase/tutorial/java/annotations/repeating.html
Metadata
Metadata
Assignees
Labels
javaPull requests that update Java codePull requests that update Java code
Type
Projects
Status
Done