This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Simple requirement .. but I don't know how! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply locked New topic
Author

Simple requirement .. but I don't know how!

abu alfouz
Ranch Hand

Joined: Nov 20, 2006
Posts: 44
Hi All,

I work on an application that connect to database by hibernate (I use annotations). I have 2 entities (Department and Employee). Of course the Employee has one Department but the Department has many employees.

What I want is to be able to delete some Department without delete its Employees. (When deleting Department the hibernate should delete constraints that link some Employees to it without deleting the Employees).

Here are the classes:

*** This is the Department class:





*** This is the Employee class:




Any help please.

Thank you.


SCJP 1.5
SCWCD 1.4
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38087
    
  22
People will be more likely to reply if they know what the thread is about.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19656
    
  18

Moving to our ORM forum where we discuss Hibernate.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30138
    
150

I see it is already there. Closing duplicate thread


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Simple requirement .. but I don't know how!
 
Similar Threads
Implementation of association classes and mapping in hibernate
Simple requirement .. but I don't know how!
Multiple Column Join
Exception while deleting a Entity
Getting stuck with persisting a M:M relationship