Package org.qi4j.api.unitofwork

Examples of org.qi4j.api.unitofwork.UnitOfWork.complete()


        {
            TestCase testCase = uow.newEntity( TestCase.class );

            testCase.someProperty().set( null );

            uow.complete();
            fail( "Should not be allowed to set invalid property value" );
        }
        catch( Exception e )
        {
            uow.discard();
View Full Code Here


        {
            TestCase testCase = uow.newEntity( TestCase.class );

            testCase.otherProperty().set( "" );

            uow.complete();
            fail( "Should not be allowed to set invalid property value" );
        }
        catch( Exception e )
        {
            uow.discard();
View Full Code Here

            EntityBuilder<TestComposite3> builder = unitOfWork.newEntityBuilder( TestComposite3.class );
            builder.instance().mandatoryAssociation().set( ref );
            TestComposite3 testComposite3 = builder.newInstance();

            unitOfWork.complete();
        }
        finally
        {
            unitOfWork.discard();
        }
View Full Code Here

            EntityBuilder<TestComposite3> builder = unitOfWork.newEntityBuilder( TestComposite3.class );
            builder.instance().mandatoryAssociation().set( ref );
            builder.instance().optionalAssociation().set( ref );
            TestComposite3 testComposite3 = builder.newInstance();

            unitOfWork.complete();
        }
        finally
        {
            unitOfWork.discard();
        }
View Full Code Here

            EntityBuilder<TestComposite3> builder = unitOfWork.newEntityBuilder( TestComposite3.class );
            builder.instance().optionalAssociation().set( ref );
            TestComposite3 testComposite3 = builder.newInstance();

            unitOfWork.complete();
        } finally
        {
            unitOfWork.discard();
        }
    }
View Full Code Here

        UnitOfWork uow = module.newUnitOfWork();
        TestCase test = uow.newEntity( TestCase.class );

        try
        {
            uow.complete();
            fail( "Validation did not occur" );
        }
        finally
        {
            uow.discard();
View Full Code Here

        entityBuilder.instance().someValue().set( some );
        SomeEntity entity = entityBuilder.newInstance();

        assertThat( "Value has been set", entity.someValue().get().another().get().val1().get(), equalTo( "Foo" ) );

        unitOfWork.complete();
    }

    public enum TestEnum
    {
        somevalue, anothervalue
View Full Code Here

            entityBuilder.instance().someValue().set( some );
            SomeEntity entity = entityBuilder.newInstance();

            assertThat( "Value has been set", entity.someValue().get().another().get().val1().get(), equalTo( "Foo" ) );

            unitOfWork.complete();
        }
        finally
        {
            unitOfWork.discard();
        }
View Full Code Here

            associationBuilder.prototype().some().set( entity );
            associationValue = associationBuilder.newInstance();

            String json = associationValue.toString();

            unitOfWork.complete();

            unitOfWork = module.newUnitOfWork();

            AssociationValue newAssociationValue = module.newValueFromJSON( AssociationValue.class, json );
View Full Code Here

                        if( "POST".equals( ( (HttpServletRequest) requestCycle.getRequest()
                            .getContainerRequest() ).getMethod() ) )
                        {
                            // "Save"
                            logger.debug( "  ### COMPLETE " + uow + "   ### MODULE: " + qi4jModule );
                            uow.complete();
                        }
                        else
                        {
                            // GET requests
                            logger.debug( "  ### DISCARD " + uow + "   ### MODULE: " + qi4jModule );
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.