use of org.eclipse.jpt.jpa.core.context.persistence.Persistence in project jbosstools-hibernate by jbosstools.
the class HibernateJpaModelTests method testDefaultMapping.
@Test
public void testDefaultMapping() {
assertNotNull(jpaProject);
JpaContextRoot rootContextNode = jpaProject.getContextRoot();
Persistence p = rootContextNode.getPersistenceXml().getRoot();
assertTrue(p.getPersistenceUnitsSize() > 0);
assertTrue(p.getPersistenceUnits().iterator().next() instanceof HibernatePersistenceUnit);
HibernatePersistenceUnit hpu = (HibernatePersistenceUnit) p.getPersistenceUnits().iterator().next();
List<ClassRef> crs = IterableTools.list(hpu.getClassRefs());
assertTrue(crs.size() == 2);
if (crs.get(0).isFor("entity.ManyToMany1")) {
checkManyToMany1(crs.get(0));
checkManyToMany2(crs.get(1));
} else {
checkManyToMany1(crs.get(1));
checkManyToMany2(crs.get(0));
}
}
Aggregations