public static class ChildHasPrimaryIndexExtendsAndParentHasId extends ValidAnnotations.Basic { @Index(primary = true, unique = true) public String other; }
private boolean isPrimaryIndexField(FieldInfo fieldInfo) { // primary index field is either // field with @Id or @Id @GeneratedValue(strategy=..) where strategy != InternalIdStrategy return (fieldInfo.getAnnotations().has(Id.class) && !(fieldInfo.getAnnotations().has(GeneratedValue.class) && ((GeneratedValue) fieldInfo.getAnnotations().get(GeneratedValue.class).getAnnotation()).strategy() .equals(InternalIdStrategy.class) )) || // or @Index(primary=true) - backward compatibility fieldInfo.getAnnotations().has(Index.class) && ((Index) fieldInfo.getAnnotations().get(Index.class).getAnnotation()).primary(); }
@Index(unique = true, primary = true) private String tag;
@Index(unique = true, primary = true) private String name;
@Index(primary = true, unique = true) private String name;
/** * @author Frantisek Hartman */ @NodeEntity(label = "Entity") public class SingleIndexEntity { Long id; @Index String login; }
@Index(unique = true, primary = true) private String sub; private boolean emailVerified;
@Index(primary = true, unique = true) private String sourceId; private String name;
@Index(primary = true, unique = true) private String title;
/** * @author Frantisek Hartman */ @NodeEntity(label = "Entity") public class UniqueConstraintEntity { Long id; @Index(unique = true) String login; }
public static class BothIdAndPrimaryIndexOnDifferentProperty { @Id public String identifier; @Index(primary = true, unique = true) public String other; }
@Index(primary = true, unique = true) private String localeString; private String languageCode;
@Index(unique = true) private String userName; private String password;
@Index private String login;
private Long id; @Index(unique = true) private Long profileId;
private Long tagId; @Index(unique = true) @Property(name = "short-description") private String description;