Closed sickfar closed 3 years ago
I have found that AbstractQueryInterceptor
does not use HibernateJpaOperations#findOne(@NonNull Class<T>, @NonNull Serializable)
That could solve the problem
would it be possible to update to the latest 2.2.0 and confirm this is working?
@issmo I've just updated to
<micronaut.data.version>2.2.0</micronaut.data.version>
Unfortunately, nothing changed. findById
leads to ClassCastException
My workaround: findByGenericIdAndId
works anyway
I am unable to reproduce the behaviour described, the sole difference is that my code is in java. if you have a repo with tests that reproduce this I might have a look at it.
Sorry for late response, I was quite busy. I've created a repo and I can confirm the issue is reproduced in it. https://github.com/sickfar/micronaut-data-issue-807
@issmo please, any updates on this?
Hello!
I need to use composite ID in my app. I use Data Hibernate-JPA implementation.
I cannot use embedded ID, as I need to find by it's parts (like genericId + Id, and I need to have
findAllByGenericId
So I decided to use@IdClass
annotation and split ID by fields.Unfortunately, Micronaut does not support such composite ID, while Hibernate does.
As WA I will create some additional methods, but it would be nice to have working
findById
. Thanks.Steps to Reproduce
Expected Behaviour
Nice found entity by composite ID
Actual Behaviour
Fail with ClassCastException
Environment Information
Example Application
Sorry, I do not have GitHub repo, here is the code