First we explain the context. I have a backend Java (Spring / Hibernate) application accessed through JMS. I have a client application (RESTfull) that I access through Url. I have a complex entity with more than one list (most of them are lazy), and this object is a composition of other objects.
Problem. Since I access it through the URL, I create the Java object in the client application from the URL parameters. I send it to the server via JMS, but on the backEnd I do not have a Hibernate object, so I cannot merge it.
I can go through everything that came from the client, for example:
- get hibernate object by id
- check what is different
- set new values
- update
and repeat it for each composition object, but I wonder if there is a more elegant and "easy to maintain" way to update this object with all the changes.
Hope I explained it well. Thanks in advance!
source share