net.sf.jsqlparser.schema.Table.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(8.1k)|赞(0)|评价(0)|浏览(228)

本文整理了Java中net.sf.jsqlparser.schema.Table.<init>()方法的一些代码示例,展示了Table.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Table.<init>()方法的具体详情如下:
包路径:net.sf.jsqlparser.schema.Table
类名称:Table
方法名:<init>

Table.<init>介绍

暂无

代码示例

代码示例来源:origin: JSQLParser/JSqlParser

  1. public Column(List<String> nameParts) {
  2. this(nameParts.size() > 1
  3. ? new Table(nameParts.subList(0, nameParts.size() - 1)) : null,
  4. nameParts.get(nameParts.size() - 1));
  5. }

代码示例来源:origin: alibaba/mdrill

  1. Table table = null;
  2. if (name3 != null) {
  3. table = new Table(name1, name2);
  4. colName = name3;
  5. } else if (name2 != null) {
  6. table = new Table(null, name1);
  7. colName = name2;
  8. } else {
  9. table = new Table(null, null);
  10. colName = name1;

代码示例来源:origin: alibaba/mdrill

  1. final public Table Table() throws ParseException {
  2. Table table = null;
  3. String name1 = null;
  4. String name2 = null;
  5. if (jj_2_4(3)) {
  6. name1 = RelObjectName();
  7. jj_consume_token(81);
  8. name2 = RelObjectName();
  9. table = new Table(name1, name2);
  10. } else {
  11. switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
  12. case S_IDENTIFIER:
  13. case S_QUOTED_IDENTIFIER:
  14. name1 = RelObjectName();
  15. table = new Table(null, name1);
  16. break;
  17. default:
  18. jj_la1[21] = jj_gen;
  19. jj_consume_token(-1);
  20. throw new ParseException();
  21. }
  22. }
  23. {if (true) return table;}
  24. throw new Error("Missing return statement in function");
  25. }

代码示例来源:origin: JSQLParser/JSqlParser

  1. jjtc000 = false;
  2. jjtn000.jjtSetLastToken(getToken(0));
  3. Table table = new Table(data);
  4. return table;
  5. } catch (Throwable jjte000) {

代码示例来源:origin: geotools/geotools

  1. final Table qualifiedTable = new Table();
  2. final String databaseName;
  3. final String userName;

代码示例来源:origin: com.github.jsqlparser/jsqlparser

  1. public Column(List<String> nameParts) {
  2. this(nameParts.size() > 1
  3. ? new Table(nameParts.subList(0, nameParts.size() - 1)) : null,
  4. nameParts.get(nameParts.size() - 1));
  5. }

代码示例来源:origin: org.opencadc/cadc-adql

  1. /**
  2. * Add new entries to the table name map.
  3. *
  4. * @param originalName a table name that should be replaced
  5. * @param newName the value that originalName should be replaced with
  6. */
  7. public void put(String originalName, String newName)
  8. {
  9. Table t = new Table();
  10. String[] parts = newName.split("[.]");
  11. if (parts.length == 1) {
  12. t.setName(parts[0]);
  13. } else if (parts.length == 2) {
  14. t.setSchemaName(parts[0]);
  15. t.setName(parts[1]);
  16. } else if (parts.length == 3) {
  17. t.setSchemaName(parts[0] + "." + parts[1]);
  18. t.setName(parts[2]);
  19. }
  20. else
  21. throw new IllegalArgumentException("expected new table name to have 1-3 parts, found " + parts.length);
  22. map.put(originalName, t);
  23. }

代码示例来源:origin: org.opencadc/cadc-adql

  1. /**
  2. * Add new entries to the table name map.
  3. *
  4. * @param originalName a table name that should be replaced
  5. * @param newName the value that originalName should be replaced with
  6. */
  7. public void put(String originalName, String newName)
  8. {
  9. Table t = new Table();
  10. String[] parts = newName.split("[.]");
  11. if (parts.length == 1) {
  12. t.setName(parts[0]);
  13. } else if (parts.length == 2) {
  14. t.setSchemaName(parts[0]);
  15. t.setName(parts[1]);
  16. } else if (parts.length == 3) {
  17. t.setSchemaName(parts[0] + "." + parts[1]);
  18. t.setName(parts[2]);
  19. }
  20. else
  21. throw new IllegalArgumentException("expected new table name to have 1-3 parts, found " + parts.length);
  22. map.put(originalName, t);
  23. }

代码示例来源:origin: org.opencadc/cadc-adql

  1. /**
  2. * Return a SelectExpressionItem for a given Table and columnName
  3. *
  4. * @param table
  5. * @param columnName
  6. * @return
  7. */
  8. private static SelectExpressionItem newSelectExpressionItem(Table table, String columnName)
  9. {
  10. Table siTable;
  11. String alias = table.getAlias();
  12. if (alias != null && !alias.isEmpty())
  13. siTable = new Table(null, alias);
  14. else
  15. siTable = table;
  16. Column column = new Column(siTable, columnName);
  17. SelectExpressionItem sei = new SelectExpressionItem();
  18. sei.setExpression(column);
  19. return sei;
  20. }

代码示例来源:origin: org.opencadc/cadc-jsqlparser-compat

  1. Table table = null;
  2. if (name3 != null) {
  3. table = new Table(name1, name2);
  4. colName = name3;
  5. } else if (name2 != null) {
  6. table = new Table(null, name1);
  7. colName = name2;
  8. } else {
  9. table = new Table(null, null);
  10. colName = name1;

代码示例来源:origin: org.opencadc/cadc-jsqlparser-compat

  1. final public Table Table() throws ParseException {Table table = null;
  2. String name1 = null;
  3. String name2 = null;
  4. if (jj_2_4(3)) {
  5. name1 = RelObjectName();
  6. jj_consume_token(81);
  7. name2 = RelObjectName();
  8. table = new Table(name1, name2);
  9. } else {
  10. switch ((jj_ntk==-1)?jj_ntk_f():jj_ntk) {
  11. case S_IDENTIFIER:
  12. case S_QUOTED_IDENTIFIER:{
  13. name1 = RelObjectName();
  14. table = new Table(null, name1);
  15. break;
  16. }
  17. default:
  18. jj_la1[21] = jj_gen;
  19. jj_consume_token(-1);
  20. throw new ParseException();
  21. }
  22. }
  23. {if ("" != null) return table;}
  24. throw new Error("Missing return statement in function");
  25. }

代码示例来源:origin: com.eas.platypus/platypus-js-sql-parser

  1. Table table = null;
  2. if (name3 != null) {
  3. table = new Table(name1, name2);
  4. colName = name3;
  5. } else if (name2 != null) {
  6. table = new Table(null, name1);
  7. colName = name2;
  8. } else {
  9. table = new Table(null, null);
  10. colName = name1;

代码示例来源:origin: com.intoverflow.booster/booster-core

  1. @Override
  2. public void visit(Column column) {
  3. net.sf.jsqlparser.schema.Table table = column.getTable();
  4. if (table == null) {
  5. table = new net.sf.jsqlparser.schema.Table(mainAlias);
  6. column.setTable(table);
  7. } else {
  8. if (StringUtils.isBlank(table.getName())) {
  9. table.setName(mainAlias);
  10. }
  11. }
  12. }
  13. });

代码示例来源:origin: org.geotools/gt-arcsde

  1. final Table qualifiedTable = new Table();
  2. final String databaseName;
  3. final String userName;

代码示例来源:origin: com.intoverflow.booster/booster-core

  1. @Override
  2. public void visit(Column column) {
  3. Table table = column.getTable();
  4. if (table == null || StringUtils.isBlank(table.getName())) {
  5. Table t = new Table(tableName);
  6. if (tableAlias != null) {
  7. t.setAlias(new Alias(tableAlias, false));
  8. }
  9. column.setTable(t);
  10. }
  11. }
  12. });

代码示例来源:origin: metatron-app/metatron-discovery

  1. public Select createSelect(JdbcIngestionInfo ingestionInfo) throws JSQLParserException {
  2. Select select;
  3. if (ingestionInfo.getDataType() == JdbcIngestionInfo.DataType.TABLE) {
  4. String database = ingestionInfo.getDatabase();
  5. String table = ingestionInfo.getQuery();
  6. String tableName = (!table.contains(".") && database != null) ? database + "." + table : table;
  7. select = SelectUtils.buildSelectFromTable(new Table(tableName));
  8. } else {
  9. net.sf.jsqlparser.statement.Statement parsedStmt = CCJSqlParserUtil.parse(ingestionInfo.getQuery());
  10. if (!(parsedStmt instanceof Select)) {
  11. throw new JSQLParserException("query is not select");
  12. }
  13. select = (Select) parsedStmt;
  14. }
  15. return select;
  16. }

代码示例来源:origin: it.unibz.inf.ontop/ontop-obdalib-core

  1. /**
  2. * creates a query of the form SELECT * FROM viewName
  3. */
  4. static ParsedSQLQuery createParsedSqlForGeneratedView(QuotedIDFactory idfac, RelationID viewId) {
  5. PlainSelect body = new PlainSelect();
  6. List<SelectItem> list = new ArrayList<>(1);
  7. list.add(new AllColumns());
  8. body.setSelectItems(list); // create SELECT *
  9. Table viewTable = new Table(viewId.getSchemaSQLRendering(), viewId.getTableNameSQLRendering());
  10. body.setFromItem(viewTable); // create FROM viewTable
  11. Select select = new Select();
  12. select.setSelectBody(body);
  13. ParsedSQLQuery queryParsed = null;
  14. try {
  15. queryParsed = new ParsedSQLQuery(select, false, idfac);
  16. }
  17. catch (JSQLParserException e) {
  18. if (e.getCause() instanceof ParseException)
  19. log.warn("Parse exception, check no SQL reserved keywords have been used "+ e.getCause().getMessage());
  20. }
  21. return queryParsed;
  22. }

代码示例来源:origin: com.eas.platypus/platypus-js-sql-parser

  1. jj_consume_token(DOT);
  2. name2 = RelObjectName();
  3. table = new Table(name1, name2);
  4. if (token.specialToken != null) {
  5. table.setComment(token.specialToken.image);
  6. case S_QUOTED_IDENTIFIER:{
  7. name1 = RelObjectName();
  8. table = new Table(null, name1);
  9. if (token.specialToken != null) {
  10. table.setComment(token.specialToken.image);

代码示例来源:origin: it.unibz.inf.ontop/ontop-obdalib-core

  1. @Override
  2. public void visit(Table table) {
  3. //obtain the column names from the metadata
  4. RelationID tableID = idfac.createRelationID(table.getSchemaName(), table.getName());
  5. RelationDefinition tableDefinition = metadata.getRelation(tableID);
  6. if (tableDefinition == null)
  7. throw new RuntimeException("Definition not found for table '" + table + "'.");
  8. Table tableName;
  9. if (aliasSubselect != null)
  10. tableName = new Table(aliasSubselect);
  11. else if (table.getAlias() != null) //use the alias if present
  12. tableName = new Table(table.getAlias().getName());
  13. else
  14. tableName = table;
  15. for (Attribute att : tableDefinition.getAttributes()) {
  16. // ROMAN (9 Oct 2015)
  17. // the unquoted name is used for comparisons
  18. Column columnNameUnquoted = new Column(tableName, att.getID().getSQLRendering());
  19. if (variables.contains(columnNameUnquoted.getFullyQualifiedName(), att.getID().getName())) {
  20. // properly quoted name if necessary
  21. Column columnName = new Column(tableName, att.getID().getSQLRendering());
  22. columns.add(new SelectExpressionItem(columnName));
  23. }
  24. }
  25. }

代码示例来源:origin: com.github.jsqlparser/jsqlparser

  1. Table table = new Table(data);
  2. return table;
  3. } catch (Throwable jjte000) {

相关文章