-
Notifications
You must be signed in to change notification settings - Fork 192
Invalid class type on nested object - MappingCouchbaseConverter - couchbase transactions #1276
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
Looking... |
I'm not able to reproduce this. Use the latest version - 4.3.0. If you still have issues, post with the complete stack trace. { id: doc-id_copy, name:Menu 1, categories:[{id=category_1, products=[{id=product_1}, {id=product_2}]}]}
|
I still have issues. Your code is working because there is no casting in toString(). Please try add this line to the end of test: Repo with example code. Stack trace:
|
I'll keep this open for further investigation as to why the documentation doesn't match - but the following will work.
|
I realize this was first, but please refer to #1312 as it has more information on it. I'll make this the 'duplicate'. |
Transaction conversion on read, according to the documentation, should work with this code :
When entity contains a list of nested objects then nested field has incorrect type (
ArrayList<HashMap>
) and app crashes with 'java.lang.ClassCastException: class java.util.HashMap cannot be cast to class com.example.MenuCategory'.MenuCategory category = menu.getCategories().get(0); // ClassCastException
Document in DB:
com.example.Menu:
com.example.MenuCategory:
The text was updated successfully, but these errors were encountered: