@Override public Object get() { return next.get(); }
public static Property<Integer> add( Property<Integer> property, int amount ) { property.set( property.get() + amount ); return property; }
public static Property<Integer> sub( Property<Integer> property, int amount ) { property.set( property.get() - amount ); return property; }
public static Property<Long> add( Property<Long> property, long amount ) { property.set( property.get() + amount ); return property; }
public static Property<Long> mult( Property<Long> property, long amount ) { property.set( property.get() * amount ); return property; }
public static Property<BigDecimal> mult( Property<BigDecimal> property, BigDecimal amount ) { property.set( property.get().multiply( amount ) ); return property; }
/** * @param entityComposite a non-null EntityComposite * @throws NullPointerException if entityComposite is null */ public EntityReference( EntityComposite entityComposite ) { this( entityComposite.identity().get() ); }
public static Property<Integer> mult( Property<Integer> property, int amount ) { property.set( property.get() * amount ); return property; }
public static Property<Long> div( Property<Long> property, long amount ) { property.set( property.get() / amount ); return property; }
public static Property<Double> div( Property<Double> property, double amount ) { property.set( property.get() / amount ); return property; }
public static Property<BigDecimal> add( Property<BigDecimal> property, BigDecimal amount ) { property.set( property.get().add( amount ) ); return property; }
public static Property<BigDecimal> sub( Property<BigDecimal> property, BigDecimal amount ) { property.set( property.get().subtract( amount ) ); return property; }
@Override public File cacheDirectory() { return data.cache().get(); }
public static Property<Long> sub( Property<Long> property, long amount ) { property.set( property.get() - amount ); return property; }
public static void verifyOrderedResults( final Iterable<? extends Nameable> results, final String... names ) { List<String> expected = new ArrayList<>( Arrays.asList( names ) ); List<String> actual = new ArrayList<>(); for( Nameable result : results ) { actual.add( result.name().get() ); } assertThat( "Result is incorrect", actual, equalTo( expected ) ); }
@Override public String name() { return config.get().name().get(); } }
@Test public void script24() throws EntityFinderException { final Query<Domain> query = unitOfWork.newQuery( this.module .newQueryBuilder( Domain.class ) .where( queries.get( "script24" ) ) ); query.setVariable( "domain", "Gaming" ); System.out.println( "*** script24: " + query ); assertThat( query.find().name().get(), is( equalTo( "Gaming" ) ) ); } }
@Test public void script24() throws EntityFinderException { final QueryBuilder<Domain> qb = this.module.newQueryBuilder( Domain.class ); final Nameable nameable = templateFor( Nameable.class ); final Query<Domain> query = unitOfWork.newQuery( qb.where( eq( nameable.name(), "Gaming" ) ) ); System.out.println( "*** script24: " + query ); assertThat( query.find().name().get(), is( equalTo( "Gaming" ) ) ); }
@Test public void script32() { QueryBuilder<Person> qb = this.module.newQueryBuilder( Person.class ); Person person = templateFor( Person.class ); Query<Person> query = unitOfWork.newQuery( qb.where( eq( person.address().get().line1(), "Qi Alley 4j" ) ) ); System.out.println( "*** script32: " + query ); verifyUnorderedResults( query, "Joe Doe" ); }