Answer the question
In order to leave comments, you need to log in
Why is data lost on the client?
I transfer an object from the client to the server, the entity of the database table, it has a One To Many relationship. I use hibernate to communicate with the database. Through the debugger, I see that everything is in order on the server, all the data is in place:
But on the client there is already an exception:
The code that I use for transmission:serializer.writeObject(orderHeaders);
orderHeaders = (ArrayList<OrderHeaderEntity>) deserializer.readObject();
Answer the question
In order to leave comments, you need to log in
Nested data must be passed in several requests. The parser built into the browser cannot parse sublevels. In some browsers it can, but this is not the rule.
Hello.
Dig into the topic "hibernate lazy initialization" (If you're using it in relation to One to Many - fetch = FetchType.LAZY
). The problem is that the associated object is not loaded from the database (here you need to read about proxy objects in hibernate).
To explicitly initialize an object from the DB, I used:Hibernate.initialize(Object obj)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question