Class RDBMSSubStringFunction
java.lang.Object
com.kingsrook.qqq.backend.module.rdbms.fieldfunctions.RDBMSSubStringFunction
- All Implemented Interfaces:
BackendFieldFunctionAdapterInterface,RDBMSFieldFunctionAdapterInterface,Serializable
RDBMS adapter for the
SubStringFunction that generates SQL
SUBSTRING(col FROM ? [FOR ?]) expressions.
The fromIndex bind parameter is always supplied; the length bind parameter
is included only when the length argument is provided.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetParams(FieldFunction fieldFunction) Returns the SQL bind parameters for the SUBSTRING expression: [fromIndex] or [fromIndex, length] depending on whether length was specified.wrapColumnName(String escapedColumnName, FieldFunction fieldFunction, Function<String, String> fieldNameToColumnReference) Returns a SUBSTRING SQL expression, usingFROM ?form without a length, orFROM ? FOR ?form when a length argument is present.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.kingsrook.qqq.backend.module.rdbms.fieldfunctions.RDBMSFieldFunctionAdapterInterface
wrapColumnNameForOrderBy
-
Constructor Details
-
RDBMSSubStringFunction
public RDBMSSubStringFunction()
-
-
Method Details
-
wrapColumnName
public String wrapColumnName(String escapedColumnName, FieldFunction fieldFunction, Function<String, String> fieldNameToColumnReference) Returns a SUBSTRING SQL expression, usingFROM ?form without a length, orFROM ? FOR ?form when a length argument is present.- Specified by:
wrapColumnNamein interfaceRDBMSFieldFunctionAdapterInterface- 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.
-
getParams
Returns the SQL bind parameters for the SUBSTRING expression: [fromIndex] or [fromIndex, length] depending on whether length was specified.- Specified by:
getParamsin interfaceRDBMSFieldFunctionAdapterInterface
-