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

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


    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();
View Full Code Here


    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();
View Full Code Here

    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) {
            e.printStackTrace();
View Full Code Here

    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) {
            if (!(e.getCause() instanceof IllegalStateException)) {
View Full Code Here

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

            OneInverseSideLocal inverseLocal = createOneInverseSide(compoundPK_20_10_field1);
            ManyOwningSideLocal owningLocal = createManyOwningSide(compoundPK_20_10, compoundPK_20_10_field1);
            owningLocal.setOneInverseSide(inverseLocal);
            completeTransaction();

            validateOneToManyRelationship();
View Full Code Here

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

            OneInverseSideLocal inverseLocal = createOneInverseSide(compoundPK_20_10_field1);
            ManyOwningSideLocal owningLocal = createManyOwningSide(compoundPK_20_10, compoundPK_20_10_field1);
            owningLocal.setOneInverseSide(inverseLocal);
            completeTransaction();

            owningLocal.testEJBSelect();
View Full Code Here

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

            OneInverseSideLocal inverseLocal = createOneInverseSide(compoundPK_20_10_field1);
            ManyOwningSideLocal owningLocal = createManyOwningSide(compoundPK_20_20, compoundPK_20_20_field1);
            owningLocal.setOneInverseSide(inverseLocal);
// todo should fail when we have fk as part of pk
//            Assert.fail();
            completeTransaction();
View Full Code Here

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

            OneInverseSideLocal inverseLocal = createOneInverseSide(compoundPK_20_10_field1);
            ManyOwningSideLocal owningLocal = createManyOwningSide(compoundPK_20_10, compoundPK_20_10_field1);
            inverseLocal.setManyOwningSide(Collections.singleton(owningLocal));
            completeTransaction();

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

    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) {
            if (!(e.getCause() instanceof IllegalStateException)) {
View Full Code Here

        }
    }

    private OneInverseSideLocal createOneInverseSide(Integer id) throws Exception {
        OneInverseSideLocalHome home = oneInverseHome;
        OneInverseSideLocal oneInverseSideLocal = home.create(id);
        oneInverseCreated.add(id);
        return oneInverseSideLocal;
    }
View Full Code Here

TOP

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

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.