Class AbstractSqlGenerator
- java.lang.Object
-
- de.businesscode.bcdui.wrs.specificSql.AbstractSqlGenerator
-
- All Implemented Interfaces:
ISqlGenerator
- Direct Known Subclasses:
MultiLevelSuggest
public abstract class AbstractSqlGenerator extends java.lang.Object implements ISqlGenerator
Convenience class for building custom ISqlGenerators
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String
convertedSql
protected java.util.List<org.w3c.dom.Element>
parameters
protected java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.String>>
requestedBindingSetNames
protected java.util.Set<StandardBindingSet>
resultingBindingSets
protected java.util.List<WrsBindingItem>
selectedBindingItems
protected SQLStatementWithParams
selectStatementWithParams
-
Fields inherited from interface de.businesscode.bcdui.wrs.load.ISqlGenerator
BCD_WKATTRIBUTE_GROUPING, BCD_WKATTRIBUTE_OTHER
-
-
Constructor Summary
Constructors Constructor Description AbstractSqlGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getClientProvidedMaxRows()
getQueryMaxRowsjava.lang.String
getDbSourceName()
getDbSourceNameint
getMaxRows()
getMaxRowsjava.util.Set<java.util.Map.Entry<java.lang.String,java.lang.String>>
getRequestedBindingSetNames()
getRequestedBindingSetNames the requested bindingSet or bindingGroup names from the request document in the form Map.EntryThis because neither the BindingSet nor the alias need to be unique really java.util.Set<StandardBindingSet>
getResolvedBindingSets()
java.util.List<WrsBindingItem>
getSelectedBindingItems()
SQLStatementWithParams
getSelectStatement()
boolean
isEmpty()
isEmptyprotected void
setBcduiSql(java.lang.String sql, java.util.List<org.w3c.dom.Element> parameters)
Convenience method, taking an sql in BCD-UI BindingItem notation and deriving as much information from it as needed for ISqlGenerator
-
-
-
Field Detail
-
convertedSql
protected java.lang.String convertedSql
-
requestedBindingSetNames
protected java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.String>> requestedBindingSetNames
-
selectedBindingItems
protected java.util.List<WrsBindingItem> selectedBindingItems
-
resultingBindingSets
protected java.util.Set<StandardBindingSet> resultingBindingSets
-
selectStatementWithParams
protected SQLStatementWithParams selectStatementWithParams
-
parameters
protected java.util.List<org.w3c.dom.Element> parameters
-
-
Method Detail
-
setBcduiSql
protected void setBcduiSql(java.lang.String sql, java.util.List<org.w3c.dom.Element> parameters) throws BindingNotFoundException
Convenience method, taking an sql in BCD-UI BindingItem notation and deriving as much information from it as needed for ISqlGenerator- Parameters:
sql
-- Throws:
BindingNotFoundException
-
getDbSourceName
public java.lang.String getDbSourceName()
Description copied from interface:ISqlGenerator
getDbSourceName- Specified by:
getDbSourceName
in interfaceISqlGenerator
- Returns:
- the database name configured for this request or null for default
-
getResolvedBindingSets
public java.util.Set<StandardBindingSet> getResolvedBindingSets()
- Specified by:
getResolvedBindingSets
in interfaceISqlGenerator
- Returns:
- the really selected BindingSets
-
getSelectedBindingItems
public java.util.List<WrsBindingItem> getSelectedBindingItems() throws java.lang.Exception
- Specified by:
getSelectedBindingItems
in interfaceISqlGenerator
- Returns:
- The list of binding items in the select clause in their order.
- Throws:
java.lang.Exception
-
getRequestedBindingSetNames
public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.String>> getRequestedBindingSetNames()
Description copied from interface:ISqlGenerator
getRequestedBindingSetNames the requested bindingSet or bindingGroup names from the request document in the form Map.EntryThis because neither the BindingSet nor the alias need to be unique really - Specified by:
getRequestedBindingSetNames
in interfaceISqlGenerator
- Returns:
-
getMaxRows
public int getMaxRows()
Description copied from interface:ISqlGenerator
getMaxRows- Specified by:
getMaxRows
in interfaceISqlGenerator
- Returns:
- the max rows from the request document and server side settings, -1 if no limit
-
getClientProvidedMaxRows
public int getClientProvidedMaxRows()
Description copied from interface:ISqlGenerator
getQueryMaxRows- Specified by:
getClientProvidedMaxRows
in interfaceISqlGenerator
- Returns:
- max rows purely driven by the query, ignoring other limits
-
getSelectStatement
public SQLStatementWithParams getSelectStatement()
- Specified by:
getSelectStatement
in interfaceISqlGenerator
- Returns:
- the selectStatement
-
isEmpty
public boolean isEmpty()
Description copied from interface:ISqlGenerator
isEmpty- Specified by:
isEmpty
in interfaceISqlGenerator
- Returns:
- true if no query was specified from the request
-
-