Package org.qi4j.runtime.entity

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


        if( handler instanceof ProxyReferenceInvocationHandler )
        {
            handler = Proxy.getInvocationHandler( ( (ProxyReferenceInvocationHandler) handler ).proxy() );
        }
        EntityInstance instance = (EntityInstance) handler;
        return instance.identity();
    }

    protected void checkType( Object instance )
    {
        if( instance != null )
View Full Code Here


    {
        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 )
        throws LifecycleException
    {
View Full Code Here

        EntityInstance compositeInstance = EntityInstance.getEntityInstance( entityComposite );

        if( compositeInstance.status() == EntityStatus.NEW )
        {
            compositeInstance.remove( this );
            uow.remove( compositeInstance.identity() );
        }
        else if( compositeInstance.status() == EntityStatus.LOADED || compositeInstance.status() == EntityStatus.UPDATED )
        {
            compositeInstance.remove( this );
        }
View Full Code Here

        {
            compositeInstance.remove( this );
        }
        else
        {
            throw new NoSuchEntityException( compositeInstance.identity() );
        }
    }

    public void complete()
        throws UnitOfWorkCompletionException, ConcurrentEntityModificationException
View Full Code Here

        if( handler instanceof ProxyReferenceInvocationHandler )
        {
            handler = Proxy.getInvocationHandler( ( (ProxyReferenceInvocationHandler) handler ).proxy() );
        }
        EntityInstance instance = (EntityInstance) handler;
        return instance.identity();
    }

    protected void checkType( Object instance )
    {
        if( instance != null )
View Full Code Here

        EntityInstance compositeInstance = EntityInstance.entityInstanceOf( entityComposite );

        if( compositeInstance.status() == EntityStatus.NEW )
        {
            compositeInstance.remove( this );
            uow.remove( compositeInstance.identity() );
        }
        else if( compositeInstance.status() == EntityStatus.LOADED || compositeInstance.status() == EntityStatus.UPDATED )
        {
            compositeInstance.remove( this );
        }
View Full Code Here

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

    @Override
    public void complete()
View Full Code Here

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

    @Override
    public void remove( Object entity )
        throws LifecycleException
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.