Package org.qi4j.api.unitofwork

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


    @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

    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

    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

        {
            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

    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

    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

    {
        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

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

            SomeWithAssociations some = buildSomeWithAssociation( anEntity );
            OtherWithAssociations other = buildOtherWithAssociation( anEntity );

            assertThat( "Association State equal",
View Full Code Here

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

            SomeWithAssociations some = buildSomeWithAssociation( anEntity );
            SomeWithAssociations some2 = buildSomeWithAssociation( anEntity );

            assertThat( "Association 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.