use of com.querydsl.core.testutil.ExcludeIn in project querydsl by querydsl.
the class JPABase method createQuery4.
@Test
@NoHibernate
@ExcludeIn(Target.DERBY)
public void createQuery4() {
List<Tuple> rows = query().from(cat).select(new Expression<?>[] { Expressions.nullExpression() }).fetch();
for (Tuple row : rows) {
assertNotNull(row);
assertEquals(1, row.size());
assertNull(row.get(Expressions.nullExpression()));
}
}
use of com.querydsl.core.testutil.ExcludeIn in project querydsl by querydsl.
the class AbstractJPATest method add_bigDecimal.
@Test
@ExcludeIn(ORACLE)
public void add_bigDecimal() {
QSimpleTypes entity = new QSimpleTypes("entity1");
QSimpleTypes entity2 = new QSimpleTypes("entity2");
NumberPath<BigDecimal> bigd1 = entity.bigDecimal;
NumberPath<BigDecimal> bigd2 = entity2.bigDecimal;
assertEquals(Collections.emptyList(), query().from(entity, entity2).where(bigd1.add(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 joinEmbeddable.
@Test
@NoEclipseLink
@ExcludeIn({ ORACLE, TERADATA })
public void joinEmbeddable() {
QBookVersion bookVersion = QBookVersion.bookVersion;
QBookMark bookMark = QBookMark.bookMark;
assertEquals(Collections.emptyList(), query().from(bookVersion).join(bookVersion.definition.bookMarks, bookMark).where(bookVersion.definition.bookMarks.size().eq(1), bookMark.page.eq(2357L).or(bookMark.page.eq(2356L))).select(bookVersion).fetch());
}
use of com.querydsl.core.testutil.ExcludeIn in project querydsl by querydsl.
the class AbstractJPATest method substring2.
@Test
@NoBatooJPA
@ExcludeIn({ ORACLE, SQLSERVER, HSQLDB })
public void substring2() {
QCompany company = QCompany.company;
StringExpression name = company.name;
Integer companyId = query().from(company).select(company.id).fetchFirst();
JPQLQuery<?> query = query().from(company).where(company.id.eq(companyId));
String str = query.select(company.name).fetchFirst();
assertEquals(Integer.valueOf(29), query.select(name.length().subtract(11)).fetchFirst());
assertEquals(str.substring(0, 7), query.select(name.substring(0, 7)).fetchFirst());
assertEquals(str.substring(15), query.select(name.substring(15)).fetchFirst());
assertEquals(str.substring(str.length()), query.select(name.substring(name.length())).fetchFirst());
assertEquals(str.substring(str.length() - 11), query.select(name.substring(name.length().subtract(11))).fetchFirst());
}
use of com.querydsl.core.testutil.ExcludeIn in project querydsl by querydsl.
the class AbstractJPATest method transform_groupBy2.
@Test
@ExcludeIn(DERBY)
public void transform_groupBy2() {
QCat kitten = new QCat("kitten");
Map<List<?>, Group> result = query().from(cat).innerJoin(cat.kittens, kitten).transform(GroupBy.groupBy(cat.id, kitten.id).as(cat, kitten));
assertFalse(result.isEmpty());
for (Tuple row : query().from(cat).innerJoin(cat.kittens, kitten).select(cat, kitten).fetch()) {
assertNotNull(result.get(Arrays.asList(row.get(cat).getId(), row.get(kitten).getId())));
}
}
Aggregations