use of com.querydsl.sql.domain.QSurvey in project querydsl by querydsl.
the class UpdateBase method update_with_subQuery_exists_Params.
@Test
public void update_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);
SQLUpdateClause update = update(survey1);
update.set(survey1.name, "AA");
update.where(sq.exists());
assertEquals(0, update.execute());
}
use of com.querydsl.sql.domain.QSurvey in project querydsl by querydsl.
the class UpdateBase method update_with_subQuery_exists.
@Test
public void update_with_subQuery_exists() {
QSurvey survey1 = new QSurvey("s1");
QEmployee employee = new QEmployee("e");
SQLUpdateClause update = update(survey1);
update.set(survey1.name, "AA");
update.where(selectOne().from(employee).where(survey1.id.eq(employee.id)).exists());
assertEquals(1, update.execute());
}
use of com.querydsl.sql.domain.QSurvey in project querydsl by querydsl.
the class UpdateBase method update_with_subQuery_notExists.
@Test
public void update_with_subQuery_notExists() {
QSurvey survey1 = new QSurvey("s1");
QEmployee employee = new QEmployee("e");
SQLUpdateClause update = update(survey1);
update.set(survey1.name, "AA");
update.where(query().from(employee).where(survey1.id.eq(employee.id)).notExists());
assertEquals(0, update.execute());
}
use of com.querydsl.sql.domain.QSurvey in project querydsl by querydsl.
the class SerializationTest method with_tuple.
@Test
public void with_tuple() {
PathBuilder<Survey> survey = new PathBuilder<Survey>(Survey.class, "SURVEY");
QSurvey survey2 = new QSurvey("survey2");
SQLQuery<?> q = new SQLQuery<Void>();
q.with(survey, survey.get(survey2.id), survey.get(survey2.name)).as(select(survey2.id, survey2.name).from(survey2));
assertEquals("with SURVEY (ID, NAME) as (select survey2.ID, survey2.NAME\n" + "from SURVEY survey2)\n\n" + "from dual", q.toString());
}
use of com.querydsl.sql.domain.QSurvey in project querydsl by querydsl.
the class SerializationTest method fullJoin.
@Test
public void fullJoin() {
SQLQuery<?> query = new SQLQuery<Void>(connection, SQLTemplates.DEFAULT);
query.from(new QSurvey("s1")).fullJoin(new QSurvey("s2"));
assertEquals("from SURVEY s1\nfull join SURVEY s2", query.toString());
}
Aggregations