Class SqlParser


  • public class SqlParser
    extends java.lang.Object
    SQL parser using JavaCC syntax definition file where.jj.
    Author:
    Jonathan Ackerman, Juan Pablo Morales, Mario Frasca
    • Constructor Detail

      • SqlParser

        public SqlParser()
    • Method Detail

      • setPlaceholdersValues

        public void setPlaceholdersValues​(java.lang.Object[] values)
      • getPlaceholdersCount

        public int getPlaceholdersCount()
      • getTableNames

        public java.util.List<java.lang.String> getTableNames()
        Gets the tableName attribute of the SqlParser object
        Returns:
        The tableName value
      • getTableAliases

        public java.util.List<java.lang.String> getTableAliases()
      • getColumns

        public java.util.List<java.lang.Object[]> getColumns()
        Gets the columnNames attribute of the SqlParser object
        Returns:
        The columnNames value
      • parse

        public void parse​(java.lang.String sql)
                   throws java.sql.SQLException,
                          ParseException
        Parses SQL statement.
        Parameters:
        sql - SQL statement to parse.
        Throws:
        ParseException - if SQL statement cannot be parsed.
        java.sql.SQLException - if SQL statement is not valid.
      • setParsedStatement

        public void setParsedStatement​(org.relique.jdbc.csv.ParsedStatement parsedStatement)
                                throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • getColumnNames

        public java.lang.String[] getColumnNames()
      • getWhereClause

        public org.relique.jdbc.csv.LogicalExpression getWhereClause()
      • getGroupByColumns

        public java.util.List<Expression> getGroupByColumns()
      • getHavingClause

        public org.relique.jdbc.csv.LogicalExpression getHavingClause()
      • getOrderByColumns

        public java.util.List<java.lang.Object[]> getOrderByColumns()
      • getLimit

        public int getLimit()
      • getOffset

        public int getOffset()
      • getAlias

        public java.lang.String getAlias​(int i)
      • getExpression

        public Expression getExpression​(int i)
      • isDistinct

        public boolean isDistinct()