public void testManagedInterface() {
OpenJPAEntityManager em = emf.createEntityManager();
// Add some entities
em.getTransaction().begin();
ManagedIface mif = em.createInstance(ManagedIface.class);
mif.setIntFieldSup(10);
ImplClassA ica = new ImplClassA();
ica.setImplClassAName("ImplClassAName");
ica.setIntFieldSup(11);
em.persist(mif);
em.persist(ica);
em.getTransaction().commit();
em.clear();
// Verify that the iface table does not contain a discriminator column
verifyNoDypeColumn(em, "ManagedIface");
// Verify that the impl table does not contain a discriminator column
verifyNoDypeColumn(em, "ImplClassA");
// Query the subclass tables. Make sure the counts are correct and
// the result is castable to the entity and interface types.
verifyInheritanceQueryResult(em, "ImplClassA",
classArray(ImplClassA.class, ManagedIface.class), ica.getId());
// Query the interface2 table. Make sure the count is correct and
// the result is castable to the interface type.
verifyInheritanceQueryResult(em, "ManagedIface",
classArray(ManagedIface.class), mif.getId(),
ica.getId());
em.close();
}