Class 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 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
      • parameters

        protected java.util.List<org.w3c.dom.Element> parameters
    • Constructor Detail

      • AbstractSqlGenerator

        public AbstractSqlGenerator()
    • 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 interface ISqlGenerator
        Returns:
        the database name configured for this request or null for default
      • getSelectedBindingItems

        public java.util.List<WrsBindingItem> getSelectedBindingItems()
                                                               throws java.lang.Exception
        Specified by:
        getSelectedBindingItems in interface ISqlGenerator
        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.Entry This because neither the BindingSet nor the alias need to be unique really
        Specified by:
        getRequestedBindingSetNames in interface ISqlGenerator
        Returns:
      • getMaxRows

        public int getMaxRows()
        Description copied from interface: ISqlGenerator
        getMaxRows
        Specified by:
        getMaxRows in interface ISqlGenerator
        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 interface ISqlGenerator
        Returns:
        max rows purely driven by the query, ignoring other limits
      • isEmpty

        public boolean isEmpty()
        Description copied from interface: ISqlGenerator
        isEmpty
        Specified by:
        isEmpty in interface ISqlGenerator
        Returns:
        true if no query was specified from the request