Package org.qi4j.spi.entitystore

Examples of org.qi4j.spi.entitystore.DefaultEntityStoreUnitOfWork


    }

    @Override
    public EntityStoreUnitOfWork newUnitOfWork( Usecase usecase, Module module, long currentTime )
    {
        return new DefaultEntityStoreUnitOfWork( entityStoreSPI, newUnitOfWorkId(), module, usecase, currentTime );
    }
View Full Code Here


        Connection connection = null;
        PreparedStatement ps = null;
        ResultSet rs = null;
        UsecaseBuilder builder = UsecaseBuilder.buildUsecase( "qi4j.entitystore.sql.visit" );
        Usecase usecase = builder.withMetaInfo( CacheOptions.NEVER ).newUsecase();
        final DefaultEntityStoreUnitOfWork uow = new DefaultEntityStoreUnitOfWork( entityStoreSPI,
                                                                                   newUnitOfWorkId(), module, usecase,
                                                                                   System.currentTimeMillis() );
        try
        {
            connection = database.getConnection();
View Full Code Here

    @Override
    public EntityState entityStateOf( EntityStoreUnitOfWork unitOfWork, EntityReference identity )
    {
        try
        {
            DefaultEntityStoreUnitOfWork desuw = (DefaultEntityStoreUnitOfWork) unitOfWork;

            Module module = desuw.module();

            if( !root.nodeExists( identity.identity() ) )
            {
                throw new NoSuchEntityException( identity, UnknownType.class );
            }
View Full Code Here

    }

    @Override
    public EntityStoreUnitOfWork newUnitOfWork( Usecase usecase, Module module, long currentTime )
    {
        return new DefaultEntityStoreUnitOfWork( entityStoreSpi, newUnitOfWorkId(), module, usecase, currentTime );
    }
View Full Code Here

                    public <ReceiverThrowableType extends Throwable> void sendTo( Receiver<? super EntityState, ReceiverThrowableType> receiver )
                        throws ReceiverThrowableType, EntityStoreException
                    {
                        UsecaseBuilder builder = UsecaseBuilder.buildUsecase( "qi4j.entitystore.preferences.visit" );
                        Usecase visitUsecase = builder.withMetaInfo( CacheOptions.NEVER ).newUsecase();
                        final DefaultEntityStoreUnitOfWork uow = new DefaultEntityStoreUnitOfWork(
                            entityStoreSpi,
                            newUnitOfWorkId(),
                            module,
                            visitUsecase,
                            System.currentTimeMillis() );
                        try
                        {
                            String[] identities = root.childrenNames();
                            for( String identity : identities )
                            {
                                EntityState entityState = uow.entityStateOf( EntityReference.parseEntityReference( identity ) );
                                receiver.receive( entityState );
                            }
                        }
                        catch( BackingStoreException e )
                        {
View Full Code Here

    // EntityStore

    @Override
    public EntityStoreUnitOfWork newUnitOfWork( Usecase usecaseMetaInfo, Module module, long currentTime )
    {
        return new DefaultEntityStoreUnitOfWork( entityStoreSpi, newUnitOfWorkId(), module, usecaseMetaInfo, currentTime );
    }
View Full Code Here

                    {
                        @Override
                        public void visitMap( MapEntityStore.MapChanger changer )
                            throws IOException
                        {
                            DefaultEntityStoreUnitOfWork uow = (DefaultEntityStoreUnitOfWork) unitOfWork;
                            CacheOptions options = uow.usecase().metaInfo( CacheOptions.class );
                            if( options == null )
                            {
                                options = CacheOptions.ALWAYS;
                            }
View Full Code Here

                        Usecase usecase = UsecaseBuilder
                            .buildUsecase( "qi4j.entitystore.entitystates" )
                            .withMetaInfo( CacheOptions.NEVER )
                            .newUsecase();

                        final DefaultEntityStoreUnitOfWork uow = new DefaultEntityStoreUnitOfWork(
                            entityStoreSpi,
                            newUnitOfWorkId(),
                            module,
                            usecase,
                            System.currentTimeMillis() );
View Full Code Here

    // EntityStore
    @Override
    public EntityStoreUnitOfWork newUnitOfWork( Usecase usecaseMetaInfo, Module module, long currentTime )
    {
        return new DefaultEntityStoreUnitOfWork( entityStoreSpi, newUnitOfWorkId(), module, usecaseMetaInfo, currentTime );
    }
View Full Code Here

    }

    @Override
    public synchronized EntityState entityStateOf( EntityStoreUnitOfWork unitofwork, EntityReference identity )
    {
        DefaultEntityStoreUnitOfWork unitOfWork = (DefaultEntityStoreUnitOfWork) unitofwork;
        Reader in = mapEntityStore.get( identity );
        return readEntityState( unitOfWork, in );
    }
View Full Code Here

TOP

Related Classes of org.qi4j.spi.entitystore.DefaultEntityStoreUnitOfWork

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.