Forums Register Login

Update Caos

+Pie Number of slices to send: Send
Hi all, I have an object "A" than contains a Collection of objects "B" and a collection of objects "C". Every time i merge an atribute of A, i noticed that the persistence provider creates a lots of select statements, it´s getting really slow. I have tried the following:

Change from this


to this


but i cannot tell the difference.
+Pie Number of slices to send: Send
What is your provider, and what are the SQL statements?

In JPA merge will always merge references, but only cascade the merge to the related objects if set to cascade. i.e. the collection will always be merged, but the objects in the collection will only be merged if cascading. There is no way in JPA to not merge the collection references, (unless it is lazy and not instantiated), other than manually merging the objects. If you are using EclipseLink the EclipseLink API also provides a shallowMerge and a merge without references.
Your mother was a hamster and your father was a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 864 times.
Similar Threads
Can't map to target entity property
JPA composite key mapping
JPA: Cascade delete for join tables with composite key
Can not remove a EJB 3 entity and the error is: violation of foreign key constraint
can i mark a Set/Collection porpety as @Id
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 04:40:31.