Updating an Entity with Hibernate Reactive and Panache #32019
-
I am trying to update an entity with hibernate reactive and panache. I saw in the documentation that if you have a persistent entity (i.e. obtained by fetching using findById) any modifications would be persisted when the transaction is committed. However, this doesn't seem to be working. Here is my attempt at updating a user profile object:
Here is my profile definition:
I would appreciate any help understanding why this doesn't work. Also, is there a better way to go about making updates? It seems like manually updating each field of the profile is not the best. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
/cc @DavideD (hibernate-reactive), @FroMage (panache), @Sanne (hibernate-reactive), @gavinking (hibernate-reactive), @loicmathieu (panache) |
Beta Was this translation helpful? Give feedback.
-
Which version of Quarkus are you using? |
Beta Was this translation helpful? Give feedback.
-
Any ideas on this? |
Beta Was this translation helpful? Give feedback.
-
I haven't had the time to create a test case. If you could provide a project that shows the error, I will look into it |
Beta Was this translation helpful? Give feedback.
-
I think I figured out the problem. It seems like when you have fields in the entity class that are not explicitly marked 'public', they will not get updated when you try to update them as part of a transaction. Marking all the fields of the panache entity as public fixes the problem. |
Beta Was this translation helpful? Give feedback.
I think I figured out the problem. It seems like when you have fields in the entity class that are not explicitly marked 'public', they will not get updated when you try to update them as part of a transaction. Marking all the fields of the panache entity as public fixes the problem.