Search in sources :

Example 26 with QEmployee

use of com.querydsl.sql.domain.QEmployee in project querydsl by querydsl.

the class RelationalPathExtractorTest method subQuery2.

@Test
public void subQuery2() {
    QEmployee employee2 = new QEmployee("employee2");
    SQLQuery<?> query = query().from(employee).where(Expressions.list(employee.id, employee.lastname).in(query().from(employee2).select(employee2.id, employee2.lastname)));
    assertEquals(ImmutableSet.of(employee, employee2), extract(query.getMetadata()));
}
Also used : QEmployee(com.querydsl.sql.domain.QEmployee) Test(org.junit.Test)

Example 27 with QEmployee

use of com.querydsl.sql.domain.QEmployee in project querydsl by querydsl.

the class RelationalPathExtractorTest method simpleQuery.

@Test
public void simpleQuery() {
    QEmployee employee2 = new QEmployee("employee2");
    SQLQuery<?> query = query().from(employee, employee2);
    assertEquals(ImmutableSet.of(employee, employee2), extract(query.getMetadata()));
}
Also used : QEmployee(com.querydsl.sql.domain.QEmployee) Test(org.junit.Test)

Aggregations

QEmployee (com.querydsl.sql.domain.QEmployee)27 Test (org.junit.Test)27 QSurvey (com.querydsl.sql.domain.QSurvey)10 SQLDeleteClause (com.querydsl.sql.dml.SQLDeleteClause)6 ExcludeIn (com.querydsl.core.testutil.ExcludeIn)4 SQLUpdateClause (com.querydsl.sql.dml.SQLUpdateClause)4 Tuple (com.querydsl.core.Tuple)3 QueryMetadata (com.querydsl.core.QueryMetadata)2 Param (com.querydsl.core.types.dsl.Param)2 Employee (com.querydsl.sql.domain.Employee)2 Connection (java.sql.Connection)2 QueryModifiers (com.querydsl.core.QueryModifiers)1 QueryMixin (com.querydsl.core.support.QueryMixin)1 IncludeIn (com.querydsl.core.testutil.IncludeIn)1 SubQueryExpression (com.querydsl.core.types.SubQueryExpression)1 Ignore (org.junit.Ignore)1