use of org.baeldung.querydsl.intro.entities.QUser in project tutorials by eugenp.
the class QueryDSLIntegrationTest method whenRefiningWithSubquery_thenResultCountShouldMatch.
@Test
public void whenRefiningWithSubquery_thenResultCountShouldMatch() {
QUser user = QUser.user;
QBlogPost blogPost = QBlogPost.blogPost;
List<User> users = queryFactory.selectFrom(user).where(user.id.in(JPAExpressions.select(blogPost.user.id).from(blogPost).where(blogPost.title.eq("Hello World!")))).fetch();
assertEquals(2, users.size());
}