aspose file tools*
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 Spring in Action this week in the Spring 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: 39408
    
  28
People will be more likely to reply if they know what the thread is about.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19719
    
  20

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
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30758
    
156

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!