Examples of OneOwningSideLocal


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

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

            OneInverseSideLocal inverseLocal = createOneInverseSide(compoundPK_20_10_field1);
            OneOwningSideLocal owningLocal = createOneOwningSide(compoundPK_20_10, compoundPK_20_10_field1);
            owningLocal.setOneInverseSide(inverseLocal);
            completeTransaction();

            validateOneToOneRelationship();
        } catch (Throwable e) {
            e.printStackTrace();
View Full Code Here

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

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

            OneInverseSideLocal inverseLocal = createOneInverseSide(compoundPK_20_10_field1);
            OneOwningSideLocal owningLocal = createOneOwningSide(compoundPK_20_20, compoundPK_20_20_field1);
            owningLocal.setOneInverseSide(inverseLocal);
// todo should fail when we have fk as part of pk
//            Assert.fail();
            completeTransaction();
        } catch (TransactionRolledbackLocalException e) {
            if (!(e.getCause() instanceof IllegalStateException)) {
View Full Code Here

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

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

            OneInverseSideLocal inverseLocal = createOneInverseSide(compoundPK_20_10_field1);
            OneOwningSideLocal owningLocal = createOneOwningSide(compoundPK_20_10, compoundPK_20_10_field1);
            inverseLocal.setOneOwningSide(owningLocal);
            completeTransaction();

            validateOneToOneRelationship();
        } catch (Throwable e) {
View Full Code Here

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

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

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

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

    private void validateOneToOneRelationship() throws Exception {
        try {
            OneInverseSideLocal inverseLocal = findOneInverseSide(compoundPK_20_10_field1);

            OneOwningSideLocal oneOwningSide = inverseLocal.getOneOwningSide();
            Assert.assertNotNull(oneOwningSide);
            Assert.assertEquals(compoundPK_20_10, oneOwningSide.getPrimaryKey());

            OneInverseSideLocal inverseBackRef = oneOwningSide.getOneInverseSide();
            Assert.assertNotNull(inverseBackRef);
            Assert.assertEquals(compoundPK_20_10_field1, inverseBackRef.getPrimaryKey());
            completeTransaction();
        } finally {
            completeTransaction();
View Full Code Here

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

        }
    }

    private OneOwningSideLocal createOneOwningSide(Integer id, Integer field1) throws Exception {
        OneOwningSideLocalHome home = oneOwningHome;
        OneOwningSideLocal oneOwningSideLocal = home.create(id, field1);
        oneOwningCreated.add(id);
        return oneOwningSideLocal;
    }
View Full Code Here

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

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

            OneInverseSideLocal inverseLocal = createOneInverseSide(compoundPK_20_10_field1);
            OneOwningSideLocal owningLocal = createOneOwningSide(compoundPK_20_10, compoundPK_20_10_field1);
            owningLocal.setOneInverseSide(inverseLocal);
            completeTransaction();

            validateOneToOneRelationship();
        } catch (Throwable e) {
            e.printStackTrace();
View Full Code Here

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

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

            OneInverseSideLocal inverseLocal = createOneInverseSide(compoundPK_20_10_field1);
            OneOwningSideLocal owningLocal = createOneOwningSide(compoundPK_20_20, compoundPK_20_20_field1);
            owningLocal.setOneInverseSide(inverseLocal);
// todo should fail when we have fk as part of pk
//            Assert.fail();
            completeTransaction();
        } catch (TransactionRolledbackLocalException e) {
            if (!(e.getCause() instanceof IllegalStateException)) {
View Full Code Here

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

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

            OneInverseSideLocal inverseLocal = createOneInverseSide(compoundPK_20_10_field1);
            OneOwningSideLocal owningLocal = createOneOwningSide(compoundPK_20_10, compoundPK_20_10_field1);
            inverseLocal.setOneOwningSide(owningLocal);
            completeTransaction();

            validateOneToOneRelationship();
        } catch (Throwable e) {
View Full Code Here

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

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

            OneInverseSideLocal inverseLocal = createOneInverseSide(compoundPK_20_10_field1);
            OneOwningSideLocal owningLocal = createOneOwningSide(compoundPK_20_20, compoundPK_20_20_field1);
            inverseLocal.setOneOwningSide(owningLocal);
// todo should fail when we have fk as part of pk
//            Assert.fail();
            completeTransaction();
        } catch (TransactionRolledbackLocalException e) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.