-
Notifications
You must be signed in to change notification settings - Fork 132
Criteria "in" with UUID throws exception / findAllById #283
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
Comments
Thanks for report. These are two issues. One is that we use mapped and unmapped operations in the Repository but always use the column name instead of using the property name where we employ mapping. The other issue is that |
Affirmative, in QueryMapper used |
I wasn't able to reproduce the exception above. From the stack trace it looks as if a |
@mp911de the UUID was not null that's why I was so confused at first, I passed in a valid uuid that does exist in the database. But in |
The reason why it returns |
There's a bit more to reproduce it. Since |
I filed DATAJDBC-476 to change the preference for conversion so that unknown properties are attempted for simple type conversion first and the number of cases where a valid value can be converted to |
We now use the Id property name when using the converter to map property names to column names. In other places, where we don't use the converter, we stick with the Id column name.
We now use the Id property name when using the converter to map property names to column names. In other places, where we don't use the converter, we stick with the Id column name.
That's fixed and backported now. |
i found |
@mp911de this still suffers from the reflection warning and the query won't find any rows (even though it should). Or is this caused by DATAJDBC-476? |
Not sure I follow @Dav1dde. |
I can't test right now but the issue was even with changing the column name to the field name (or using the client directly): client.select().from(Entity.class).matching(Criteria.where("id").in(List.of(existingUuid))).fetch().all() returned 0 rows/entities, but changing |
@Dav1dde after pull it working, but need add: |
@LaoTsing thank you very much, to everyone ;) |
A simple setup with a UUID as id:
The following fails
repo.findAllById(List.of(existingUuid))
The same happens using the database client:
client.select().from(Entity.class).matching(Criteria.where("id").in(List.of(existingUuid))).fetch().all()
Error:
java.lang.IllegalArgumentException: Cannot encode null parameter of type java.lang.Object
One of the problems here is (from SimpleR2dbcRepository):
idColumnName
containsID
instead ofid
(the value from the@Column
annotation), if I change the value to "id", I do not get an exception but this warning:And no results. But if I change the criteria from
.in
to.is
the entity is found.The text was updated successfully, but these errors were encountered: