Package org.qi4j.runtime.query.model

Examples of org.qi4j.runtime.query.model.City


        Domain cars = uow.newEntity( Domain.class );
        setName( cars, "Cars" );
        cars.description().set( "Cars" );

        City kualaLumpur = uow.newEntity( City.class, "kualalumpur" );
        setName( kualaLumpur, "Kuala Lumpur" );
        kualaLumpur.country().set( "Malaysia" );
        kualaLumpur.county().set( "Some Jaya" );

        City penang = uow.newEntity( City.class, "penang" );
        setName( penang, "Penang" );
        penang.country().set( "Malaysia" );
        penang.county().set( "Some Other Jaya" );

        Female vivianSmith = uow.newEntity( FemaleEntity.class );
        setName( vivianSmith, "Vivian Smith" );
        vivianSmith.placeOfBirth().set( kualaLumpur );
        vivianSmith.yearOfBirth().set( 1992 );
View Full Code Here


    public void givenEqQueryOnValueWhenExecutedThenReturnCorrect()
        throws EntityFinderException
    {
        QueryBuilder<Person> qb = qbf.newQueryBuilder( Person.class );
        Person personTemplate = templateFor( Person.class );
        City placeOfBirth = personTemplate.placeOfBirth().get();
        Query<Person> query = qb.where(
            eq( placeOfBirth.name(), "Kuala Lumpur" )
        ).newQuery( Network.persons() );
        verifyUnorderedResults( query, "Joe Doe", "Ann Doe", "Vivian Smith" );
    }
View Full Code Here

    public void givenEqQueryOnAssociationWhenExecutedThenReturnCorrect()
        throws EntityFinderException
    {
        QueryBuilder<Person> qb = qbf.newQueryBuilder( Person.class );
        Person person = templateFor( Person.class );
        City kl = uow.get( City.class, "kualalumpur" );
        Query<Person> query = qb.where(
            eq( person.mother().get().placeOfBirth(), kl )
        ).newQuery( Network.persons() );
        verifyUnorderedResults( query, "Joe Doe" );
    }
View Full Code Here

TOP

Related Classes of org.qi4j.runtime.query.model.City

Copyright © 2018 www.massapicom. 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.