Package org.qi4j.api.unitofwork

Examples of org.qi4j.api.unitofwork.NoSuchEntityException


            throw new UnitOfWorkException( "Unit of work has been closed" );
        }

        if( status() == EntityStatus.REMOVED )
        {
            throw new NoSuchEntityException( identity );
        }

        mixins = entityModel.newMixinHolder();
        state = new EntityStateInstance( entityModel.state(), uow, entityState );
    }
View Full Code Here


    private U loadEntity()
    {
        U entity = module.currentUnitOfWork().get( entityClass, identity );
        if( entity == null )
        {
            throw new NoSuchEntityException( EntityReference.parseEntityReference( identity ), entityClass );
        }
        return entity;
    }
View Full Code Here

            if( model == null )
            {
                // Check if state was found
                if( entityState == null )
                {
                    throw new NoSuchEntityException( identity, mixinType );
                }
                else
                {
                    throw new EntityTypeNotFoundException( mixinType.getName() );
                }
            }

            // Create instance
            entityInstance = new EntityInstance( uow, module, model, entityState );

            instanceCache.put( identity, entityInstance );
        }
        else
        {
            // Check if it has been removed
            if( entityInstance.status() == EntityStatus.REMOVED )
            {
                throw new NoSuchEntityException( identity, mixinType );
            }
        }

        return entityInstance.proxy();
    }
View Full Code Here

    private U loadEntity()
    {
        U entity = module.currentUnitOfWork().get( entityClass, identity );
        if( entity == null )
        {
            throw new NoSuchEntityException( EntityReference.parseEntityReference( identity ), entityClass );
        }
        return entity;
    }
View Full Code Here

        {
            compositeInstance.remove( this );
        }
        else
        {
            throw new NoSuchEntityException( compositeInstance.identity(), compositeInstance.types() );
        }
    }
View Full Code Here

            throw new UnitOfWorkException( "Unit of work has been closed" );
        }

        if( status() == EntityStatus.REMOVED )
        {
            throw new NoSuchEntityException( identity, entityModel.types() );
        }

        mixins = entityModel.newMixinHolder();
        state = new EntityStateInstance( entityModel.state(), uow, entityState );
    }
View Full Code Here

            Module module = desuw.module();

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

            Preferences entityPrefs = root.node( identity.identity() );

            String type = entityPrefs.get( "type", null );
View Full Code Here

TOP

Related Classes of org.qi4j.api.unitofwork.NoSuchEntityException

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.