use of com.querydsl.jpa.domain.sql.SAnimal in project querydsl by querydsl.
the class AbstractSQLTest method entityQueries5.
@Test
@NoBatooJPA
@NoEclipseLink
public void entityQueries5() {
QCat catEntity = QCat.cat;
SAnimal otherCat = new SAnimal("otherCat");
QCat otherCatEntity = new QCat("otherCat");
List<Tuple> cats = query().from(cat, otherCat).select(catEntity, otherCatEntity).fetch();
assertEquals(36, cats.size());
for (Tuple tuple : cats) {
assertTrue(tuple.get(catEntity) instanceof Cat);
assertTrue(tuple.get(otherCatEntity) instanceof Cat);
}
}
use of com.querydsl.jpa.domain.sql.SAnimal in project querydsl by querydsl.
the class AbstractSQLTest method union5.
@SuppressWarnings("unchecked")
@Test
@ExcludeIn({ Target.DERBY, Target.ORACLE })
public void union5() {
SAnimal cat2 = new SAnimal("cat2");
List<Tuple> rows = query().union(select(cat.id, cat2.id).from(cat).join(cat2).on(cat2.id.eq(cat.id.add(1))), select(cat.id, cat2.id).from(cat).join(cat2).on(cat2.id.eq(cat.id.add(1)))).list();
assertEquals(5, rows.size());
for (Tuple row : rows) {
int first = row.get(cat.id);
int second = row.get(cat2.id);
assertEquals(first + 1, second);
}
}
use of com.querydsl.jpa.domain.sql.SAnimal in project querydsl by querydsl.
the class HibernateSQLBase 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.list().size());
}
use of com.querydsl.jpa.domain.sql.SAnimal in project querydsl by querydsl.
the class QueryMutabilityTest method queryMutability.
@Test
@Ignore
public void queryMutability() throws SecurityException, IllegalArgumentException, NoSuchMethodException, IllegalAccessException, InvocationTargetException, IOException {
SAnimal cat = new SAnimal("cat");
HibernateSQLQuery<?> query = query().from(cat);
new QueryMutability(query).test(cat.id, cat.name);
}
use of com.querydsl.jpa.domain.sql.SAnimal in project querydsl by querydsl.
the class JPASQLBase method entityQueries_createQuery2.
@Test
@ExcludeIn(Target.MYSQL)
public void entityQueries_createQuery2() {
SAnimal cat = new SAnimal("CAT");
Query query = query().from(cat).select(catEntity).createQuery();
assertEquals(6, query.getResultList().size());
}
Aggregations