use of com.querydsl.core.testutil.ExcludeIn in project querydsl by querydsl.
the class JPASQLBase method entityQueries_createQuery2.
@Test
@ExcludeIn(Target.MYSQL)
public void entityQueries_createQuery2() {
SAnimal cat = new SAnimal("CAT");
QCat catEntity = QCat.cat;
Query query = query().from(cat).select(catEntity).createQuery();
assertEquals(6, query.getResultList().size());
}
use of com.querydsl.core.testutil.ExcludeIn in project querydsl by querydsl.
the class AbstractJPATest method multiply_bigDecimal.
@Test
@ExcludeIn(ORACLE)
public void multiply_bigDecimal() {
QSimpleTypes entity = new QSimpleTypes("entity1");
QSimpleTypes entity2 = new QSimpleTypes("entity2");
NumberPath<BigDecimal> bigd1 = entity.bigDecimal;
NumberPath<BigDecimal> bigd2 = entity2.bigDecimal;
assertEquals(Arrays.asList(), query().from(entity, entity2).where(bigd1.multiply(bigd2).loe(new BigDecimal("1.00"))).select(entity).fetch());
}
use of com.querydsl.core.testutil.ExcludeIn in project querydsl by querydsl.
the class AbstractJPATest method subtract_bigDecimal.
@Test
@ExcludeIn(ORACLE)
public void subtract_bigDecimal() {
QSimpleTypes entity = new QSimpleTypes("entity1");
QSimpleTypes entity2 = new QSimpleTypes("entity2");
NumberPath<BigDecimal> bigd1 = entity.bigDecimal;
NumberPath<BigDecimal> bigd2 = entity2.bigDecimal;
assertEquals(Arrays.asList(), query().from(entity, entity2).where(bigd1.subtract(bigd2).loe(new BigDecimal("1.00"))).select(entity).fetch());
}
use of com.querydsl.core.testutil.ExcludeIn in project querydsl by querydsl.
the class AbstractJPATest method divide_bigDecimal.
@Test
@ExcludeIn(ORACLE)
public void divide_bigDecimal() {
QSimpleTypes entity = new QSimpleTypes("entity1");
QSimpleTypes entity2 = new QSimpleTypes("entity2");
NumberPath<BigDecimal> bigd1 = entity.bigDecimal;
NumberPath<BigDecimal> bigd2 = entity2.bigDecimal;
assertEquals(Arrays.asList(), query().from(entity, entity2).where(bigd1.divide(bigd2).loe(new BigDecimal("1.00"))).select(entity).fetch());
assertEquals(Arrays.asList(), query().from(entity, entity2).where(entity.ddouble.divide(bigd2).loe(new BigDecimal("1.00"))).select(entity).fetch());
assertEquals(Arrays.asList(), query().from(entity, entity2).where(bigd1.divide(entity.ddouble).loe(new BigDecimal("1.00"))).select(entity).fetch());
}
use of com.querydsl.core.testutil.ExcludeIn in project querydsl by querydsl.
the class AbstractJPATest method transform_groupBy_alias.
@Test
@ExcludeIn(DERBY)
public void transform_groupBy_alias() {
QCat kitten = new QCat("kitten");
SimplePath<Cat> k = Expressions.path(Cat.class, "k");
Map<Integer, Group> result = query().from(cat).innerJoin(cat.kittens, kitten).transform(GroupBy.groupBy(cat.id).as(cat.name, cat.id, GroupBy.list(Projections.constructor(Cat.class, kitten.name, kitten.id).as(k))));
for (Group entry : result.values()) {
assertNotNull(entry.getOne(cat.id));
assertNotNull(entry.getOne(cat.name));
assertFalse(entry.getList(k).isEmpty());
}
}
Aggregations