use of com.querydsl.jpa.hibernate.HibernateQuery in project querydsl by querydsl.
the class IntegrationBase method scroll.
@Test
public void scroll() {
session.save(new Cat("Bob", 10));
session.save(new Cat("Steve", 11));
QCat cat = QCat.cat;
HibernateQuery<?> query = new HibernateQuery<Void>(session);
ScrollableResults results = query.from(cat).select(cat).scroll(ScrollMode.SCROLL_INSENSITIVE);
while (results.next()) {
assertNotNull(results.get(0));
}
results.close();
}
use of com.querydsl.jpa.hibernate.HibernateQuery in project querydsl by querydsl.
the class HibernateQueryTest method innerJoin.
@Test
public void innerJoin() {
HibernateQuery<?> hqlQuery = new HibernateQuery<Void>();
QEmployee employee = QEmployee.employee;
hqlQuery.from(employee);
hqlQuery.innerJoin(employee.user, QUser.user);
assertEquals("select employee\nfrom Employee employee\n inner join employee.user as user", hqlQuery.toString());
}
use of com.querydsl.jpa.hibernate.HibernateQuery in project querydsl by querydsl.
the class HibernateQueryTest method clone_.
@Test
public void clone_() {
QCat cat = QCat.cat;
BooleanBuilder emptyBooleanBuilder = new BooleanBuilder();
HibernateQuery<?> hq = new HibernateQuery<Void>().from(cat).where(cat.name.isNull().and(emptyBooleanBuilder));
HibernateQuery<?> hq2 = hq.clone();
assertNotNull(hq2);
}
Aggregations