Register / Login
Object Relational Mapping
deleting entity with many-to-one association
posted 8 years ago
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
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
posted 7 years ago
Why not just get the phoneNumber, and then call a delete on it? That would delete the object itself.
Native contact list
Enthuware's Mock Exams and My telephone number
Making multiple files from single file
Input From Console