Class AccessSqlParser


  • public class AccessSqlParser
    extends Object
    Parse FROM in SQL WHERE clause
    Version:
    $Id: AccessSqlParser.java,v 1.3 2006/07/30 00:58:36 jjanke Exp $
    Author:
    Jorg Janke, Teo Sarca, SC ARHIPAC SERVICE SRL
  • BF [ 1652623 ] AccessSqlParser.getTableInfo(String) - tablename parsing bug
  • BF [ 1964496 ] AccessSqlParser is not parsing well JOIN CLAUSE
  • BF [ 2840157 ] AccessSqlParser is not parsing well ON keyword https://sourceforge.net/p/adempiere/bugs/2042/
    • Constructor Detail

      • AccessSqlParser

        public AccessSqlParser()
        Base Constructor. You need to set the SQL and start the parsing manually.
      • AccessSqlParser

        public AccessSqlParser​(String sql)
        Full Constructor
        Parameters:
        sql - sql command
    • Method Detail

      • setSql

        public void setSql​(String sql)
        Set Sql and parse it
        Parameters:
        sql - sql
      • getSql

        public String getSql()
        Get (original) Sql
        Returns:
        sql
      • parse

        public boolean parse()
        Parse Original SQL. Called from setSql or Constructor.
        Returns:
        true if pased
      • toString

        public String toString()
        String Representation
        Overrides:
        toString in class Object
        Returns:
        info
      • getTableInfo

        public AccessSqlParser.TableInfo[] getTableInfo​(int index)
        Get Table Info.
        Parameters:
        index - record index
        Returns:
        table info
      • getSqlStatement

        public String getSqlStatement​(int index)
        Get Sql Statements
        Parameters:
        index - record index
        Returns:
        index index of query
      • getNoSqlStatments

        public int getNoSqlStatments()
        Get No of SQL Statements
        Returns:
        FROM clause count
      • getMainSqlIndex

        public int getMainSqlIndex()
        Get index of main Statements
        Returns:
        index of main statement or -1 if not found
      • getMainSql

        public String getMainSql()
        Get main sql Statement
        Returns:
        main statement
      • getIndexClose

        public int getIndexClose​(String from)
        Get index of ')'
        Returns:
        index of ')'