use of org.springframework.data.mongodb.core.mapping.Document in project spring-data-mongodb by spring-projects.
the class QueryMapperUnitTests method resolvesSimpleNestedMappedFieldnameWithUnderscoresCorrectly.
// GH-3601
@Test
void resolvesSimpleNestedMappedFieldnameWithUnderscoresCorrectly() {
Query query = query(where("simple.renamed_fieldname_with_underscores").exists(true));
org.bson.Document document = mapper.getMappedObject(query.getQueryObject(), context.getPersistentEntity(WrapperAroundWithPropertyUsingUnderscoreInName.class));
assertThat(document).isEqualTo(new org.bson.Document("simple.renamed", new org.bson.Document("$exists", true)));
}
use of org.springframework.data.mongodb.core.mapping.Document in project spring-data-mongodb by spring-projects.
the class QueryMapperUnitTests method resolvesMappedFieldnameWithUnderscoresCorrectly.
// GH-3601
@Test
void resolvesMappedFieldnameWithUnderscoresCorrectly() {
Query query = query(where("renamed_fieldname_with_underscores").exists(true));
org.bson.Document document = mapper.getMappedObject(query.getQueryObject(), context.getPersistentEntity(WithPropertyUsingUnderscoreInName.class));
assertThat(document).isEqualTo(new org.bson.Document("renamed", new org.bson.Document("$exists", true)));
}
use of org.springframework.data.mongodb.core.mapping.Document in project spring-data-mongodb by spring-projects.
the class QueryMapperUnitTests method resolvesFieldNameWithUnderscoreOnNestedMappedFieldnameWithUnderscoresCorrectly.
// GH-3601
@Test
void resolvesFieldNameWithUnderscoreOnNestedMappedFieldnameWithUnderscoresCorrectly() {
Query query = query(where("double_underscore.renamed_fieldname_with_underscores").exists(true));
org.bson.Document document = mapper.getMappedObject(query.getQueryObject(), context.getPersistentEntity(WrapperAroundWithPropertyUsingUnderscoreInName.class));
assertThat(document).isEqualTo(new org.bson.Document("double_underscore.renamed", new org.bson.Document("$exists", true)));
}
use of org.springframework.data.mongodb.core.mapping.Document in project spring-data-mongodb by spring-projects.
the class QueryMapperUnitTests method resolvesFieldNameWithUnderscoreOnNestedFieldnameWithUnderscoresCorrectly.
// GH-3601
@Test
void resolvesFieldNameWithUnderscoreOnNestedFieldnameWithUnderscoresCorrectly() {
Query query = query(where("double_underscore.fieldname_with_underscores").exists(true));
org.bson.Document document = mapper.getMappedObject(query.getQueryObject(), context.getPersistentEntity(WrapperAroundWithPropertyUsingUnderscoreInName.class));
assertThat(document).isEqualTo(new org.bson.Document("double_underscore.fieldname_with_underscores", new org.bson.Document("$exists", true)));
}
use of org.springframework.data.mongodb.core.mapping.Document in project spring-data-mongodb by spring-projects.
the class QueryMapperUnitTests method resolvesFieldnameWithUnderscoresCorrectly.
// GH-3601
@Test
void resolvesFieldnameWithUnderscoresCorrectly() {
Query query = query(where("fieldname_with_underscores").exists(true));
org.bson.Document document = mapper.getMappedObject(query.getQueryObject(), context.getPersistentEntity(WithPropertyUsingUnderscoreInName.class));
assertThat(document).isEqualTo(new org.bson.Document("fieldname_with_underscores", new org.bson.Document("$exists", true)));
}
Aggregations