java.lang.Object
io.clonecloudstore.common.database.utils.DbUpdate

public class DbUpdate extends Object
DbUpdate (Update command) for both SQL and NoSQL. A DbUpdate is not ready to use as is. It must be used through PostgreSqlHelper or MongoSqlHelper or natively using Repository.
  • Constructor Details

    • DbUpdate

      public DbUpdate()
  • Method Details

    • set

      public DbUpdate set(String field, Object value)
      Add one value to a field Set
      Returns:
      this
    • addToSet

      public DbUpdate addToSet(String field, String value)
      Add one value to a set field (or array for Postgre)
      Returns:
      this
    • setArray

      public DbUpdate setArray(String field, String value, Collection<String> oldValues)
      Set a collection of values plus one to a field array
      Returns:
      this
    • getSqlParams

      public List<Object> getSqlParams()
      Returns:
      the Parameters (SQL) of this Update
    • getSqlQuery

      public StringBuilder getSqlQuery()
      Returns:
      the StringBuilder of this Sql Update command
    • getBson

      public org.bson.conversions.Bson getBson()
      Returns:
      the Bson form of this Update for NoSQL