em = emf.createEntityManager();
root = createData();
}
public void testDetachCascadeIsSet() {
MetaDataRepository repos = emf.getConfiguration()
.getMetaDataRepositoryInstance();
ClassMetaData meta = repos.getCachedMetaData(DMCustomer.class);
assertEquals(ValueMetaData.CASCADE_NONE,
meta.getField("firstName").getCascadeDetach());
assertEquals(ValueMetaData.CASCADE_IMMEDIATE, meta.getField(
"customerInventories").getElement().getCascadeDetach());
meta = repos.getCachedMetaData(DMCustomerInventory.class);
assertEquals(ValueMetaData.CASCADE_NONE,
meta.getField("customer").getCascadeDetach());
assertEquals(ValueMetaData.CASCADE_NONE,
meta.getField("item").getCascadeDetach());