use of org.apache.openejb.test.entity.cmr.cmrmapping.ManyOwningSideLocal in project tomee by apache.
the class CmrMappingTests method createManyOwningSide.
private ManyOwningSideLocal createManyOwningSide(final Integer id, final Integer field1) throws Exception {
final ManyOwningSideLocalHome home = manyHome;
final ManyOwningSideLocal manyOwningSideLocal = home.create(id, field1);
manyCreated.add(id);
return manyOwningSideLocal;
}
use of org.apache.openejb.test.entity.cmr.cmrmapping.ManyOwningSideLocal in project tomee by apache.
the class CmrMappingTests method testOneToManySetCMROnInverseSide.
public void testOneToManySetCMROnInverseSide() throws Exception {
beginTransaction();
try {
final OneInverseSideLocal inverseLocal = createOneInverseSide(compoundPK_20_10_field1);
final ManyOwningSideLocal owningLocal = createManyOwningSide(compoundPK_20_10, compoundPK_20_10_field1);
inverseLocal.setManyOwningSide(Collections.singleton(owningLocal));
completeTransaction();
validateOneToManyRelationship();
} catch (final Throwable e) {
e.printStackTrace();
throw new TestFailureException(new AssertionFailedError("Received Exception " + e.getClass() + " : " + e.getMessage()));
} finally {
completeTransaction();
cleanDb();
}
}
Aggregations