Class AbstractSqlGenerator<T extends SqlStatement>

    • Constructor Detail

      • AbstractSqlGenerator

        public AbstractSqlGenerator()
    • Method Detail

      • generateStatementsIsVolatile

        public boolean generateStatementsIsVolatile​(Database database)
        Description copied from interface: SqlGenerator
        Does this change require access to the database metadata? If true, the change cannot be used in an updateSql-style command.
        Specified by:
        generateStatementsIsVolatile in interface SqlGenerator<T extends SqlStatement>
      • supports

        public boolean supports​(T statement,
                                Database database)
        Description copied from interface: SqlGenerator
        Does this generator support the given statement/database combination? Do not validate the statement with this method, only return if it can support it.
        Specified by:
        supports in interface SqlGenerator<T extends SqlStatement>
      • looksLikeFunctionCall

        public boolean looksLikeFunctionCall​(String value,
                                             Database database)
        Tries to find out if a given value (part a database-specific SQL statement) is just a simple literal (e.g. 'Jones', 149.99 or false) or if it is a call to a function within the database (e.g. TO_DATE('28.12.2017', '') in Oracle DB). This method is often used to determine if we need to quote literals which are Strings, e.g. if we determine "Dr. Jones" to be a literal, then we generate
        INSERT INTO customers(last_name) VALUES('Dr. Jones')
        but if the value is a function call, we may not quote it, e.g. for "TO_DATE('28.12.2017', '')", we need to generate (note the absence of the apostrophes!):
        INSERT INTO bookings(booking_date) VALUES (TO_DATE('28.12.2017', ''))
        value - The string to test
        database - the database object to test against
        true if value looks like a function call, false if it looks like a literal.