public class SelectDescriptor
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SelectDescriptor.JoinDescriptor
Describes a join statement within a
SelectDescriptor |
static class |
SelectDescriptor.Key
All recognized Keys for a SELECT statement
|
| Constructor and Description |
|---|
SelectDescriptor(java.lang.String sql)
Create an SelectDescriptor on the basis of an select-statement
|
| Modifier and Type | Method and Description |
|---|---|
static int |
findKeyWord(java.lang.String select,
int pos,
java.lang.String... words)
find the first position of the keyword from words in SQL
|
java.lang.String |
getAfter(SelectDescriptor.Key key)
get the SQL statement after this
SelectDescriptor.Key |
java.lang.String |
getBefore(SelectDescriptor.Key key)
get the SQL statement before this
SelectDescriptor.Key, not included |
java.lang.String |
getColumns()
get a comma-seperated list of columns for this
select statement
|
java.lang.String |
getExcept()
get the
SelectDescriptor.Key.EXCEPT part of the select statement, null if it does not contain a union |
java.lang.String |
getFrom()
get a comma-seperated list of tables from the FROM-part
of this select statement
|
java.lang.String |
getGroupBy()
get a comma-seperated list of columns from the GROUP BY-part
of this select statement
|
java.lang.String |
getHaving()
get the HAVING clause of this select statement
|
java.lang.String |
getInBetween(SelectDescriptor.Key start,
SelectDescriptor.Key end)
get the SQL statement between
SelectDescriptor.Key start and SelectDescriptor.Key end , not included |
java.lang.String |
getIntersect()
get the
SelectDescriptor.Key.INTERSECT part of the select statement, null if it does not contain a union |
SelectDescriptor[] |
getJoins()
get a array of
SelectDescriptor with all the joins in the Select statement |
java.lang.String |
getOrderBy()
get a comma-seperated list of columns from the ORDER BY-part
of this select statement
|
java.lang.String |
getUnion()
get the
SelectDescriptor.Key.UNION part of the select statement, null if it does not contain a union |
java.lang.String |
getWhere()
get the WHERE clause of this select statement
|
java.lang.String |
toString()
get the complete statement equals to the
select statement which was passed in
|
public SelectDescriptor(java.lang.String sql)
sql - String, a valid select statementpublic java.lang.String toString()
toString in class java.lang.ObjectObject.toString()public java.lang.String getColumns()
* dependant on the
select statementpublic java.lang.String getFrom()
public SelectDescriptor[] getJoins()
SelectDescriptor with all the joins in the Select statementSelectDescriptor with joinspublic java.lang.String getWhere()
public java.lang.String getGroupBy()
public java.lang.String getHaving()
public java.lang.String getOrderBy()
public java.lang.String getUnion()
SelectDescriptor.Key.UNION part of the select statement, null if it does not contain a unionSelectDescriptor.Key.UNION part of the select statementpublic java.lang.String getIntersect()
SelectDescriptor.Key.INTERSECT part of the select statement, null if it does not contain a unionSelectDescriptor.Key.INTERSECT part of the select statementpublic java.lang.String getExcept()
SelectDescriptor.Key.EXCEPT part of the select statement, null if it does not contain a unionSelectDescriptor.Key.EXCEPT part of the select statementpublic java.lang.String getInBetween(SelectDescriptor.Key start, SelectDescriptor.Key end)
SelectDescriptor.Key start and SelectDescriptor.Key end , not includedstart - SelectDescriptor.Keyend - SelectDescriptor.KeySelectDescriptor.Key start and SelectDescriptor.Key endpublic java.lang.String getBefore(SelectDescriptor.Key key)
SelectDescriptor.Key, not includedkey - SelectDescriptor.KeySelectDescriptor.Keypublic java.lang.String getAfter(SelectDescriptor.Key key)
SelectDescriptor.Keykey - SelectDescriptor.KeySelectDescriptor.Keypublic static int findKeyWord(java.lang.String select,
int pos,
java.lang.String... words)
select - Stringpos - integerwords - String[]