/** * The domain type of choice. * <p /> * This time <a href="http://www.cbs.com/shows/star-trek-discovery/">Star Trek: Discovery</a> <br /> * <i>Just a trekkie - no relation to CBS in any way other than watching.</i> * * @author Christoph Strobl */ @Data class Person { @Id ObjectId id; @Field("first_name") private String firstname; @Field("last_name") private String lastname; private int age; Person(String firstname, String lastname, int age) { this.firstname = firstname; this.lastname = lastname; this.age = age; } }
@Nullable private String getAnnotatedFieldName() { org.springframework.data.mongodb.core.mapping.Field annotation = findAnnotation( org.springframework.data.mongodb.core.mapping.Field.class); return annotation != null ? annotation.value() : null; }
public int getFieldOrder() { org.springframework.data.mongodb.core.mapping.Field annotation = findAnnotation( org.springframework.data.mongodb.core.mapping.Field.class); return annotation != null ? annotation.order() : Integer.MAX_VALUE; }
@Nullable private String getAnnotatedFieldName() { org.springframework.data.mongodb.core.mapping.Field annotation = findAnnotation( org.springframework.data.mongodb.core.mapping.Field.class); return annotation != null ? annotation.value() : null; }
public int getFieldOrder() { org.springframework.data.mongodb.core.mapping.Field annotation = findAnnotation( org.springframework.data.mongodb.core.mapping.Field.class); return annotation != null ? annotation.order() : Integer.MAX_VALUE; }
private static final Pattern PATTERN = Pattern.compile(EMAIL_REGEX); @Field("email") private final String value;
public static String getQueryCriteria(Field f) { String queryCriteria; if (f.isAnnotationPresent(org.springframework.data.mongodb.core.mapping.Field.class)) { queryCriteria = f.getAnnotation(org.springframework.data.mongodb.core.mapping.Field.class).value(); } else { queryCriteria = f.getName(); } return queryCriteria; }
/** * @author Christoph Strobl */ @Document(collection = "star-wars") @Getter @Setter @EqualsAndHashCode(of = "name") class SWCharacter { private @Id String id; private @Field("firstname") String name; private Planet homePlanet; SWCharacter(String name) { this.name = name; } }
@Field(EP_USER_USERNAME) private String username; @Field(EP_USER_EXTERNAL_ID) private String externalId; @Field(EP_USER_TENANT_ID) private String tenantId; @Field(EP_USER_ACCESS_TOKEN) private String accessToken; @Field(EP_USER_ENDPOINT_IDS) private List<String> endpointIds; @Version @Field(OPT_LOCK) private Long version;
@Field(NF_APPLICATION_ID) private String applicationId; @Field(NF_SCHEMA_ID) private String schemaId; @Field(NF_TOPIC_ID) private String topicId; @Field(NF_VERSION) private int nfVersion; @LastModifiedDate @Field(NF_LAST_MODIFY_TIME) private Date lastModifyTime; @Field(NF_TYPE) private NotificationTypeDto type; @Field(NF_BODY) private byte[] body; @Indexed(expireAfterSeconds = 0) @Field(NF_EXPIRED_AT) private Date expiredAt; @Field(NF_SEQ_NUM) private int secNum;
private String id; @Field(MongoModelConstants.EP_REGISTRATION_APPLICATION_ID) private String applicationId; @Field(MongoModelConstants.EP_REGISTRATION_ENDPOINT_ID) private String endpointId; @Field(MongoModelConstants.EP_REGISTRATION_CREDENTIALS_ID) private String credentialsId; @Field(MongoModelConstants.EP_REGISTRATION_SERVER_PROFILE_VERSION) private Integer serverProfileVersion; @Field(MongoModelConstants.EP_REGISTRATION_SERVER_PROFILE_BODY) private String serverProfileBody;
@Field(EP_APPLICATION_ID) private String applicationId; @Field(EP_ENDPOINT_KEY) private byte[] endpointKey; @Indexed @Field(EP_ENDPOINT_KEY_HASH) private byte[] endpointKeyHash; @Indexed @Field(EP_USER_ID) private String endpointUserId; @Indexed @Field(EP_ACCESS_TOKEN) private String accessToken; @Field(EP_GROUP_STATE) private List<EndpointGroupState> groupState; @Field(EP_SEQ_NUM) private int sequenceNumber; @Field(EP_CHANGED_FLAG) private Boolean changedFlag; private DBObject profile; @Field(EP_PROFILE_HASH) private byte[] profileHash; @Field(EP_PROFILE_VERSION) private int profileVersion; @Field(EP_SERVER_PROFILE_VERSION_PROPERTY) private int serverProfileVersion; @Field(EP_CONFIGURATION_HASH) private byte[] configurationHash; @Field(EP_USER_CONFIGURATION_HASH)
private String id; @Indexed @Field(EP_SPECIFIC_CONFIGURATION_KEY_HASH) private byte[] endpointKeyHash; @Field(EP_CONFIGURATION_VERSION) private Integer configurationVersion; @Field(EP_SPECIFIC_CONFIGURATION_CONFIGURATION) private String configuration; @Version @Field(EP_SPECIFIC_CONFIGURATION_CONFIGURATION_VERSION) private Long version;
@Field(EP_NF_ENDPOINT_KEY_HASH) private byte[] endpointKeyHash; private MongoNotification notification;
@Field("email") @Indexed(unique = true) private EmailAddress emailAddress;