spring-data-commons icon indicating copy to clipboard operation
spring-data-commons copied to clipboard

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

Open spring-projects-issues opened this issue 9 years ago • 2 comments

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)

spring-projects-issues avatar Nov 19 '16 23:11 spring-projects-issues

hello @spring-projects-issues,

I have created a PR for this small issue. Let me know if I can/should do anything else.

Cheers,

etrandafir93 avatar Jan 19 '24 17:01 etrandafir93

Do you have a reproducer project handy that shows the Scala case?

mp911de avatar Jan 22 '24 08:01 mp911de

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

spring-projects-issues avatar May 16 '25 09:05 spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

spring-projects-issues avatar May 23 '25 09:05 spring-projects-issues