org.brains2b.sql.meta
Class SelectDescriptor

java.lang.Object
  extended by org.brains2b.sql.meta.SelectDescriptor

public class SelectDescriptor
extends java.lang.Object

Describe a select statement in terms of the different keywords which makes it up

Version:
0.10.1 [21-10-2006]
Author:
dennis@brains2b.nl

Constructor Summary
SelectDescriptor(java.lang.String sql)
          Create an SelectDescriptor on the basis of an select-statement
 
Method Summary
 java.lang.String getColumns()
          get a comma-seperated list of columns for this select statement
 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 getOrderBy()
          get a comma-seperated list of columns from the ORDER BY-part of this select statement
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SelectDescriptor

public SelectDescriptor(java.lang.String sql)
Create an SelectDescriptor on the basis of an select-statement

Parameters:
sql - String, a valid select statement
Method Detail

toString

public java.lang.String toString()
get the complete statement equals to the select statement which was passed in

Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

getColumns

public java.lang.String getColumns()
get a comma-seperated list of columns for this select statement

Returns:
String, a comma-seperated list of columms. Could contain only * dependant on the select statement

getFrom

public java.lang.String getFrom()
get a comma-seperated list of tables from the FROM-part of this select statement

Returns:
String, a comma-seperated list of tables.

getWhere

public java.lang.String getWhere()
get the WHERE clause of this select statement

Returns:
String, the WHERE clause of this select statement without the keyword. Can be null if no WHERE-statement was defined

getGroupBy

public java.lang.String getGroupBy()
get a comma-seperated list of columns from the GROUP BY-part of this select statement

Returns:
String, a comma-seperated list of columms. Can be null if no GROUP BY-statement was defined

getHaving

public java.lang.String getHaving()
get the HAVING clause of this select statement

Returns:
String, the HAVING clause of this select statement without the keyword. Can be null if no HAVING-statement was defined

getOrderBy

public java.lang.String getOrderBy()
get a comma-seperated list of columns from the ORDER BY-part of this select statement

Returns:
String, a comma-seperated list of columms. Can be null if no ORDER BY-statement was defined