Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
367 views
in Technique[技术] by (71.8m points)

java - save the object using Hibernate object references an unsaved transient instance save the transient instance before flushing

I'm trying to save instance and this instance has an aggregation with another instance..the problem isi can't change the cascade of the relation or synchronize the other entity before synchronizing the parent entity..is there another way to do so ?? thank you,

question from:https://stackoverflow.com/questions/66061106/save-the-object-using-hibernate-object-references-an-unsaved-transient-instance

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

There is no other way. Hibernate can only flush entities if you explicitly merge/persist them or through cascades.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...