Search in sources :

Example 31 with Person

use of org.qi4j.test.indexing.model.Person in project qi4j-sdk by Qi4j.

the class AbstractQueryTest method script43_LocalDate.

@Test
public void script43_LocalDate() {
    QueryBuilder<Person> qb = this.module.newQueryBuilder(Person.class);
    Person person = templateFor(Person.class);
    Query<Person> query = unitOfWork.newQuery(qb.where(and(gt(person.localDateValue(), new LocalDate("2005-03-04", UTC)), lt(person.localDateValue(), new LocalDate("2015-03-04", UTC)))));
    System.out.println("*** script43_LocalDate: " + query);
    verifyUnorderedResults(query, "Jack Doe");
}
Also used : Person(org.qi4j.test.indexing.model.Person) LocalDate(org.joda.time.LocalDate) Test(org.junit.Test)

Example 32 with Person

use of org.qi4j.test.indexing.model.Person in project qi4j-sdk by Qi4j.

the class AbstractQueryTest method script41_LocalDateTime.

@Test
public void script41_LocalDateTime() {
    QueryBuilder<Person> qb = this.module.newQueryBuilder(Person.class);
    Person person = templateFor(Person.class);
    Query<Person> query = unitOfWork.newQuery(qb.where(ne(person.localDateTimeValue(), new LocalDateTime("2010-03-04T13:23:00", UTC))));
    System.out.println("*** script41_LocalDateTime: " + query);
    verifyUnorderedResults(query, "Joe Doe");
}
Also used : LocalDateTime(org.joda.time.LocalDateTime) Person(org.qi4j.test.indexing.model.Person) Test(org.junit.Test)

Example 33 with Person

use of org.qi4j.test.indexing.model.Person in project qi4j-sdk by Qi4j.

the class AbstractQueryTest method script52_BigInteger.

@Test
public void script52_BigInteger() {
    QueryBuilder<Person> qb = this.module.newQueryBuilder(Person.class);
    Person person = templateFor(Person.class);
    Query<Person> query = unitOfWork.newQuery(qb.where(ge(person.bigInteger(), new BigInteger("23232323232323232323232323"))));
    System.out.println("*** script52_BigInteger: " + query);
    verifyUnorderedResults(query, "Jack Doe", "Joe Doe");
}
Also used : BigInteger(java.math.BigInteger) Person(org.qi4j.test.indexing.model.Person) Test(org.junit.Test)

Example 34 with Person

use of org.qi4j.test.indexing.model.Person in project qi4j-sdk by Qi4j.

the class AbstractQueryTest method script52_BigDecimal.

@Test
public void script52_BigDecimal() {
    QueryBuilder<Person> qb = this.module.newQueryBuilder(Person.class);
    Person person = templateFor(Person.class);
    Query<Person> query = unitOfWork.newQuery(qb.where(ge(person.bigDecimal(), new BigDecimal("2342.76931348623157e+307"))));
    System.out.println("*** script52_BigDecimal: " + query);
    verifyUnorderedResults(query, "Jack Doe", "Joe Doe");
}
Also used : Person(org.qi4j.test.indexing.model.Person) BigDecimal(java.math.BigDecimal) Test(org.junit.Test)

Example 35 with Person

use of org.qi4j.test.indexing.model.Person in project qi4j-sdk by Qi4j.

the class AbstractQueryTest method script51_BigInteger.

@Test
public void script51_BigInteger() {
    QueryBuilder<Person> qb = this.module.newQueryBuilder(Person.class);
    Person person = templateFor(Person.class);
    Query<Person> query = unitOfWork.newQuery(qb.where(ne(person.bigInteger(), new BigInteger("23232323232323232323232323"))));
    System.out.println("*** script51_BigInteger: " + query);
    verifyUnorderedResults(query, "Jack Doe");
}
Also used : BigInteger(java.math.BigInteger) Person(org.qi4j.test.indexing.model.Person) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)76 Person (org.qi4j.test.indexing.model.Person)76 LocalDateTime (org.joda.time.LocalDateTime)12 EntityReference (org.qi4j.api.entity.EntityReference)11 QueryParam (org.qi4j.test.indexing.model.QueryParam)10 DateTime (org.joda.time.DateTime)8 ArrayList (java.util.ArrayList)7 Collection (java.util.Collection)7 LocalDate (org.joda.time.LocalDate)4 BigDecimal (java.math.BigDecimal)3 BigInteger (java.math.BigInteger)3 Ignore (org.junit.Ignore)3 Address (org.qi4j.test.indexing.model.Address)2 City (org.qi4j.test.indexing.model.City)2 Domain (org.qi4j.test.indexing.model.Domain)2 Female (org.qi4j.test.indexing.model.Female)2 Male (org.qi4j.test.indexing.model.Male)2 Protocol (org.qi4j.test.indexing.model.Protocol)2 URL (org.qi4j.test.indexing.model.URL)2 HashMap (java.util.HashMap)1