Package org.qi4j.test.indexing.model

Examples of org.qi4j.test.indexing.model.Person.yearOfBirth()


    {
        Person person = templateFor( Person.class );
        // should return Joe and Ann Doe
        Iterable<EntityReference> entities = entityFinder.findEntities(
            Person.class,
            ge( person.yearOfBirth(), 1973 ),
            NO_SORTING,
            NO_FIRST_RESULT, NO_MAX_RESULTS,
            NO_VARIABLES );
        assertNames( entities, JOE, ANN );
    }
View Full Code Here


    {
        Person person = templateFor( Person.class );
        // should return Jack Doe
        Iterable<EntityReference> entities = entityFinder.findEntities(
            Nameable.class,
            and( ge( person.yearOfBirth(), 1900 ), eq( person.placeOfBirth().get().name(), "Penang" ) ),
            NO_SORTING,
            NO_FIRST_RESULT, NO_MAX_RESULTS,
            NO_VARIABLES );
        assertNames( entities, JACK );
    }
View Full Code Here

    {
        Person person = templateFor( Person.class );
        // should return Jack and Ann Doe
        Iterable<EntityReference> entities = entityFinder.findEntities(
            Person.class,
            or( eq( person.yearOfBirth(), 1970 ), eq( person.yearOfBirth(), 1975 ) ),
            NO_SORTING,
            NO_FIRST_RESULT, NO_MAX_RESULTS,
            NO_VARIABLES );
        assertNames( entities, JACK, ANN );
    }
View Full Code Here

    {
        Person person = templateFor( Person.class );
        // should return Jack and Ann Doe
        Iterable<EntityReference> entities = entityFinder.findEntities(
            Person.class,
            or( eq( person.yearOfBirth(), 1970 ), eq( person.yearOfBirth(), 1975 ) ),
            NO_SORTING,
            NO_FIRST_RESULT, NO_MAX_RESULTS,
            NO_VARIABLES );
        assertNames( entities, JACK, ANN );
    }
View Full Code Here

    {
        Person person = templateFor( Person.class );
        // should return Ann Doe
        Iterable<EntityReference> entities = entityFinder.findEntities(
            Female.class,
            or( eq( person.yearOfBirth(), 1970 ), eq( person.yearOfBirth(), 1975 ) ),
            NO_SORTING,
            NO_FIRST_RESULT, NO_MAX_RESULTS,
            NO_VARIABLES );
        assertNames( entities, ANN );
    }
View Full Code Here

    {
        Person person = templateFor( Person.class );
        // should return Ann Doe
        Iterable<EntityReference> entities = entityFinder.findEntities(
            Female.class,
            or( eq( person.yearOfBirth(), 1970 ), eq( person.yearOfBirth(), 1975 ) ),
            NO_SORTING,
            NO_FIRST_RESULT, NO_MAX_RESULTS,
            NO_VARIABLES );
        assertNames( entities, ANN );
    }
View Full Code Here

    {
        Person person = templateFor( Person.class );
        // should return Joe and Jack Doe
        Iterable<EntityReference> entities = entityFinder.findEntities(
            Person.class,
            not( eq( person.yearOfBirth(), 1975 ) ),
            NO_SORTING,
            NO_FIRST_RESULT, NO_MAX_RESULTS,
            NO_VARIABLES );
        assertNames( entities, JOE, JACK );
    }
View Full Code Here

    {
        // should return all Persons born after 1973 (Ann and Joe Doe) sorted descending by name
        Person person = templateFor( Person.class );
        Iterable<EntityReference> entities = entityFinder.findEntities(
            Person.class,
            gt( person.yearOfBirth(), 1973 ),
            new OrderBy[]
        {
            orderBy( person.name(), OrderBy.Order.DESCENDING )
            },
            NO_FIRST_RESULT, NO_MAX_RESULTS,
View Full Code Here

    public void script06()
        throws EntityFinderException
    {
        QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class );
        Person person = templateFor( Person.class );
        Query<Person> query = unitOfWork.newQuery( qb.where( ge( person.yearOfBirth(), 1973 ) ) );
        System.out.println( "*** script06: " + query );
        verifyUnorderedResults( query, "Joe Doe", "Ann Doe" );
    }

    @Test
View Full Code Here

        throws EntityFinderException
    {
        QueryBuilder<Nameable> qb = this.module.newQueryBuilder( Nameable.class );
        Person person = templateFor( Person.class );
        Query<Nameable> query = unitOfWork.newQuery( qb.where(
            and( ge( person.yearOfBirth(), 1900 ), eq( person.placeOfBirth().get().name(), "Penang" ) ) ) );
        System.out.println( "*** script07: " + query );
        verifyUnorderedResults( query, "Jack Doe" );
    }

    @Test
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.