Package org.qi4j.api.unitofwork

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


            try
            {
                unitOfWork.get( employeeEntity2 );
                fail( "Should not work" );

                unitOfWork.complete();
            }
            catch( NoSuchEntityException e )
            {
                unitOfWork.discard();
            }
View Full Code Here


                    {
                        SimpleProduct product = uow.newEntity( SimpleProduct.class );
                        String id = product.identity().get();
                        if( i % 1000 == 0 )
                        {
                            uow.complete();
                            bulk++;
                            uow = module.newUnitOfWork( newUsecase( "createEntityInBulkWithSingleProperty " + bulk ) );
                        }
                    }
                    uow.complete();
View Full Code Here

                            uow.complete();
                            bulk++;
                            uow = module.newUnitOfWork( newUsecase( "createEntityInBulkWithSingleProperty " + bulk ) );
                        }
                    }
                    uow.complete();
                    report.stop( ITERATIONS );
                    writeReport( report );
                    return null;
                }
            } );
View Full Code Here

                    {
                        ComplexProduct product = uow.newEntity( ComplexProduct.class );
                        String id = product.identity().get();
                        if( i % 1000 == 0 )
                        {
                            uow.complete();
                            bulk++;
                            uow = module.newUnitOfWork( newUsecase( "createEntityInBulkWithComplexType " + bulk ) );
                        }
                    }
                    uow.complete();
View Full Code Here

                            uow.complete();
                            bulk++;
                            uow = module.newUnitOfWork( newUsecase( "createEntityInBulkWithComplexType " + bulk ) );
                        }
                    }
                    uow.complete();
                    report.stop( ITERATIONS );
                    writeReport( report );
                    return null;
                }
            } );
View Full Code Here

                    ComplexProduct product = uow.newEntity( ComplexProduct.class, "product" + i );
                    product.name().set( "Product " + i );

                    if( i % 1000 == 0 )
                    {
                        uow.complete();
                        bulk++;
                        uow = module.newUnitOfWork( newUsecase( "readEntityWithComplexType PREPARE " + bulk ) );
                    }
                }
                uow.complete();
View Full Code Here

                        uow.complete();
                        bulk++;
                        uow = module.newUnitOfWork( newUsecase( "readEntityWithComplexType PREPARE " + bulk ) );
                    }
                }
                uow.complete();
            }

            profile( new Callable<Void>()
            {
                @Override
View Full Code Here

                            uow.discard();
                            bulk++;
                            uow = module.newUnitOfWork( newUsecase( "readEntityWithComplexType " + bulk ) );
                        }
                    }
                    uow.complete();
                    report.stop( ITERATIONS );
                    writeReport( report );
                    return null;
                }
            } );
View Full Code Here

                String firstName = data[ 1];
                String lastName = data[ 2];
                createPerson( uow, personId, firstName, lastName );
            }

            uow.complete();
        }

        private void createPerson( UnitOfWork uow, String personId, String firstName, String lastName )
        {
            EntityBuilder<Person> person = uow.newEntityBuilder( Person.class, personId );
View Full Code Here

                TestEntity2_0 entity = uow.get( TestEntity2_0.class, id );
                assertThat( "Property has been created", entity.bar().get(), CoreMatchers.equalTo( "Some value" ) );
                assertThat( "Custom Property has been created", entity.customBar().get(), CoreMatchers.equalTo( "Hello Some value" ) );
                assertThat( "ManyAssociation has been renamed", entity.newFooManyAssoc().count(), CoreMatchers.equalTo( 1 ) );
                assertThat( "Association has been renamed", entity.newFooAssoc().get(), CoreMatchers.equalTo( entity ) );
                uow.complete();
            }
        }

        // Set up version 3.0
        {
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.