use of org.teiid.translator.google.visitor.SpreadsheetInsertVisitor in project teiid by teiid.
the class SpreadsheetUpdateExecution method executeInsert.
private UpdateResult executeInsert() throws TranslatorException {
SpreadsheetInfo info = connection.getSpreadsheetInfo();
SpreadsheetInsertVisitor visitor = new SpreadsheetInsertVisitor(info);
visitor.visit((Insert) command);
checkHeaders(visitor.getWorksheetTitle());
result = connection.executeRowInsert(visitor.getWorksheetTitle(), visitor.getColumnNameValuePair());
return result;
}
use of org.teiid.translator.google.visitor.SpreadsheetInsertVisitor in project teiid by teiid.
the class TestSQLtoSpreadsheetQuery method testInsertVisitorNull.
@Test
public void testInsertVisitorNull() throws Exception {
String sql = "insert into PeopleList(A,B,C) values ('String,String', null, 15.5)";
SpreadsheetInsertVisitor visitor = new SpreadsheetInsertVisitor(people);
visitor.visit((Insert) getCommand(sql));
assertEquals(2, visitor.getColumnNameValuePair().size());
assertEquals("String,String", visitor.getColumnNameValuePair().get("A"));
assertEquals(15.5, visitor.getColumnNameValuePair().get("C"));
}
use of org.teiid.translator.google.visitor.SpreadsheetInsertVisitor in project teiid by teiid.
the class TestSQLtoSpreadsheetQuery method testInsertVisitor.
@Test
public void testInsertVisitor() throws Exception {
String sql = "insert into PeopleList(A,B,C) values ('String,String', 'String@String', 15.5)";
SpreadsheetInsertVisitor visitor = new SpreadsheetInsertVisitor(people);
visitor.visit((Insert) getCommand(sql));
assertEquals(3, visitor.getColumnNameValuePair().size());
assertEquals("String,String", visitor.getColumnNameValuePair().get("A"));
assertEquals("String@String", visitor.getColumnNameValuePair().get("B"));
assertEquals(15.5, visitor.getColumnNameValuePair().get("C"));
}
Aggregations