org.sqlproc.engine.impl
Class SqlProcessResult

java.lang.Object
  extended by org.sqlproc.engine.impl.SqlProcessResult
All Implemented Interfaces:
java.lang.Comparable<SqlProcessResult>

public class SqlProcessResult
extends java.lang.Object
implements java.lang.Comparable<SqlProcessResult>

Holds the results of ANSI SQL Query generation. The result is related to the overall ANSI SQL Query generation in SqlMetaStatement or the partial processing result in SqlMetaElement.process(SqlProcessContext). The main runtime contract is setQueryParams(SQLQuery).

Author:
Vladimir Hudec

Field Summary
private  boolean add
          The indicator that a partial processing result (of ANSI SQL Query generation) is going to be part of a final ANSI SQL.
private  java.util.Map<java.lang.String,SqlInputValue> inputValues
          The list if dynamic input values.
private  java.lang.Integer orderIndex
          The index of selected ordering rule (from the list of ordering directives).
private  java.lang.StringBuilder sql
          The final ANSI SQL or the fragment of ANSI SQL, which is dynamically generated from the META SQL based on input values.
 
Constructor Summary
SqlProcessResult()
          Creates a new instance.
SqlProcessResult(java.lang.String sql)
          Creates a new instance with a SQL fragment from SqlMetaText.
 
Method Summary
(package private)  void add(boolean add)
          Sets an indicator if a partial processing result will be part of a final ANSI SQL.
(package private)  void addFalse()
          Sets an indicator that a partial processing result is going to be part of a final ANSI SQL.
(package private)  void addInputValue(java.lang.String key, SqlInputValue value)
          Adds a new dynamic input value.
(package private)  void addInputValues(java.util.Map<java.lang.String,SqlInputValue> inputValues)
          Adds a new collection of dynamic input values.
(package private)  void addTrue()
          Sets an indicator that a partial processing result isn't going to be part of a final ANSI SQL.
 int compareTo(SqlProcessResult o)
          In case there're seeveral ordering rules in the final generated ANSI SQL, they should be ordered.
(package private)  java.util.Map<java.lang.String,SqlInputValue> getInputValues()
          Returns the collection of dynamic input values.
 java.lang.Integer getOrderIndex()
          Returns the index of selected ordering rule (from the list of ordering directives).
 java.lang.StringBuilder getSql()
          Returns the final ANSI SQL or a fragment of ANSI SQL, which is dynamically generated from the META SQL based on input values.
(package private)  boolean isAdd()
          Returns the indicator if a partial processing result will be part of a final ANSI SQL.
 void setOrderIndex(java.lang.Integer orderIndex)
          Sets an index of selected ordering rule (from the list of ordering directives).
 void setQueryParams(org.hibernate.SQLQuery query)
          Bind an input values to a named query parameters.
(package private)  void setSql(java.lang.StringBuilder sql)
          Sets the final ANSI SQL or a fragment of ANSI SQL, which is dynamically generated from the META SQL based on input values.
 java.lang.String toString()
          For debug purposes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

add

private boolean add
The indicator that a partial processing result (of ANSI SQL Query generation) is going to be part of a final ANSI SQL.


inputValues

private java.util.Map<java.lang.String,SqlInputValue> inputValues
The list if dynamic input values. These parameters have to be binded to SQL statement.


sql

private java.lang.StringBuilder sql
The final ANSI SQL or the fragment of ANSI SQL, which is dynamically generated from the META SQL based on input values.


orderIndex

private java.lang.Integer orderIndex
The index of selected ordering rule (from the list of ordering directives).

Constructor Detail

SqlProcessResult

SqlProcessResult()
Creates a new instance.


SqlProcessResult

SqlProcessResult(java.lang.String sql)
Creates a new instance with a SQL fragment from SqlMetaText.

Parameters:
text - a SQL fragment
Method Detail

addFalse

void addFalse()
Sets an indicator that a partial processing result is going to be part of a final ANSI SQL.


addTrue

void addTrue()
Sets an indicator that a partial processing result isn't going to be part of a final ANSI SQL.


add

void add(boolean add)
Sets an indicator if a partial processing result will be part of a final ANSI SQL.

Parameters:
add - a new indicator value

isAdd

boolean isAdd()
Returns the indicator if a partial processing result will be part of a final ANSI SQL.

Returns:
the indicator value

addInputValue

void addInputValue(java.lang.String key,
                   SqlInputValue value)
Adds a new dynamic input value. This parameter have to be binded to SQL statement.

Parameters:
key - the name of a dynamic input value
value - a new dynamic input value

addInputValues

void addInputValues(java.util.Map<java.lang.String,SqlInputValue> inputValues)
Adds a new collection of dynamic input values. These parameters have to be binded to SQL statement.

Parameters:
inputValues - a new collection of dynamic input values

getInputValues

java.util.Map<java.lang.String,SqlInputValue> getInputValues()
Returns the collection of dynamic input values. These parameters have to be binded to SQL statement.

Returns:
the collection of dynamic input values

setSql

void setSql(java.lang.StringBuilder sql)
Sets the final ANSI SQL or a fragment of ANSI SQL, which is dynamically generated from the META SQL based on input values.

Parameters:
sql - the final ANSI SQL or a fragment of ANSI SQL

getSql

public java.lang.StringBuilder getSql()
Returns the final ANSI SQL or a fragment of ANSI SQL, which is dynamically generated from the META SQL based on input values.

Returns:
the final ANSI SQL or a fragment of ANSI SQL

setOrderIndex

public void setOrderIndex(java.lang.Integer orderIndex)
Sets an index of selected ordering rule (from the list of ordering directives).

Parameters:
orderIndex - a new index of selected ordering rule

getOrderIndex

public java.lang.Integer getOrderIndex()
Returns the index of selected ordering rule (from the list of ordering directives).

Returns:
the index of selected ordering rule

setQueryParams

public void setQueryParams(org.hibernate.SQLQuery query)
Bind an input values to a named query parameters.

Parameters:
query - the object-oriented representation of a Hibernate query

toString

public java.lang.String toString()
For debug purposes.

Overrides:
toString in class java.lang.Object
Returns:
a String representation for a debug output

compareTo

public int compareTo(SqlProcessResult o)
In case there're seeveral ordering rules in the final generated ANSI SQL, they should be ordered.

Specified by:
compareTo in interface java.lang.Comparable<SqlProcessResult>


Copyright © 2010. All Rights Reserved.