Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
    Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

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

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Report post to moderator
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.
 
Marshal
Posts: 70370
283
  • Mark post as helpful
  • send pies
  • Report post to moderator
People will be more likely to reply if they know what the thread is about.
 
Sheriff
Posts: 22004
107
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
  • Report post to moderator
Moving to our ORM forum where we discuss Hibernate.
 
author & internet detective
Posts: 40213
816
Eclipse IDE VI Editor Java
 
    Bookmark Topic Watch Topic
  • New Topic