Package org.compiere.model
Class AccessSqlParser
java.lang.Object
org.compiere.model.AccessSqlParser
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/
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
getIndexClose
(String from) Get index of ')'Get main sql Statementint
Get index of main Statementsint
Get No of SQL StatementsgetSql()
Get (original) SqlgetSqlStatement
(int index) Get Sql StatementsgetTableInfo
(int index) Get Table Info.boolean
parse()
Parse Original SQL.void
Set Sql and parse ittoString()
String Representation
-
Constructor Details
-
AccessSqlParser
public AccessSqlParser()Base Constructor. You need to set the SQL and start the parsing manually. -
AccessSqlParser
Full Constructor- Parameters:
sql
- sql command
-
-
Method Details
-
setSql
Set Sql and parse it- Parameters:
sql
- sql
-
getSql
Get (original) Sql- Returns:
- sql
-
parse
public boolean parse()Parse Original SQL. Called from setSql or Constructor.- Returns:
- true if parsed successfully
-
toString
String Representation -
getTableInfo
Get Table Info.- Parameters:
index
- record index- Returns:
- table info
-
getSqlStatement
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
Get main sql Statement- Returns:
- main statement
-
getIndexClose
Get index of ')'- Returns:
- index of ')'
-