Search in sources :

Example 11 with SQLUpdateClause

use of com.querydsl.sql.dml.SQLUpdateClause in project querydsl by querydsl.

the class UpdateBase method batch_templates.

@Test
public void batch_templates() throws SQLException {
    assertEquals(1, insert(survey).values(2, "A", "B").execute());
    assertEquals(1, insert(survey).values(3, "B", "C").execute());
    SQLUpdateClause update = update(survey);
    update.set(survey.name, "AA").where(survey.name.eq(Expressions.stringTemplate("'A'"))).addBatch();
    update.set(survey.name, "BB").where(survey.name.eq(Expressions.stringTemplate("'B'"))).addBatch();
    assertEquals(2, update.execute());
}
Also used : SQLUpdateClause(com.querydsl.sql.dml.SQLUpdateClause) Test(org.junit.Test)

Aggregations

SQLUpdateClause (com.querydsl.sql.dml.SQLUpdateClause)11 Test (org.junit.Test)10 QEmployee (com.querydsl.sql.domain.QEmployee)4 QSurvey (com.querydsl.sql.domain.QSurvey)4 Param (com.querydsl.core.types.dsl.Param)1 SQLInsertClause (com.querydsl.sql.dml.SQLInsertClause)1