Examples of newUnitOfWork()


Examples of org.qi4j.api.structure.Module.newUnitOfWork()

    )
        throws InstantiationException
    {
        T configuration;
        Module module = api.getModule( serviceComposite );
        UnitOfWork buildUow = module.newUnitOfWork();

        EntityBuilder<T> configBuilder = buildUow.newEntityBuilder( serviceModel.<T>configurationType(), identity );

        // Check for defaults
        String s = identity + ".properties";
View Full Code Here

Examples of org.qi4j.api.structure.Module.newUnitOfWork()

        finally
        {
            unitOfWork.discard();
        }

        unitOfWork = module.newUnitOfWork();
        try
        {
            ProductCatalog catalog = unitOfWork.get( ProductCatalog.class, "1" );
            Product product = catalog.findProduct( id );
            product.price().set( 100 );
View Full Code Here

Examples of org.qi4j.api.structure.Module.newUnitOfWork()

        int exitStatus = 0;

        try {

            UnitOfWork uow = domainModule.newUnitOfWork();
            EntityBuilder<PretextEntity> builder = uow.newEntityBuilder( PretextEntity.class );
            PretextEntity pretext = builder.instance();
            pretext.reason().set( "Testing purpose" );
            builder.newInstance();
            uow.complete();
View Full Code Here

Examples of org.qi4j.api.structure.Module.newUnitOfWork()

            PretextEntity pretext = builder.instance();
            pretext.reason().set( "Testing purpose" );
            builder.newInstance();
            uow.complete();

            uow = domainModule.newUnitOfWork();
            QueryBuilder<PretextEntity> queryBuilder = domainModule.newQueryBuilder( PretextEntity.class );
            queryBuilder = queryBuilder.where( eq( templateFor( PretextEntity.class ).reason(), "Testing purpose" ) );
            Query<PretextEntity> query = uow.newQuery( queryBuilder );
            pretext = query.find();
            if ( pretext == null ) {
View Full Code Here

Examples of org.qi4j.api.structure.Module.newUnitOfWork()

            throws InstantiationException
        {
            T configuration;
            Module module = api.moduleOf( serviceComposite );
            Usecase usecase = UsecaseBuilder.newUsecase( "Configuration:" + me.identity().get() );
            UnitOfWork buildUow = module.newUnitOfWork( usecase );

            EntityBuilder<T> configBuilder = buildUow.newEntityBuilder( serviceModel.<T>configurationType(), identity );

            // Check for defaults
            String s = identity + ".properties";
View Full Code Here

Examples of org.qi4j.api.structure.Module.newUnitOfWork()

        finally
        {
            unitOfWork.discard();
        }

        unitOfWork = module.newUnitOfWork();
        try
        {
            ProductCatalog catalog = unitOfWork.get( ProductCatalog.class, "1" );
            Product product = catalog.findProduct( id );
            product.price().set( 100 );
View Full Code Here

Examples of org.qi4j.api.structure.Module.newUnitOfWork()

                module.entities( SomeOtherFoo.class );
            }

        }.module();

        UnitOfWork uow = module.newUnitOfWork();

        SomeOtherFoo someOtherFoo = uow.newEntityBuilder( SomeOtherFoo.class ).newInstance();
        BasicFoo basicFoo = uow.newEntityBuilder( BasicFoo.class ).newInstance();
        Foo foo = uow.newEntityBuilder( Foo.class ).newInstance();
View Full Code Here

Examples of org.qi4j.api.structure.Module.newUnitOfWork()

        String basicFooIdentity = ( (Identity) basicFoo ).identity().get();
        String fooIdentity = ( (Identity) foo ).identity().get();

        uow.complete();

        uow = module.newUnitOfWork();

        uow.get( SomeOtherFoo.class, someOtherFooIdentity );
        uow.get( BasicFoo.class, basicFooIdentity );
        uow.get( Foo.class, fooIdentity );
View Full Code Here

Examples of org.qi4j.api.structure.Module.newUnitOfWork()

                module.entities( SomeOtherFoo.class, BasicFoo.class );
            }

        }.module();

        UnitOfWork uow = module.newUnitOfWork();

        SomeOtherFoo someOtherFoo = uow.newEntityBuilder( SomeOtherFoo.class ).newInstance();
        BasicFoo basicFoo = uow.newEntityBuilder( BasicFoo.class ).newInstance();
        try
        {
View Full Code Here

Examples of org.qi4j.api.structure.Module.newUnitOfWork()

        String someOtherFooIdentity = ( (Identity) someOtherFoo ).identity().get();
        String basicFooIdentity = ( (Identity) basicFoo ).identity().get();

        uow.complete();

        uow = module.newUnitOfWork();

        assertEquals( CATHEDRAL, uow.get( SomeOtherFoo.class, someOtherFooIdentity ).bar() );
        assertEquals( BAZAR, uow.get( BasicFoo.class, basicFooIdentity ).bar() );
        assertEquals( CATHEDRAL, uow.get( Foo.class, someOtherFooIdentity ).bar() );
        assertEquals( BAZAR, uow.get( Foo.class, basicFooIdentity ).bar() );
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.