Skip navigation links
org.spincast.plugins.jdbc.statements

Class StatementBase

    • Method Detail

      • sql

        public void sql(String sql)
        Description copied from interface: Statement
        Appends some SQL to the query to launch. If you want to restart the query from scratch, you need to call Statement.clearSql() first!
        Specified by:
        sql in interface Statement
      • clearSql

        public void clearSql()
        Description copied from interface: Statement
        Clears the current SQL query being built. Also removes any bound parameters.
        Specified by:
        clearSql in interface Statement
      • clearSql

        public void clearSql(boolean keepCurrentBoundParams)
        Description copied from interface: Statement
        Clears the current SQL query being built.
        Specified by:
        clearSql in interface Statement
        Parameters:
        keepCurrentBoundParams - if true, the currently bound parameters won't be cleared, only the query.
      • getSql

        public String getSql(boolean friendly)
        Description copied from interface: Statement
        Returns the current SQL query.
        Specified by:
        getSql in interface Statement
      • getOriginalQuery

        protected String getOriginalQuery()
      • getParsedQuery

        protected String getParsedQuery()
      • setStaticTokens

        protected void setStaticTokens(Map<String,String> tokens)
      • copyParamsAndStaticTokensTo

        protected void copyParamsAndStaticTokensTo(Statement newStm)
      • parse

        protected String parse()
      • clearParams

        protected void clearParams()
      • getConnection

        protected Connection getConnection()
      • addCurrentParamsToStatement

        protected void addCurrentParamsToStatement(PreparedStatement statement)
      • close

        protected void close(PreparedStatement statement)
        Closes statement quietly
      • close

        protected void close(ResultSet resultSet)
        Closes resultSet quietly
      • addParam

        public void addParam(String paramName,
                             Object value)
      • setInLong

        public void setInLong(String paramName,
                              Set<Long> items)
        Description copied from interface: Statement
        Explodes a collection of Long and replaces the specified param with them, so it can be used inside a IN(:ids) section
        Specified by:
        setInLong in interface Statement
      • setInInteger

        public void setInInteger(String paramName,
                                 Set<Integer> items)
        Description copied from interface: Statement
        Explodes a collection of Integer and replaces the specified param with them, so it can be used inside a IN(:ids) section
        Specified by:
        setInInteger in interface Statement
      • setInString

        public void setInString(String paramName,
                                Set<String> items)
        Description copied from interface: Statement
        Explodes a collection of String and replaces the specified param with them, so it can be used inside a IN(:ids) section.
        Specified by:
        setInString in interface Statement
      • setInStringFromEnumNames

        public void setInStringFromEnumNames(String paramName,
                                             Set<? extends Enum<?>> enumItems)
        Description copied from interface: Statement
        Explodes a collection of enum names and replaces the specified param with them, so it can be used inside a IN(:ids) section.
        Specified by:
        setInStringFromEnumNames in interface Statement

Copyright © 2018. All rights reserved.