The save method is used in spring data jpa to save the object. Why is the object association table data returned by the method empty?

I use the save method to save the object and get the object returned by the save method. The data of the joined object is empty

clipboard.png

when I save, I set the id of the associated beComment

I thought I could return the beComment data completely when I returned


what's going on with this problem? Have you solved it? Encounter the same problem!


is there a solution? it's useless to clear it.


@ Resource
private EntityManager entityManager;

xxx.save (xx)

/ / just clear it after saving
entityManager.clear ();

xxx.getxxx () / / what you get is that id gets

.
Menu