Package org.qi4j.api.unitofwork

Examples of org.qi4j.api.unitofwork.UnitOfWork.discard()


            unitOfWork.complete();
        }
        finally
        {
            unitOfWork.discard();
        }
    }

    interface PersonEntity
        extends EntityComposite
View Full Code Here


        UnitOfWork unitOfWork = module.newUnitOfWork();
        TestEntity testEntity = unitOfWork.newEntity( TestEntity.class );

        api.getModule( testEntity );

        unitOfWork.discard();

        api.getModule( module.newValue( TestValue.class ) );

        api.getModule( module.newTransient( TestTransient.class ) );
View Full Code Here

            unitOfWork.complete();
        }
        finally
        {
            unitOfWork.discard();
        }

        UnitOfWork uow = module.newUnitOfWork();
        try
        {
View Full Code Here

            validateState( spi.getState( testEntity ), spi.getEntityDescriptor( testEntity ) );
            uow.complete();
        }
        finally
        {
            uow.discard();
        }
    }

    private void validateState( AssociationStateHolder state, EntityDescriptor entityDescriptor )
    {
View Full Code Here

    public void testNestedUnitOfWork()
    {
        UnitOfWork uow = module.newUnitOfWork();
        Some some = module.newTransient( Some.class );
        some.doStuff();
        uow.discard();
    }

    @Mixins( SomeMixin.class )
    public interface SomeComposite
        extends Some, TransientComposite
View Full Code Here

            builder.newInstance();
            unitOfWork.complete();
        }
        finally
        {
            unitOfWork.discard();
        }

        assertThat( "Lifecycle.create() was invoked", create, CoreMatchers.equalTo( true ) );
    }
View Full Code Here

            unitOfWork.remove( testEntity );
            unitOfWork.complete();
        }
        finally
        {
            unitOfWork.discard();
        }

        assertThat( "Lifecycle.remove() was invoked", remove, CoreMatchers.equalTo( true ) );
    }
View Full Code Here

                unitOfWork.complete();
            }
            finally
            {
                unitOfWork.discard();
            }
        }

        {
            UnitOfWork unitOfWork = module.newUnitOfWork();
View Full Code Here

                unitOfWork.complete();
            }
            finally
            {
                unitOfWork.discard();
            }
        }

        {
            UnitOfWork unitOfWork = module.newUnitOfWork();
View Full Code Here

                unitOfWork.complete();
            }
            catch( NoSuchEntityException e )
            {
                unitOfWork.discard();
            }
        }

        {
            UnitOfWork unitOfWork = module.newUnitOfWork();
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.