for people searching for their solution: Now in Hibernate, resp. JPA 2.0, this is the right way:
@OneToMany(orphanRemoval=true)
More Related Contents:
- Avoid Jackson serialization on non fetched lazy objects
- Spring Boot + JPA : Column name annotation ignored
- org.hibernate.MappingException: Could not determine type for: java.util.List, at table: College, for columns: [org.hibernate.mapping.Column(students)]
- How to remove entity with ManyToMany relationship in JPA (and corresponding join table rows)?
- Creation timestamp and last update timestamp with Hibernate and MySQL
- Is the buildSessionFactory() Configuration method deprecated in Hibernate?
- Default fetch type for one-to-one, many-to-one and one-to-many in Hibernate
- Hibernate : How override an attribute from mapped super class
- Hibernate – Foreign keys instead of Entities
- Hibernate count collection size without initializing
- Getting [SQLITE_BUSY] database file is locked with select statements
- Silently ignored remove()
- @OneToMany and composite primary keys?
- mapping Hibernate query results to custom class?
- How to perform a non-polymorphic HQL query in Hibernate?
- How to set a default query timeout with JPA and Hibernate?
- Change database schema during runtime based on logged in user
- SQL Error: 0, SQLState: 08S01 Communications link failure [duplicate]
- How to map sql native query result into DTO in spring jpa repository?
- javax.transaction.Transactional vs org.springframework.transaction.annotation.Transactional
- Hibernate: How to set NULL query-parameter value with HQL?
- Apparent connection leak detected with Hikari CP
- Can javax.persistence.Query.getResultList() return null?
- Difference between @GeneratedValue and @GenericGenerator
- Spring Data JPA: How can Query return Non- Entities Objects or List of Objects?
- How to map one class with multiple tables in Hibernate/javax.persistance?
- hibernate two tables per one entity
- “Illegal attempt to map a non collection as a @OneToMany, @ManyToMany or @CollectionOfElements” in hibernate when annotating a ConcurrentHashMap
- How to escape colon `:` within a native SQL query in Hibernate?
- How to fetch hibernate query result as associative array of list or hashmap