use of com.querydsl.core.testutil.IncludeIn in project querydsl by querydsl.
the class TargetRule method isExecuted.
private boolean isExecuted(Description description, Target target) {
ExcludeIn ex = description.getAnnotation(ExcludeIn.class);
// excluded in given targets
if (ex != null && Arrays.asList(ex.value()).contains(target)) {
return false;
}
// included only in given targets
IncludeIn in = description.getAnnotation(IncludeIn.class);
if (in != null && !Arrays.asList(in.value()).contains(target)) {
return false;
}
return true;
}
use of com.querydsl.core.testutil.IncludeIn in project querydsl by querydsl.
the class InsertBase method replace.
@Test
@IncludeIn(MYSQL)
@SkipForQuoted
public void replace() {
SQLInsertClause clause = mysqlReplace(survey);
clause.columns(survey.id, survey.name).values(3, "Hello");
assertEquals("replace into SURVEY (ID, NAME) values (?, ?)", clause.toString());
clause.execute();
}
use of com.querydsl.core.testutil.IncludeIn in project querydsl by querydsl.
the class MergeBase method mergeBatch.
@Test
@IncludeIn(H2)
public void mergeBatch() {
SQLMergeClause merge = merge(survey).keys(survey.id).set(survey.id, 5).set(survey.name, "5").addBatch();
assertEquals(1, merge.getBatchCount());
assertFalse(merge.isEmpty());
merge.keys(survey.id).set(survey.id, 6).set(survey.name, "6").addBatch();
assertEquals(2, merge.getBatchCount());
assertEquals(2, merge.execute());
assertEquals(1L, query().from(survey).where(survey.name.eq("5")).fetchCount());
assertEquals(1L, query().from(survey).where(survey.name.eq("6")).fetchCount());
}
use of com.querydsl.core.testutil.IncludeIn in project querydsl by querydsl.
the class MergeBase method merge_with_templateExpression_in_batch.
@Test
@IncludeIn(H2)
public void merge_with_templateExpression_in_batch() {
SQLMergeClause merge = merge(survey).keys(survey.id).set(survey.id, 5).set(survey.name, Expressions.stringTemplate("'5'")).addBatch();
assertEquals(1, merge.execute());
}
use of com.querydsl.core.testutil.IncludeIn in project querydsl by querydsl.
the class MergeBase method mergeBatch_with_subquery.
@Test
@IncludeIn(H2)
public void mergeBatch_with_subquery() {
SQLMergeClause merge = merge(survey).keys(survey.id).columns(survey.id, survey.name).select(query().from(survey2).select(survey2.id.add(20), survey2.name)).addBatch();
merge(survey).keys(survey.id).columns(survey.id, survey.name).select(query().from(survey2).select(survey2.id.add(40), survey2.name)).addBatch();
assertEquals(1, merge.execute());
}
Aggregations