Examples of newEntity()


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

        throws Exception
    {
        UnitOfWork unitOfWork = module.newUnitOfWork();
        try
        {
            PersonEntity charles = unitOfWork.newEntity( PersonEntity.class );
            charles.changeName( "Charles" );
            Assert.assertEquals( charles.getName(), "Charles" );

            PersonEntity daniel = unitOfWork.newEntity( PersonEntity.class );
            daniel.changeName( "Daniel" );
View Full Code Here

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

        {
            PersonEntity charles = unitOfWork.newEntity( PersonEntity.class );
            charles.changeName( "Charles" );
            Assert.assertEquals( charles.getName(), "Charles" );

            PersonEntity daniel = unitOfWork.newEntity( PersonEntity.class );
            daniel.changeName( "Daniel" );
            Assert.assertEquals( daniel.getName(), "Daniel" );

            PersonEntity lisa = unitOfWork.newEntity( PersonEntity.class );
            lisa.changeName( "Lisa" );
View Full Code Here

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

            PersonEntity daniel = unitOfWork.newEntity( PersonEntity.class );
            daniel.changeName( "Daniel" );
            Assert.assertEquals( daniel.getName(), "Daniel" );

            PersonEntity lisa = unitOfWork.newEntity( PersonEntity.class );
            lisa.changeName( "Lisa" );
            Assert.assertEquals( lisa.getName(), "Lisa" );

            charles.befriend( daniel );
            charles.befriend( lisa );
View Full Code Here

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

        UnitOfWork unitOfWork = uowf.newUnitOfWork();

        try
        {
            unitOfWork.newEntity( ProductEntity.class );
            fail( "Should not be able to create product here" );
        }
        catch (EntityTypeNotFoundException e)
        {
            // Ok
View Full Code Here

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

            fail( "Should not be able to create product here" );
        }
        catch (EntityTypeNotFoundException e)
        {
            // Ok
            ProductCatalog catalog = unitOfWork.newEntity( ProductCatalog.class, "1" );
            unitOfWork.complete();
        }
        unitOfWork = uowf.newUnitOfWork();

        String id;
View Full Code Here

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

    {
        UnitOfWork uow = module.newUnitOfWork();

        try
        {
            TestCase testCase = uow.newEntity( TestCase.class );

            testCase.someProperty().set( null );

            uow.complete();
            fail( "Should not be allowed to set invalid property value" );
View Full Code Here

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

    {
        UnitOfWork uow = module.newUnitOfWork();

        try
        {
            TestCase testCase = uow.newEntity( TestCase.class );

            testCase.otherProperty().set( "" );

            uow.complete();
            fail( "Should not be allowed to set invalid property value" );
View Full Code Here

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

        throws Exception
    {
        UnitOfWork unitOfWork = module.newUnitOfWork();
        try
        {
            TestComposite4 ref = unitOfWork.newEntity( TestComposite4.class );

            EntityBuilder<TestComposite3> builder = unitOfWork.newEntityBuilder( TestComposite3.class );
            builder.instance().mandatoryAssociation().set( ref );
            TestComposite3 testComposite3 = builder.newInstance();
View Full Code Here

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

        throws Exception
    {
        UnitOfWork unitOfWork = module.newUnitOfWork();
        try
        {
            TestComposite4 ref = unitOfWork.newEntity( TestComposite4.class );

            EntityBuilder<TestComposite3> builder = unitOfWork.newEntityBuilder( TestComposite3.class );
            builder.instance().mandatoryAssociation().set( ref );
            builder.instance().optionalAssociation().set( ref );
            TestComposite3 testComposite3 = builder.newInstance();
View Full Code Here

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

        throws Exception
    {
        UnitOfWork unitOfWork = module.newUnitOfWork();
        try
        {
            TestComposite4 ref = unitOfWork.newEntity( TestComposite4.class );

            EntityBuilder<TestComposite3> builder = unitOfWork.newEntityBuilder( TestComposite3.class );
            builder.instance().optionalAssociation().set( ref );
            TestComposite3 testComposite3 = builder.newInstance();
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.