Skip to content

querydsl scala quick fix in spring data [DATACMNS-938] #1392

Open
@spring-projects-issues

Description

@spring-projects-issues

Jan Prach opened DATACMNS-938 and commented

createPath in org.springframework.data.querydsl.SimpleEntityPathResolver will fail for scala querydsl generated classes. The reason is that static methods in scala are "object" methods and the object has naming convention pathClassName + "$". Hence the fix is easy - just add to createPath following:

if (field == null) {
String scalaObjectPathClassName = pathClassName + "$";
pathClass = ClassUtils.forName(scalaObjectPathClassName, domainClass.getClassLoader());
field = getStaticFieldOfType(pathClass);
}


Affects: 1.12.5 (Hopper SR5)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions