Class RDBMSStringLengthFunction

java.lang.Object
com.kingsrook.qqq.backend.module.rdbms.fieldfunctions.RDBMSStringLengthFunction
All Implemented Interfaces:
BackendFieldFunctionAdapterInterface, RDBMSFieldFunctionAdapterInterface, Serializable

public class RDBMSStringLengthFunction extends Object implements RDBMSFieldFunctionAdapterInterface
RDBMS adapter for the StringLengthFunction that generates a CHAR_LENGTH(col) SQL expression.
See Also:
  • Constructor Details

    • RDBMSStringLengthFunction

      public RDBMSStringLengthFunction()
  • Method Details

    • wrapColumnName

      public String wrapColumnName(String escapedColumnName, FieldFunction fieldFunction, Function<String,String> fieldNameToColumnReference)
      Returns a CHAR_LENGTH(col) SQL expression for the given escaped column name.
      Specified by:
      wrapColumnName in interface RDBMSFieldFunctionAdapterInterface
      Parameters:
      escapedColumnName - a fully qualified and escaped SQL column name for the 'main' field that this function works with (e.g., FieldFunction#withFieldName(String). Looks like: `my_table`.`my_field`.
      fieldFunction - the function with arguments, being used.
      fieldNameToColumnReference - resolves a QQQ field name to its fully- qualified escaped SQL column reference (e.g., "timeZone"`t1`.`time_zone`). Useful when the function expression needs to reference additional columns on the same row.