Search in sources :

Example 1 with SubQueryExpression

use of com.querydsl.core.types.SubQueryExpression in project querydsl by querydsl.

the class ListSubQueryTest method hashCode2.

@Test
public void hashCode2() {
    QSurvey survey = new QSurvey("entity");
    QEmployee employee = new QEmployee("entity");
    SubQueryExpression<Integer> query1 = select(survey.id).from(survey);
    SubQueryExpression<Integer> query2 = select(employee.id).from(employee);
    Set<SubQueryExpression<Integer>> queries = Sets.newHashSet();
    queries.add(query1);
    queries.add(query2);
    assertEquals(1, queries.size());
}
Also used : SubQueryExpression(com.querydsl.core.types.SubQueryExpression) QSurvey(com.querydsl.sql.domain.QSurvey) QEmployee(com.querydsl.sql.domain.QEmployee) Test(org.junit.Test)

Example 2 with SubQueryExpression

use of com.querydsl.core.types.SubQueryExpression in project querydsl by querydsl.

the class ListSubQueryTest method hashCode1.

@Test
public void hashCode1() {
    QSurvey survey = QSurvey.survey;
    QSurvey survey2 = new QSurvey("survey2");
    SubQueryExpression<Tuple> query1 = select(survey.all()).from(survey);
    SubQueryExpression<Tuple> query2 = select(survey2.all()).from(survey2);
    Set<SubQueryExpression<Tuple>> queries = Sets.newHashSet();
    queries.add(query1);
    queries.add(query2);
    assertEquals(2, queries.size());
}
Also used : SubQueryExpression(com.querydsl.core.types.SubQueryExpression) QSurvey(com.querydsl.sql.domain.QSurvey) Tuple(com.querydsl.core.Tuple) Test(org.junit.Test)

Aggregations

SubQueryExpression (com.querydsl.core.types.SubQueryExpression)2 QSurvey (com.querydsl.sql.domain.QSurvey)2 Test (org.junit.Test)2 Tuple (com.querydsl.core.Tuple)1 QEmployee (com.querydsl.sql.domain.QEmployee)1