本文整理汇总了Java中net.sf.jsqlparser.statement.replace.Replace类的典型用法代码示例。如果您正苦于以下问题:Java Replace类的具体用法?Java Replace怎么用?Java Replace使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Replace类属于net.sf.jsqlparser.statement.replace包,在下文中一共展示了Replace类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visit
import net.sf.jsqlparser.statement.replace.Replace; //导入依赖的package包/类
@Override
public void visit(Replace replace)
{
replace.getTable().accept(this);
if (replace.getExpressions() != null)
{
for (Expression expression : replace.getExpressions())
{
expression.accept(this);
}
}
if (replace.getItemsList() != null)
{
replace.getItemsList().accept(this);
}
}
示例2: visit
import net.sf.jsqlparser.statement.replace.Replace; //导入依赖的package包/类
@Override
public void visit(Replace replace) {
SelectDeParser selectDeParser = new SelectDeParser();
selectDeParser.setBuffer(buffer);
ExpressionDeParser expressionDeParser = new ExpressionDeParser(selectDeParser, buffer);
selectDeParser.setExpressionVisitor(expressionDeParser);
ReplaceDeParser replaceDeParser = new ReplaceDeParser(expressionDeParser, selectDeParser, buffer);
replaceDeParser.deParse(replace);
}
示例3: visit
import net.sf.jsqlparser.statement.replace.Replace; //导入依赖的package包/类
@Override
public void visit(Replace replace) {
tables.add(replace.getTable().getName());
if (replace.getExpressions() != null) {
for (Expression expression : replace.getExpressions()) {
expression.accept(this);
}
}
if (replace.getItemsList() != null) {
replace.getItemsList().accept(this);
}
}
示例4: visit
import net.sf.jsqlparser.statement.replace.Replace; //导入依赖的package包/类
@Override
public void visit(Replace replace) {
tables.add(replace.getTable(), table -> table.getName());
if (replace.getExpressions() != null) {
for (Expression expression : replace.getExpressions()) {
expression.accept(this);
}
}
if (replace.getItemsList() != null) {
replace.getItemsList().accept(this);
}
}
示例5: visit
import net.sf.jsqlparser.statement.replace.Replace; //导入依赖的package包/类
@Override
public void visit(Replace replace) {
if (replace.getExpressions() != null) {
for (Expression expression : replace.getExpressions()) {
expression.accept(this);
}
}
if (replace.getItemsList() != null) {
replace.getItemsList().accept(this);
}
}
示例6: visit
import net.sf.jsqlparser.statement.replace.Replace; //导入依赖的package包/类
@Override
public synchronized void visit(Replace arg0) {
controlEventMap.put(sql, null);
targetMap.put(sql, null);
insUpdColumnsMap.put(sql, new ArrayList<SqlParameter>());
parameterMap.put(sql, new LinkedList<SqlParameter>());
emptyPrimaryKey(SqlParameterType.WHERE_PARAMETER);
}
示例7: testReplaceSyntax1
import net.sf.jsqlparser.statement.replace.Replace; //导入依赖的package包/类
public void testReplaceSyntax1() throws JSQLParserException {
String statement = "REPLACE mytable SET col1='as', col2=?, col3=565";
Replace replace = (Replace) parserManager.parse(new StringReader(statement));
assertEquals("mytable", replace.getTable().getName());
assertEquals(3, replace.getColumns().size());
assertEquals("col1", ((Column) replace.getColumns().get(0)).getColumnName());
assertEquals("col2", ((Column) replace.getColumns().get(1)).getColumnName());
assertEquals("col3", ((Column) replace.getColumns().get(2)).getColumnName());
assertEquals("as", ((StringValue)replace.getExpressions().get(0)).getValue());
assertTrue(replace.getExpressions().get(1) instanceof JdbcParameter);
assertEquals(565, ((LongValue)replace.getExpressions().get(2)).getValue());
assertEquals(statement, ""+replace);
}
示例8: testReplaceSyntax2
import net.sf.jsqlparser.statement.replace.Replace; //导入依赖的package包/类
public void testReplaceSyntax2() throws JSQLParserException {
String statement = "REPLACE mytable (col1, col2, col3) VALUES ('as', ?, 565)";
Replace replace = (Replace) parserManager.parse(new StringReader(statement));
assertEquals("mytable", replace.getTable().getName());
assertEquals(3, replace.getColumns().size());
assertEquals("col1", ((Column) replace.getColumns().get(0)).getColumnName());
assertEquals("col2", ((Column) replace.getColumns().get(1)).getColumnName());
assertEquals("col3", ((Column) replace.getColumns().get(2)).getColumnName());
assertEquals("as", ((StringValue) ((ExpressionList)replace.getItemsList()).getExpressions().get(0)).getValue());
assertTrue(((ExpressionList)replace.getItemsList()).getExpressions().get(1) instanceof JdbcParameter);
assertEquals(565, ((LongValue) ((ExpressionList)replace.getItemsList()).getExpressions().get(2)).getValue());
assertEquals(statement, ""+replace);
}
示例9: testReplaceSyntax3
import net.sf.jsqlparser.statement.replace.Replace; //导入依赖的package包/类
public void testReplaceSyntax3() throws JSQLParserException {
String statement = "REPLACE mytable (col1, col2, col3) SELECT * FROM mytable3";
Replace replace = (Replace) parserManager.parse(new StringReader(statement));
assertEquals("mytable", replace.getTable().getName());
assertEquals(3, replace.getColumns().size());
assertEquals("col1", ((Column) replace.getColumns().get(0)).getColumnName());
assertEquals("col2", ((Column) replace.getColumns().get(1)).getColumnName());
assertEquals("col3", ((Column) replace.getColumns().get(2)).getColumnName());
assertTrue(replace.getItemsList() instanceof SubSelect);
//TODO:
//assertEquals(statement, ""+replace);
}
示例10: visit
import net.sf.jsqlparser.statement.replace.Replace; //导入依赖的package包/类
public void visit(Replace replace) {
SelectDeParser selectDeParser = new SelectDeParser();
selectDeParser.setBuffer(buffer);
ExpressionDeParser expressionDeParser = new ExpressionDeParser(selectDeParser, buffer);
selectDeParser.setExpressionVisitor(expressionDeParser);
ReplaceDeParser replaceDeParser = new ReplaceDeParser(expressionDeParser, selectDeParser, buffer);
replaceDeParser.deParse(replace);
}
示例11: testReplaceSyntax1
import net.sf.jsqlparser.statement.replace.Replace; //导入依赖的package包/类
@Test
public void testReplaceSyntax1() throws JSQLParserException {
String statement = "REPLACE mytable SET col1='as', col2=?, col3=565";
Replace replace = (Replace) parserManager.parse(new StringReader(statement));
assertEquals("mytable", replace.getTable().getName());
assertEquals(3, replace.getColumns().size());
assertEquals("col1", ((Column) replace.getColumns().get(0)).getColumnName());
assertEquals("col2", ((Column) replace.getColumns().get(1)).getColumnName());
assertEquals("col3", ((Column) replace.getColumns().get(2)).getColumnName());
assertEquals("as", ((StringValue) replace.getExpressions().get(0)).getValue());
assertTrue(replace.getExpressions().get(1) instanceof JdbcParameter);
assertEquals(565, ((LongValue) replace.getExpressions().get(2)).getValue());
assertEquals(statement, "" + replace);
}
示例12: testReplaceSyntax2
import net.sf.jsqlparser.statement.replace.Replace; //导入依赖的package包/类
@Test
public void testReplaceSyntax2() throws JSQLParserException {
String statement = "REPLACE mytable (col1, col2, col3) VALUES ('as', ?, 565)";
Replace replace = (Replace) parserManager.parse(new StringReader(statement));
assertEquals("mytable", replace.getTable().getName());
assertEquals(3, replace.getColumns().size());
assertEquals("col1", ((Column) replace.getColumns().get(0)).getColumnName());
assertEquals("col2", ((Column) replace.getColumns().get(1)).getColumnName());
assertEquals("col3", ((Column) replace.getColumns().get(2)).getColumnName());
assertEquals("as", ((StringValue) ((ExpressionList) replace.getItemsList()).getExpressions().get(0)).getValue());
assertTrue(((ExpressionList) replace.getItemsList()).getExpressions().get(1) instanceof JdbcParameter);
assertEquals(565, ((LongValue) ((ExpressionList) replace.getItemsList()).getExpressions().get(2)).getValue());
assertEquals(statement, "" + replace);
}
示例13: testReplaceSyntax3
import net.sf.jsqlparser.statement.replace.Replace; //导入依赖的package包/类
@Test
public void testReplaceSyntax3() throws JSQLParserException {
String statement = "REPLACE mytable (col1, col2, col3) SELECT * FROM mytable3";
Replace replace = (Replace) parserManager.parse(new StringReader(statement));
assertEquals("mytable", replace.getTable().getName());
assertEquals(3, replace.getColumns().size());
assertEquals("col1", ((Column) replace.getColumns().get(0)).getColumnName());
assertEquals("col2", ((Column) replace.getColumns().get(1)).getColumnName());
assertEquals("col3", ((Column) replace.getColumns().get(2)).getColumnName());
assertTrue(replace.getItemsList() instanceof SubSelect);
//TODO:
//assertEquals(statement, ""+replace);
}
示例14: visit
import net.sf.jsqlparser.statement.replace.Replace; //导入依赖的package包/类
public void visit(Replace replace) {
throw new UnsupportedSQLFeatureException("Feature Replace not supported");
}
示例15: visit
import net.sf.jsqlparser.statement.replace.Replace; //导入依赖的package包/类
@Override
public void visit(Replace replace) {
throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
}