/** * Create a new GREATER OR EQUALS specification for a Property. * * @param <T> Property type * @param property a Property * @param value its value * * @return a new GREATER OR EQUALS specification for a Property. */ public static <T> GePredicate<T> ge( Property<T> property, T value ) { return new GePredicate<>( property( property ), value ); }
@Test public void givenMultipleAndQueryWhenExecutedThenReturnCorrect() { QueryBuilder<Nameable> qb = qbf.newQueryBuilder( Nameable.class ); Person person = templateFor( Person.class ); Query<Nameable> query = qb.where( ge( person.yearOfBirth(), 1900 ). and( lt( person.yearOfBirth(), 2000 ) ). and( eq( person.placeOfBirth().get().name(), "Penang" ) ) ).newQuery( Network.nameables() ); verifyUnorderedResults( query, "Jack Doe" ); }
@Test public void givenAndQueryWhenExecutedThenReturnCorrect() { QueryBuilder<Nameable> qb = qbf.newQueryBuilder( Nameable.class ); Person person = templateFor( Person.class ); Query<Nameable> query = qb.where( ge( person.yearOfBirth(), 1900 ).and( eq( person.placeOfBirth().get().name(), "Penang" ) ) ).newQuery( Network.nameables() ); verifyUnorderedResults( query, "Jack Doe" ); }
/** * Create a new GREATER OR EQUALS specification for a Property using a named Variable. * * @param <T> Property type * @param property a Property * @param variable a Query Variable * * @return a new GREATER OR EQUALS specification for a Property using a named Variable. */ @SuppressWarnings( {"raw", "unchecked"} ) public static <T> GePredicate<T> ge( Property<T> property, Variable variable ) { return new GePredicate( property( property ), variable ); }
/** * Create a new GREATER OR EQUALS specification for a Property. * * @param <T> Property type * @param property a Property * @param value its value * * @return a new GREATER OR EQUALS specification for a Property. */ public static <T> GePredicate<T> ge( Property<T> property, T value ) { return new GePredicate<>( property( property ), value ); }
/** * Create a new GREATER OR EQUALS specification for a Property using a named Variable. * * @param <T> Property type * @param property a Property * @param variable a Query Variable * * @return a new GREATER OR EQUALS specification for a Property using a named Variable. */ @SuppressWarnings( {"raw", "unchecked"} ) public static <T> GePredicate<T> ge( Property<T> property, Variable variable ) { return new GePredicate( property( property ), variable ); }