@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" ); }
@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" ); } }
@Test 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 public void script06() throws EntityFinderException { 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 ); }
@Test @SuppressWarnings( "unchecked" ) public void script07() 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 @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 ); }