Class AbstractInsertValueTable<T extends AbstractInsertValueTable<T>>

  • Type Parameters:
    T - self pointer
    All Implemented Interfaces:
    Fragment
    Direct Known Subclasses:
    Insert, MergeInsertClause

    public abstract class AbstractInsertValueTable<T extends AbstractInsertValueTable<T>>
    extends AbstractFragment
    Abstract base class for SQL fragments that contain a insert value table (for example INSERT, MERGE).
    • Field Detail

      • insertValueTable

        protected ValueTable insertValueTable
        Table with values used in the INSERT statement
      • insertFields

        protected InsertFields insertFields
        Fields to insert
    • Constructor Detail

      • AbstractInsertValueTable

        protected AbstractInsertValueTable​(Fragment root)
        Create the abstract base for a fragment containing a value table.
        Parameters:
        root - root fragment
    • Method Detail

      • self

        protected abstract T self()
        Generic self pointer.
        Returns:
        self pointer.
      • createInsertValueInstanceIfItDoesNotExist

        protected void createInsertValueInstanceIfItDoesNotExist()
        Prepare the value table.
      • field

        public T field​(String... names)
        Define fields into which should be inserted.
        Parameters:
        names - field names
        Returns:
        this for fluent programming
      • valueTable

        public T valueTable​(ValueTable table)
        Insert a value table.
        Parameters:
        table - value table to be inserted
        Returns:
        this for fluent programming
      • values

        public T values​(String... values)
        Insert a list of string values.
        Parameters:
        values - string values to be inserted
        Returns:
        this for fluent programming
      • values

        public T values​(int... values)
        Insert a list of integer values.
        Parameters:
        values - integer values to be inserted
        Returns:
        this for fluent programming
      • values

        public T values​(ValueExpression... expressions)
        Insert a list of value expressions.
        Parameters:
        expressions - value expressions to be inserted
        Returns:
        this for fluent programming
      • valuePlaceholder

        public T valuePlaceholder()
        Add an unnamed value placeholder to the value list (this is useful for prepared statements).
        Returns:
        this for fluent programming
      • valuePlaceholders

        public T valuePlaceholders​(int amount)
        Add a given number unnamed value placeholder to the value list (this is useful for prepared statements).
        Parameters:
        amount - number of placeholders to be added
        Returns:
        this for fluent programming
      • hasValues

        public boolean hasValues()
        Check if a value table is present.
        Returns:
        true if a value table exists
      • hasFields

        public boolean hasFields()
        Check if a insert fields are defined.
        Returns:
        true if insert fields are defined