This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Cascade Type problem

 
masse Satriana
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Is there any clue how using CascadeType in bidirectional relationship?
for example :
I have two tables 1 is Customers and second is FormOrder ( owner of relationship)


The problem is when I insert new record in FormOrder which also specify new Customer, this code should be working. ( since this is not default JPA to persist related entity , so that we are using CascadeType.persist)


The fact is annoying me since there are a message "javax.persistence.EntityExistsException:
Exception Description: Cannot persist detached object"

Any clue would be greatly accepted.

Thanks in advance.
 
masse Satriana
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
Case is closed.
This all is my failure not seeing duplicated data on table FormOrder.
All code in my previous post is working fine.

Regards,
Masse Satriana
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic