Class UpsertClause

    • Constructor Detail

      • UpsertClause

        public UpsertClause()
    • Method Detail

      • upsert

        public static UpsertClause upsert()
        Creates a new Upsert clause
        Returns:
        the upsert clause
      • upsert

        public static UpsertClause upsert​(@NonNull
                                          @NonNull String... columns)
        Creates a new Upsert clause with given columns as the keys (indexed columns)
        Parameters:
        columns - the key (index) columns
        Returns:
        this upsert clause
      • upsert

        public static UpsertClause upsert​(@NonNull
                                          @NonNull SQLElement... columns)
        Creates a new Upsert clause with given columns as the keys (indexed columns)
        Parameters:
        columns - the key (index) columns
        Returns:
        this upsert clause
      • action

        public UpsertClause action​(@NonNull
                                   @NonNull UpsertAction action)
        The action to perform on upsert
        Parameters:
        action - the action to perform on upsert
        Returns:
        this upsert clause
      • doNothing

        public UpsertClause doNothing()
        Do nothing on upsert
        Returns:
        this upsert clause
      • doUpdateSet

        public UpsertClause doUpdateSet()
        Perform an update on upsert
        Returns:
        this upsert clause
      • indexedColumns

        public UpsertClause indexedColumns​(@NonNull
                                           @NonNull String... columns)
        Sets the columns that specifies the keys (indexed columns) for the upsert
        Parameters:
        columns - the key (index) columns
        Returns:
        this upsert clause
      • indexedColumns

        public UpsertClause indexedColumns​(@NonNull
                                           @NonNull SQLElement... columns)
        Sets the columns that specifies the keys (indexed columns) for the upsert
        Parameters:
        columns - the key (index) columns
        Returns:
        this upsert clause
      • indexedColumns

        public UpsertClause indexedColumns​(@NonNull
                                           @NonNull Collection<? extends SQLElement> columns)
        Sets the columns that specifies the keys (indexed columns) for the upsert
        Parameters:
        columns - the key (index) columns
        Returns:
        this upsert clause
      • indexedParameters

        public UpsertClause indexedParameters()
        Indexed parameters upsert clause.
        Returns:
        this upsert clause
      • indexedWhere

        public UpsertClause indexedWhere​(String whereClause)
        Sets the criteria (i.e. WHERE) for the UpsertClause.
        Parameters:
        whereClause - the where clause
        Returns:
        this UpsertClause object
      • indexedWhere

        public UpsertClause indexedWhere​(SQLElement whereClause)
        Sets the criteria (i.e. WHERE) for the UpsertClause.
        Parameters:
        whereClause - the where clause
        Returns:
        this UpsertClause object
      • set

        public UpsertClause set​(@NonNull
                                @NonNull SQLElement column,
                                @NonNull
                                @NonNull SQLElement value)
        Adds a set parameter to the update defined as a column and value.
        Parameters:
        column - the column to update
        value - the value to update the column to
        Returns:
        this UpsertClause statement
      • set

        public UpsertClause set​(@NonNull
                                @NonNull String column,
                                @NonNull
                                @NonNull SQLElement value)
        Adds a set parameter to the update defined as a column and value.
        Parameters:
        column - the column to update
        value - the value to update the column to
        Returns:
        this UpsertClause statement
      • setIndexedParameter

        public UpsertClause setIndexedParameter​(@NonNull
                                                @NonNull SQLElement column)
        Adds a set parameter for the given column and using an indexed parameter value for use in PreparedStatement
        Parameters:
        column - the column to update
        Returns:
        this UpsertClause statement
      • setNamedParameter

        public UpsertClause setNamedParameter​(@NonNull
                                              @NonNull SQLElement column)
        Adds a set parameter for the given column and using a named parameter value for use in NamedPreparedStatement
        Parameters:
        column - the column to update
        Returns:
        this UpsertClause statement
      • updateWhere

        public UpsertClause updateWhere​(String whereClause)
        Sets the criteria (i.e. WHERE) for the UpsertClause.
        Parameters:
        whereClause - the where clause
        Returns:
        this UpsertClause object
      • updateWhere

        public UpsertClause updateWhere​(SQLElement whereClause)
        Sets the criteria (i.e. WHERE) for the UpsertClause.
        Parameters:
        whereClause - the where clause
        Returns:
        this UpsertClause object