use of com.querydsl.sql.domain.QEmployee 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());
}
use of com.querydsl.sql.domain.QEmployee in project querydsl by querydsl.
the class DeleteBase method delete_with_subQuery_exists.
@Test
public void delete_with_subQuery_exists() {
QSurvey survey1 = new QSurvey("s1");
QEmployee employee = new QEmployee("e");
SQLDeleteClause delete = delete(survey1);
delete.where(survey1.name.eq("XXX"), query().from(employee).where(survey1.id.eq(employee.id)).exists());
assertEquals(0, delete.execute());
}
use of com.querydsl.sql.domain.QEmployee in project querydsl by querydsl.
the class DeleteBase method delete_with_subQuery_exists_Params.
@Test
public void delete_with_subQuery_exists_Params() {
QSurvey survey1 = new QSurvey("s1");
QEmployee employee = new QEmployee("e");
Param<Integer> param = new Param<Integer>(Integer.class, "param");
SQLQuery<?> sq = query().from(employee).where(employee.id.eq(param));
sq.set(param, -12478923);
SQLDeleteClause delete = delete(survey1);
delete.where(survey1.name.eq("XXX"), sq.exists());
assertEquals(0, delete.execute());
}
use of com.querydsl.sql.domain.QEmployee in project querydsl by querydsl.
the class DeleteBase method delete_with_subQuery_exists2.
@Test
public void delete_with_subQuery_exists2() {
QSurvey survey1 = new QSurvey("s1");
QEmployee employee = new QEmployee("e");
SQLDeleteClause delete = delete(survey1);
delete.where(survey1.name.eq("XXX"), query().from(employee).where(survey1.name.eq(employee.lastname)).exists());
assertEquals(0, delete.execute());
}
use of com.querydsl.sql.domain.QEmployee in project querydsl by querydsl.
the class SubqueriesBase method keys.
@Test
@ExcludeIn({ CUBRID, DERBY, FIREBIRD, H2, HSQLDB, SQLITE, SQLSERVER })
public void keys() {
QEmployee employee2 = new QEmployee("employee2");
ForeignKey<Employee> nameKey1 = new ForeignKey<Employee>(employee, ImmutableList.of(employee.firstname, employee.lastname), ImmutableList.of("a", "b"));
ForeignKey<Employee> nameKey2 = new ForeignKey<Employee>(employee, ImmutableList.of(employee.firstname, employee.lastname), ImmutableList.of("a", "b"));
query().from(employee).where(nameKey1.in(query().from(employee2).select(nameKey2.getProjection()))).select(employee.id).fetch();
}
Aggregations