Skip to content

findByXOrderByX: Inconsistent processing of property names and Order specs [DATACMNS-996] #1446

Open
@spring-projects-issues

Description

@spring-projects-issues

Vojtech Toman opened DATACMNS-996 and commented

Consider the following domain class:

class Test {
  private x;
  ...
}

and the following findBy repository method:

findByXOrderByX(...)

When this method name is parsed and converted into a PartTree (and a Sort instance), the PartTree will refer to 'X' as 'x' - but the Sort will refer to the property as 'X'. Note that this inconsistency occurs only for property names that match the pattern \[A-Z0-9._$]+ (see the implementation of PropertyPath.from()); for other property names there is no inconsistency.

This inconsistency leads to problems during query creation in our spring-data implementation (because we are unable to get the persistent property path for capital 'X' on Test when processing the Sort). We have to work around this but it would be nice if it can be fixed on the spring-data level.

We are using spring-data 1.13.0 but I suspect this issue is present in older versions as well


Affects: 1.13 GA (Ingalls)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions