Community
Participate
Working Groups
EclipseLink should warn or even stop deployment when a single table inheritance strategy is used with a subclass having a nonnull field. Otherwise other entities is the object tree can't be persisted. This moves the failure from "runtime" to "deploytime". E.g.: @Entity @Inheritance(strategy = InheritanceType.SINGLE_TABLE) @DiscriminatorColumn(name = "type") @DiscriminatorValue("A") public class A { @Id @GeneratedValue public long id; public String name; } @Entity @DiscriminatorValue("B") public class B extends A { @Column(nullable = false) public String something; } @Singleton @javax.ejb.Startup public class Startup { @PersistenceContext private EntityManager em; @PostConstruct public void init() { A a = new A(); a.name = "asdf"; em.persist(a); // No go } }
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink