Package org.apache.openejb.test.entity.cmr.cmrmapping

Examples of org.apache.openejb.test.entity.cmr.cmrmapping.ManyOwningSideLocal


    public void testOneToManySetCMROnInverseSideResetPK() throws Exception {
        beginTransaction();
        try {

            OneInverseSideLocal inverseLocal = createOneInverseSide(compoundPK_20_10_field1);
            ManyOwningSideLocal owningLocal = createManyOwningSide(compoundPK_20_20, compoundPK_20_20_field1);
            inverseLocal.setManyOwningSide(Collections.singleton(owningLocal));
// todo should fail when we have fk as part of pk
//            Assert.fail();
            completeTransaction();
        } catch (TransactionRolledbackLocalException e) {
View Full Code Here


        return home.findByPrimaryKey(id);
    }

    private ManyOwningSideLocal createManyOwningSide(Integer id, Integer field1) throws Exception {
        ManyOwningSideLocalHome home = manyHome;
        ManyOwningSideLocal manyOwningSideLocal = home.create(id, field1);
        manyCreated.add(id);
        return manyOwningSideLocal;
    }
View Full Code Here


            // verify one side has a set containing the many bean
            Set set = inverseLocal.getManyOwningSide();
            Assert.assertEquals(1, set.size());
            ManyOwningSideLocal owningLocal = (ManyOwningSideLocal) set.iterator().next();
            Assert.assertEquals(compoundPK_20_10, owningLocal.getPrimaryKey());

            // verify the many bean has a back reference to the one
            OneInverseSideLocal oneInverseSide = owningLocal.getOneInverseSide();
            Assert.assertNotNull(oneInverseSide);
            Assert.assertEquals(compoundPK_20_10_field1, oneInverseSide.getPrimaryKey());

            completeTransaction();
        } finally {
View Full Code Here

TOP

Related Classes of org.apache.openejb.test.entity.cmr.cmrmapping.ManyOwningSideLocal

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.