use of org.qi4j.test.indexing.model.Person in project qi4j-sdk by Qi4j.
the class AbstractEntityFinderTest method script09.
@Test
@SuppressWarnings("unchecked")
public void script09() throws EntityFinderException {
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);
}
use of org.qi4j.test.indexing.model.Person in project qi4j-sdk by Qi4j.
the class AbstractNamedQueryTest method script20.
@Test
public void script20() throws EntityFinderException {
Person person = templateFor(Person.class);
final Query<Person> query = unitOfWork.newQuery(this.module.newQueryBuilder(Person.class).where(queries.get("script20")));
query.orderBy(orderBy(person.name(), OrderBy.Order.DESCENDING));
System.out.println("*** script20: " + query);
verifyOrderedResults(query, "Joe Doe", "Ann Doe");
}
use of org.qi4j.test.indexing.model.Person in project qi4j-sdk by Qi4j.
the class AbstractQueryTest method script50_BigDecimal.
@Test
public void script50_BigDecimal() {
QueryBuilder<Person> qb = this.module.newQueryBuilder(Person.class);
Person person = templateFor(Person.class);
Query<Person> query = unitOfWork.newQuery(qb.where(eq(person.bigDecimal(), new BigDecimal("2342.76931348623157e+307"))));
System.out.println("*** script50_BigDecimal: " + query);
verifyUnorderedResults(query, "Joe Doe");
}
use of org.qi4j.test.indexing.model.Person in project qi4j-sdk by Qi4j.
the class AbstractQueryTest method script39.
@Test
public void script39() {
QueryBuilder<Person> qb = this.module.newQueryBuilder(Person.class);
Person person = templateFor(Person.class);
Query<Person> query = unitOfWork.newQuery(qb.where(ne(person.title(), Person.Title.DR)));
System.out.println("*** script39: " + query);
verifyUnorderedResults(query, "Ann Doe", "Joe Doe");
}
use of org.qi4j.test.indexing.model.Person in project qi4j-sdk by Qi4j.
the class AbstractQueryTest method script11.
@Test
public void script11() throws EntityFinderException {
QueryBuilder<Person> qb = this.module.newQueryBuilder(Person.class);
Person person = templateFor(Person.class);
Query<Person> query = unitOfWork.newQuery(qb.where(isNotNull(person.email())));
System.out.println("*** script11: " + query);
verifyUnorderedResults(query, "Joe Doe");
}
Aggregations