Skip to content

PropertyReferenceException is throw if the attribute name is different from the field in query. [DATAMONGO-1379] #2294

Closed
@spring-projects-issues

Description

@spring-projects-issues

Lucas POUZAC opened DATAMONGO-1379 and commented

If the attribute name (java) is different from the field (mongo document), spring-data-mongodb throw an PropertyReferenceException.

Example :

public class Foo {

   @Field(name = "bar")
   private String foo;

   ...

}
Query query = new Query();
query.addCriteria(Criteria.where("bar").is("bar_value"));
return findOne(query);

The result is correct but the memory consumption is very high.

Moreover, if the field name contains an underscore, it is not correctly parsed. DATACMNS-816

public class Foo {

   @Field(name = "bar_underscore")
   private String foo;

   ...

}
Query query = new Query();
query.addCriteria(Criteria.where("bar_underscore").is("bar_value"));
return findOne(query);

Attachments:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions