A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Object Relational Mapping
deleting entity with many-to-one association
Joined: Jun 03, 2005
Aug 27, 2008 10:55:00
I have two
classes Contact.java and PhoneNumber.java
Contact has a many-to-one relationship with PhoneNumber.
My question is if the user deletes the phone number from UI it should be delete from database. To achive this i am doing
this code is deleting the phone number reference from contact but not deleting the record from the phone number table. How to achive this?
Cameron Wallace McKenzie
author and cow tipper
Joined: Aug 26, 2006
Sep 02, 2008 16:38:00
Why not just get the phoneNumber, and then call a delete on it? That would delete the object itself.
Hibernate Made Easy
What is WebSphere???
JSF 2.0 Made Easy
SCJA Certification Guides
I agree. Here's the link:
- if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
subject: deleting entity with many-to-one association
Native contact list
Making multiple files from single file
Input From Console
Enthuware's Mock Exams and My telephone number
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2013