Class ParsedSql.Builder

  • Enclosing class:
    ParsedSql

    public static class ParsedSql.Builder
    extends java.lang.Object
    Fluent builder for ParsedSql instances.
    • Field Detail

      • sql

        private final java.lang.StringBuilder sql
      • positional

        private boolean positional
      • named

        private boolean named
      • parameterNames

        private final java.util.List<java.lang.String> parameterNames
    • Constructor Detail

      • Builder

        private Builder()
    • Method Detail

      • append

        public ParsedSql.Builder append​(java.lang.String sqlFragment)
        Appends the given SQL fragment to the SQL string.
        Parameters:
        sqlFragment - the SQL fragment
        Returns:
        this
      • appendPositionalParameter

        public ParsedSql.Builder appendPositionalParameter()
        Records a positional parameters, and appends a ? to the SQL string.
        Returns:
        this
      • appendNamedParameter

        public ParsedSql.Builder appendNamedParameter​(java.lang.String name)
        Records a named parameter with the given name, and appends a ? to the SQL string.
        Parameters:
        name - the parameter name.
        Returns:
        this