-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected value type querying for Long #110
Comments
Could you try not using generic type as ID field? |
That worked. The query:
I created a new parent class
And I extended it
So it's clear Lombok is not the issue but using a generic in the parent class. I suppose there is no work around for this and I will have to use the non generic type for ID? |
Not sure, the exception was raised in hibernate. You may try to print out the generated SQL and parameters to check further. |
I think I am fine with removing the generic for the concrete Long for the ID, but I was wondering if there was something to fix it. This is the logging with the generated sql and the exception:
Thanks! |
Do you see this message in the debug log? |
It's Object instead of String, here is the log (with some previous lines)
|
It looks like attribute.getJavaType() in RSQLJPAPredicateConverter returns Object instead of Long for your entity class. Could you set break point on line 198 to see any hints? |
Greetings! I am using the rsql-jpa-spring-boot-starter with spring boot 3. So far all my queries work with no issues, but now I am trying to do something as simple as
And I get the following error:
I've read all the docs in the read me and tried other ways such as >1=;<=1 but anything I do with a number for an ID I get the above error.
EDIT
I believe I figured out the issue, my entity extends an AbstractEntity that holds the ID value. So the classes are as follow:
The entity I am querying for is this:
I am using Lombok's @DaTa for all getters and setters. The way I have it setup returns me the error, however if I do not extend AbstractEntity and put the ID in my Instance class, the query "id==1" actually does work.
Is there a way a fix can be put into this? Or do I have to have the ID in every entity I wish to query with RSQL? I'll continue testing on my end and see if I can find any other solutions.
Thank you!
The text was updated successfully, but these errors were encountered: