Package org.compiere.model
Class AccessSqlParser
- java.lang.Object
-
- org.compiere.model.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/
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AccessSqlParser.TableInfo
Table Info VO
-
Constructor Summary
Constructors Constructor Description AccessSqlParser()
Base Constructor.AccessSqlParser(String sql)
Full Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getIndexClose(String from)
Get index of ')'String
getMainSql()
Get main sql Statementint
getMainSqlIndex()
Get index of main Statementsint
getNoSqlStatments()
Get No of SQL StatementsString
getSql()
Get (original) SqlString
getSqlStatement(int index)
Get Sql StatementsAccessSqlParser.TableInfo[]
getTableInfo(int index)
Get Table Info.boolean
parse()
Parse Original SQL.void
setSql(String sql)
Set Sql and parse itString
toString()
String Representation
-
-
-
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
-
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 ')'
-
-