Search in sources :

Example 1 with QBookVersion

use of com.querydsl.jpa.domain4.QBookVersion 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(Arrays.asList(), 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());
}
Also used : QBookVersion(com.querydsl.jpa.domain4.QBookVersion) QBookMark(com.querydsl.jpa.domain4.QBookMark) Test(org.junit.Test) ExcludeIn(com.querydsl.core.testutil.ExcludeIn)

Example 2 with QBookVersion

use of com.querydsl.jpa.domain4.QBookVersion in project querydsl by querydsl.

the class JPAQueryMixinTest method orderBy_embeddable_collection.

@SuppressWarnings("unchecked")
@Test
public void orderBy_embeddable_collection() {
    QBookVersion bookVersion = QBookVersion.bookVersion;
    QBookMark bookMark = new QBookMark("bookVersion_definition_bookMarks");
    mixin.from(bookVersion);
    mixin.orderBy(bookVersion.definition.bookMarks.any().comment.asc());
    QueryMetadata md = mixin.getMetadata();
    assertEquals(Arrays.asList(new JoinExpression(JoinType.DEFAULT, bookVersion)), md.getJoins());
    assertEquals(Arrays.asList(Expressions.stringPath(bookVersion.definition.bookMarks, "comment").asc()), md.getOrderBy());
}
Also used : QueryMetadata(com.querydsl.core.QueryMetadata) QBookVersion(com.querydsl.jpa.domain4.QBookVersion) JoinExpression(com.querydsl.core.JoinExpression) QBookMark(com.querydsl.jpa.domain4.QBookMark) Test(org.junit.Test)

Example 3 with QBookVersion

use of com.querydsl.jpa.domain4.QBookVersion in project querydsl by querydsl.

the class JPAQueryMixinTest method orderBy_embeddable.

@Test
public void orderBy_embeddable() {
    QBookVersion bookVersion = QBookVersion.bookVersion;
    mixin.from(bookVersion);
    mixin.orderBy(bookVersion.definition.name.asc());
    QueryMetadata md = mixin.getMetadata();
    assertEquals(Arrays.asList(new JoinExpression(JoinType.DEFAULT, bookVersion)), md.getJoins());
    assertEquals(Arrays.asList(bookVersion.definition.name.asc()), md.getOrderBy());
}
Also used : QueryMetadata(com.querydsl.core.QueryMetadata) QBookVersion(com.querydsl.jpa.domain4.QBookVersion) JoinExpression(com.querydsl.core.JoinExpression) Test(org.junit.Test)

Aggregations

QBookVersion (com.querydsl.jpa.domain4.QBookVersion)3 Test (org.junit.Test)3 JoinExpression (com.querydsl.core.JoinExpression)2 QueryMetadata (com.querydsl.core.QueryMetadata)2 QBookMark (com.querydsl.jpa.domain4.QBookMark)2 ExcludeIn (com.querydsl.core.testutil.ExcludeIn)1