use of org.qi4j.api.entity.EntityReference in project qi4j-sdk by Qi4j.
the class AbstractEntityFinderTest method script13.
@Test
public void script13() throws EntityFinderException {
Male person = templateFor(Male.class);
// should return Jack Doe
Iterable<EntityReference> entities = entityFinder.findEntities(Person.class, isNotNull(person.wife()), NO_SORTING, NO_FIRST_RESULT, NO_MAX_RESULTS, NO_VARIABLES);
assertNames(entities, JACK);
}
use of org.qi4j.api.entity.EntityReference in project qi4j-sdk by Qi4j.
the class AbstractEntityFinderTest method script12.
@Test
public void script12() throws EntityFinderException {
Person person = templateFor(Person.class);
// should return Ann and Jack Doe
Iterable<EntityReference> entities = entityFinder.findEntities(Person.class, isNull(person.email()), NO_SORTING, NO_FIRST_RESULT, NO_MAX_RESULTS, NO_VARIABLES);
assertNames(entities, ANN, JACK);
}
use of org.qi4j.api.entity.EntityReference in project qi4j-sdk by Qi4j.
the class AbstractEntityFinderTest method script08.
@Test
@SuppressWarnings("unchecked")
public void script08() throws EntityFinderException {
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);
}
use of org.qi4j.api.entity.EntityReference in project qi4j-sdk by Qi4j.
the class AbstractEntityFinderTest method script07.
@Test
@SuppressWarnings("unchecked")
public void script07() throws EntityFinderException {
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);
}
use of org.qi4j.api.entity.EntityReference in project qi4j-sdk by Qi4j.
the class AbstractEntityFinderTest method script02.
@Test
public void script02() throws EntityFinderException {
Nameable nameable = templateFor(Nameable.class);
// should return Gaming domain
Iterable<EntityReference> entities = entityFinder.findEntities(Domain.class, eq(nameable.name(), "Gaming"), NO_SORTING, NO_FIRST_RESULT, NO_MAX_RESULTS, NO_VARIABLES);
assertNames(entities, "Gaming");
}
Aggregations