File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Object Relational Mapping and the fly likes Merge operation does not remove from db dependent objects? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Merge operation does not remove from db dependent objects?" Watch "Merge operation does not remove from db dependent objects?" New topic
Author

Merge operation does not remove from db dependent objects?

D. Formenton
Ranch Hand

Joined: Mar 20, 2008
Posts: 47
Hi,

I have two tables: Persons and addresses associated to persons by a foreign key.

When I add a new address to a person the addessesCollection object and the visual object (JSF) updates and the merge operation regularly add a new row to the addresses table of database.

BUT if I remove an existing address, again the addessesCollection object and the visual object (JSF) updates, but the merge operation instead has no effect on addresses table, and the database remain unchanged.

Is there any error in my code or it is a normal feature of merge? And if so, how I can delete the database row according the addressesCollection (to align to)?

Thank you.

Domencio
Hebert Coelho
Ranch Hand

Joined: Jul 14, 2010
Posts: 754

Can you post your mapping?

How do your code remove the relationship?


[uaiHebert.com] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Merge operation does not remove from db dependent objects?
 
Similar Threads
please anyone can help me to resolving the error " java.lang.illegalargumentexception "
Cursor object not returning data properly.
Binding tow tables - TopLink
Opinions on Three Different Approaches
Grid view in jsf