In my work i'm using spring with exidirect, hibernate on the server side and extjs on client side. When i post a form, on the server side spring converts it to the entity.
Entity has a id field, that supposes update operation.
I'm calling service save method, but instead one sql update query i get many many select queries and just then update. It takes much time. And there is no need for this operation.
I was looking similar questions and was trying to use persist method.
This case i get error: detached entity passed to persist.
I do not have enough experience of hibernate. May be i need to configure related entities (OneToMany, ManyToOne and cascade types). Entities are generated by Spring roo tool.
Any suggestions ?
Thank you.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…