Examples of newEntity()


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

    @Ignore( "Validation is moved to sandbox, and UoW is under massive refactoring." )
    public void givenCompositeWithValidatableWhenUnitCompletesThenPerformValidation()
        throws UnitOfWorkCompletionException
    {
        UnitOfWork uow = module.newUnitOfWork();
        TestCase test = uow.newEntity( TestCase.class );

        try
        {
            uow.complete();
            fail( "Validation did not occur" );
View Full Code Here

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

            {
                e.printStackTrace();
            }

            // Cargo and HandlingEvent aggregate roots
            uow.newEntity( CargoAggregateRoot.class, CargoAggregateRoot.CARGOS_ID );
            uow.newEntity( HandlingEventAggregateRoot.class, HandlingEventAggregateRoot.HANDLING_EVENTS_ID );

            try
            {
                uow.complete();
View Full Code Here

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

                e.printStackTrace();
            }

            // Cargo and HandlingEvent aggregate roots
            uow.newEntity( CargoAggregateRoot.class, CargoAggregateRoot.CARGOS_ID );
            uow.newEntity( HandlingEventAggregateRoot.class, HandlingEventAggregateRoot.HANDLING_EVENTS_ID );

            try
            {
                uow.complete();
                logger.debug( "BASIC DATA CREATED" );
View Full Code Here

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

    @Test
    public void testGetModuleOfComposite()
        throws Exception
    {
        UnitOfWork unitOfWork = module.newUnitOfWork();
        TestEntity testEntity = unitOfWork.newEntity( TestEntity.class );

        api.moduleOf( testEntity );

        unitOfWork.discard();
View Full Code Here

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

    public void givenValuesOfTheSameTypeAndSameStateWhenTestingAssociationDescriptorEqualityExpectEquals()
    {
        UnitOfWork uow = module.newUnitOfWork();
        try
        {
            AnEntity anEntity = uow.newEntity( AnEntity.class );

            SomeWithAssociations some = buildSomeWithAssociation( anEntity );
            AssociationDescriptor someAssocDesc = qi4j.api().associationDescriptorFor( some.anEntity() );
            AssociationDescriptor someManyAssocDesc = qi4j.api().associationDescriptorFor( some.manyEntities() );
View Full Code Here

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

    public void givenValuesOfTheSameTypeAndDifferentStateWhenTestingAssociationDescriptorEqualityExpectEquals()
    {
        UnitOfWork uow = module.newUnitOfWork();
        try
        {
            SomeWithAssociations some = buildSomeWithAssociation( uow.newEntity( AnEntity.class ) );
            AssociationDescriptor someAssocDesc = qi4j.api().associationDescriptorFor( some.anEntity() );
            AssociationDescriptor someManyAssocDesc = qi4j.api().associationDescriptorFor( some.manyEntities() );

            SomeWithAssociations some2 = buildSomeWithAssociation( uow.newEntity( AnEntity.class ) );
            AssociationDescriptor some2AssocDesc = qi4j.api().associationDescriptorFor( some2.anEntity() );
View Full Code Here

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

        {
            SomeWithAssociations some = buildSomeWithAssociation( uow.newEntity( AnEntity.class ) );
            AssociationDescriptor someAssocDesc = qi4j.api().associationDescriptorFor( some.anEntity() );
            AssociationDescriptor someManyAssocDesc = qi4j.api().associationDescriptorFor( some.manyEntities() );

            SomeWithAssociations some2 = buildSomeWithAssociation( uow.newEntity( AnEntity.class ) );
            AssociationDescriptor some2AssocDesc = qi4j.api().associationDescriptorFor( some2.anEntity() );
            AssociationDescriptor some2ManyAssocDesc = qi4j.api().associationDescriptorFor( some2.manyEntities() );

            assertThat( "AssociationDescriptor equal",
                        someAssocDesc,
View Full Code Here

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

    public void givenValuesOfDifferentTypeAndSameStateWhenTestingAssociationDescriptorEqualityExpectNotEquals()
    {
        UnitOfWork uow = module.newUnitOfWork();
        try
        {
            AnEntity anEntity = uow.newEntity( AnEntity.class );

            SomeWithAssociations some = buildSomeWithAssociation( anEntity );
            AssociationDescriptor someAssocDesc = qi4j.api().associationDescriptorFor( some.anEntity() );
            AssociationDescriptor someManyAssocDesc = qi4j.api().associationDescriptorFor( some.manyEntities() );
View Full Code Here

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

    public void givenValuesOfSameTypeAndDifferentStateWhenTestingAssociationStateEqualityExpectNotEquals()
    {
        UnitOfWork uow = module.newUnitOfWork();
        try
        {
            SomeWithAssociations some = buildSomeWithAssociation( uow.newEntity( AnEntity.class ) );
            SomeWithAssociations some2 = buildSomeWithAssociation( uow.newEntity( AnEntity.class ) );

            assertThat( "Association State not equal",
                        some.anEntity().get(),
                        not( equalTo( some2.anEntity().get() ) ) );
View Full Code Here

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

    {
        UnitOfWork uow = module.newUnitOfWork();
        try
        {
            SomeWithAssociations some = buildSomeWithAssociation( uow.newEntity( AnEntity.class ) );
            SomeWithAssociations some2 = buildSomeWithAssociation( uow.newEntity( AnEntity.class ) );

            assertThat( "Association State not equal",
                        some.anEntity().get(),
                        not( equalTo( some2.anEntity().get() ) ) );
            assertThat( "Association State hashcode not equal",
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.