orphan « Relationship « JPA Q&A





1. Orphans remain in database even with orphanRemoval=true on one-to-many relationship (JPA/Hibernate)    stackoverflow.com

@Entity
@Inheritance(strategy = InheritanceType.SINGLE_TABLE)
@Table(name = "company_policies")
@DiscriminatorColumn(name = "rule_name")
public abstract class AbstractPolicyRule implements Serializable {

  @Transient
  private static final long serialVersionUID = 1L;

  @Id
  @GeneratedValue
  private Long id;
 ...