当前位置: 首页>>代码示例>>Java>>正文


Java Replace类代码示例

本文整理汇总了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);
    }
}
 
开发者ID:sogou-biztech,项目名称:compass,代码行数:18,代码来源:TableRenameVisitor.java

示例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);
}
 
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:10,代码来源:StatementDeParser.java

示例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);
    }
}
 
开发者ID:WeiMei-Tian,项目名称:editor-sql,代码行数:13,代码来源:TablesNamesFinder.java

示例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);
    }
}
 
开发者ID:justice-code,项目名称:QiuQiu,代码行数:13,代码来源:ReplaceTablesNamesFinder.java

示例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);
    }
}
 
开发者ID:hellojavaer,项目名称:ddal,代码行数:12,代码来源:JSQLBaseVisitor.java

示例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);
}
 
开发者ID:Wolfgang-Winter,项目名称:cibet,代码行数:9,代码来源:SqlParser.java

示例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);

}
 
开发者ID:UBOdin,项目名称:jsqlparser,代码行数:15,代码来源:ReplaceTest.java

示例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);
}
 
开发者ID:UBOdin,项目名称:jsqlparser,代码行数:14,代码来源:ReplaceTest.java

示例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);
}
 
开发者ID:UBOdin,项目名称:jsqlparser,代码行数:13,代码来源:ReplaceTest.java

示例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);
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:9,代码来源:StatementDeParser.java

示例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);

}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:16,代码来源:ReplaceTest.java

示例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);
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:15,代码来源:ReplaceTest.java

示例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);
}
 
开发者ID:marat-gainullin,项目名称:platypus-js,代码行数:14,代码来源:ReplaceTest.java

示例14: visit

import net.sf.jsqlparser.statement.replace.Replace; //导入依赖的package包/类
public void visit(Replace replace) {
    throw new UnsupportedSQLFeatureException("Feature Replace not supported");
}
 
开发者ID:adamkewley,项目名称:jobson,代码行数:4,代码来源:AllColumnRefsFinder.java

示例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.
}
 
开发者ID:diennea,项目名称:herddb,代码行数:5,代码来源:JdbcQueryRewriter.java


注:本文中的net.sf.jsqlparser.statement.replace.Replace类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。