Examples of module()


Examples of org.qi4j.bootstrap.SingletonAssembler.module()

        UnitOfWork uow = assembler.module().newUnitOfWork();

        try
        {
            EntityBuilder<TestEntity> entityBuilder = uow.newEntityBuilder( TestEntity.class, "123" );
            entityBuilder.instance().value().set( assembler.module().newValue( TestValue.class ) );
            TestEntity testEntity = entityBuilder.newInstance();

            uow.complete();
            uow = assembler.module().newUnitOfWork();
View Full Code Here

Examples of org.qi4j.bootstrap.SingletonAssembler.module()

            EntityBuilder<TestEntity> entityBuilder = uow.newEntityBuilder( TestEntity.class, "123" );
            entityBuilder.instance().value().set( assembler.module().newValue( TestValue.class ) );
            TestEntity testEntity = entityBuilder.newInstance();

            uow.complete();
            uow = assembler.module().newUnitOfWork();

            Iterable<TestEntity> entities = Iterables.iterable( testEntity = uow.get( testEntity ) );

            QueryBuilder<TestEntity> builder = assembler.module().newQueryBuilder( TestEntity.class );
View Full Code Here

Examples of org.qi4j.bootstrap.SingletonAssembler.module()

            uow.complete();
            uow = assembler.module().newUnitOfWork();

            Iterable<TestEntity> entities = Iterables.iterable( testEntity = uow.get( testEntity ) );

            QueryBuilder<TestEntity> builder = assembler.module().newQueryBuilder( TestEntity.class );

            {
                Specification<Composite> where = QueryExpressions.eq( QueryExpressions.templateFor( TestEntity.class ).foo(), "Bar" );
                Assert.assertTrue( where.satisfiedBy( testEntity ) );
                System.out.println(where);
View Full Code Here

Examples of org.qi4j.bootstrap.SingletonAssembler.module()

                module.services( TestServiceComposite1.class,
                                 TestServiceComposite2.class );
            }
        };

        TestService service = assembler.module().newObject( ServiceConsumer.class ).getService();

        assertThat( "service is first one", service.test(), equalTo( "mixin1" ) );
    }

    @Test
View Full Code Here

Examples of org.qi4j.bootstrap.SingletonAssembler.module()

                module2.services( TestServiceComposite2.class, TestServiceComposite2.class )
                    .visibleIn( Visibility.layer );
            }
        };

        TestService service = assembler.module().newObject( ServiceConsumer.class ).getService();

        assertThat( "service is specified one", service.test(), equalTo( "mixin2" ) );
    }

    @Test
View Full Code Here

Examples of org.qi4j.bootstrap.SingletonAssembler.module()

                module2.addServices( TestServiceComposite2.class, TestServiceComposite2.class )
                    .visibleIn( Visibility.layer );
            }
        };

        TestService service = assembler.module().newObject( ServiceConsumer.class ).getService();

        assertThat( "service is specified one", service.test(), equalTo( "mixin2" ) );
    }

    public static class ServiceConsumer
View Full Code Here

Examples of org.qi4j.runtime.composite.TransientInstance.module()

                InvocationHandler invocationHandler = Proxy.getInvocationHandler( value );
                if( invocationHandler instanceof TransientInstance )
                {
                    TransientInstance handler = (TransientInstance) invocationHandler;
                    valueClassName = Classes.toString( handler.descriptor().types() )
                                     + " in [" + handler.module().name() + "] of [" + handler.module()
                        .layerInstance()
                        .name() + "]";
                }
                else
                {
View Full Code Here

Examples of org.qi4j.runtime.entity.EntityInstance.module()

    public <T> T get( T entity )
        throws EntityTypeNotFoundException
    {
        EntityComposite entityComposite = (EntityComposite) entity;
        EntityInstance compositeInstance = EntityInstance.getEntityInstance( entityComposite );
        ModelModule<EntityModel> model = new ModelModule<EntityModel>( compositeInstance.module(), compositeInstance.entityModel() );
        Class<T> type = (Class<T>) compositeInstance.type();
        return uow.get( compositeInstance.identity(), this, Collections.singletonList( model), type );
    }

    public void remove( Object entity )
View Full Code Here

Examples of org.qi4j.runtime.structure.ModuleUnitOfWork.module()

            return ( (ServiceReferenceInstance.ServiceInvocationHandler) handler ).module();
        }
        else if( compositeOrServiceReferenceOrUow instanceof UnitOfWork )
        {
            ModuleUnitOfWork unitOfWork = (ModuleUnitOfWork) compositeOrServiceReferenceOrUow;
            return unitOfWork.module();
        }
        else if( compositeOrServiceReferenceOrUow instanceof ServiceReferenceInstance )
        {
            ServiceReferenceInstance<?> reference = (ServiceReferenceInstance<?>) compositeOrServiceReferenceOrUow;
            return reference.module();
View Full Code Here

Examples of org.qi4j.spi.entitystore.DefaultEntityStoreUnitOfWork.module()

    {
        try
        {
            DefaultEntityStoreUnitOfWork desuw = (DefaultEntityStoreUnitOfWork) unitOfWork;

            Module module = desuw.module();

            if( !root.nodeExists( identity.identity() ) )
            {
                throw new NoSuchEntityException( identity, UnknownType.class );
            }
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.