title: Cascade deleting from join table with @ManyToMany annotation
body: <p>Hi I got a problem with mapping my entities. I'm using JPA2 and Hibernate implementation. I got tables with @ManyToMany annotation </p>
  
  <p><a href="http://img204.imageshack.us/img204/7558/przykladd.png" rel="nofollow">http://img204.imageshack.us/img204/7558/przykladd.png</a></p>
  
  <p>I mapped it with :</p>
  
  <pre><code>@Entity
  @Table("employee")
  class Employee {
        @Id
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        private Integer id;
  
    @Column
    private String name; 
  
    @ManyToMany
    @JoinTable(name = "proj_emp",
               joinColumns = @JoinColumn(name = "employee_id", referencedColumnName = "id"),
               inverseJoinColumns = @JoinColumn(name = "project_id", referencedColumnName = "id"), 
               uniqueConstraints = @UniqueConstraint(columnNames = {"employee_id", "project_id"})) 
    private List&lt;Project&gt; projects;                ...}
  
  
  @Entity
  @Table("project")
  class Project {
     @Id
     @GeneratedValue(strategy = GenerationType.IDENTITY)
     private Integer id; 
  
     @Column  
     private String name;    
        
     @Column    
     private Integer budget;        
  
     @ManyToMany(mappedBy = "projects")     
     private List&lt;Employee&gt; employees;                ...}
  </code></pre>
  
  <p>Now I would like to have a cascade deleting from table proj_emp when I delete records from Employee, but nothing from table Project can be deleted.</p>
  
  <p>What is the best way to acquire that? </p>
  
  <p>Thanks
  Dawid</p>