mirror of
https://github.com/querydsl/querydsl.git
synced 2026-07-06 21:05:50 +08:00
24 lines
729 B
Java
24 lines
729 B
Java
package com.mysema.query;
|
|
|
|
import org.junit.rules.MethodRule;
|
|
import org.junit.runners.model.FrameworkMethod;
|
|
import org.junit.runners.model.Statement;
|
|
|
|
import com.mysema.query.sql.SQLTemplates;
|
|
import com.mysema.testutil.EmptyStatement;
|
|
|
|
public class SkipForQuotedRule implements MethodRule {
|
|
|
|
@Override
|
|
public Statement apply(Statement base, FrameworkMethod method, Object target) {
|
|
SQLTemplates templates = Connections.getTemplates();
|
|
if (templates.isUseQuotes() || templates.isPrintSchema()) {
|
|
boolean run = method.getMethod().getAnnotation(SkipForQuoted.class) == null;
|
|
return run ? base : EmptyStatement.DEFAULT;
|
|
} else {
|
|
return base;
|
|
}
|
|
}
|
|
|
|
}
|