Class DefaultOrmUpdate<T>

java.lang.Object
io.ebeaninternal.server.querydefn.DefaultOrmUpdate<T>
All Implemented Interfaces:
io.ebean.Update<T>, SpiUpdate<T>, Serializable

public final class DefaultOrmUpdate<T> extends Object implements SpiUpdate<T>, Serializable
Default implementation of OrmUpdate.
See Also:
  • Constructor Details

    • DefaultOrmUpdate

      public DefaultOrmUpdate(Class<?> beanType, io.ebean.Database server, String baseTable, String updateStatement)
      Create with a specific server. This means you can use the UpdateSql.execute() method.
  • Method Details

    • setTimeout

      public DefaultOrmUpdate<T> setTimeout(int secs)
      Specified by:
      setTimeout in interface io.ebean.Update<T>
    • beanType

      public Class<?> beanType()
      Description copied from interface: SpiUpdate
      Return the type of bean being updated.
      Specified by:
      beanType in interface SpiUpdate<T>
    • timeout

      public int timeout()
      Return the timeout in seconds.
      Specified by:
      timeout in interface SpiUpdate<T>
    • execute

      public int execute()
      Specified by:
      execute in interface io.ebean.Update<T>
    • setNotifyCache

      public DefaultOrmUpdate<T> setNotifyCache(boolean notifyCache)
      Set this to false if you don't want eBean to automatically deduce the table modification information and process it.

      Set this to false if you don't want any cache invalidation or text index management to occur. You may do this when say you update only one column and you know that it is not important for cached objects or text indexes.

      Specified by:
      setNotifyCache in interface io.ebean.Update<T>
    • isNotifyCache

      public boolean isNotifyCache()
      Return true if the cache should be notified so that invalidates appropriate objects.
      Specified by:
      isNotifyCache in interface SpiUpdate<T>
    • getName

      public String getName()
      Specified by:
      getName in interface io.ebean.Update<T>
    • setLabel

      public io.ebean.Update<T> setLabel(String label)
      Specified by:
      setLabel in interface io.ebean.Update<T>
    • label

      public String label()
      Description copied from interface: SpiUpdate
      Return the label (for metrics collection).
      Specified by:
      label in interface SpiUpdate<T>
    • updateStatement

      public String updateStatement()
      Description copied from interface: SpiUpdate
      Return the update statement. This could be either sql or an orm update with bean types and property names.
      Specified by:
      updateStatement in interface SpiUpdate<T>
    • set

      public DefaultOrmUpdate<T> set(int position, Object value)
      Specified by:
      set in interface io.ebean.Update<T>
    • setParameter

      public DefaultOrmUpdate<T> setParameter(int position, Object value)
      Specified by:
      setParameter in interface io.ebean.Update<T>
    • setNull

      public DefaultOrmUpdate<T> setNull(int position, int jdbcType)
      Specified by:
      setNull in interface io.ebean.Update<T>
    • setNullParameter

      public DefaultOrmUpdate<T> setNullParameter(int position, int jdbcType)
      Specified by:
      setNullParameter in interface io.ebean.Update<T>
    • set

      public DefaultOrmUpdate<T> set(String name, Object value)
      Specified by:
      set in interface io.ebean.Update<T>
    • setParameter

      public DefaultOrmUpdate<T> setParameter(String name, Object param)
      Specified by:
      setParameter in interface io.ebean.Update<T>
    • setNull

      public DefaultOrmUpdate<T> setNull(String name, int jdbcType)
      Specified by:
      setNull in interface io.ebean.Update<T>
    • setNullParameter

      public DefaultOrmUpdate<T> setNullParameter(String name, int jdbcType)
      Specified by:
      setNullParameter in interface io.ebean.Update<T>
    • bindParams

      public BindParams bindParams()
      Return the bind parameters.
      Specified by:
      bindParams in interface SpiUpdate<T>
    • getGeneratedSql

      public String getGeneratedSql()
      Specified by:
      getGeneratedSql in interface io.ebean.Update<T>
    • setGeneratedSql

      public void setGeneratedSql(String generatedSql)
      Description copied from interface: SpiUpdate
      Set the generated sql used.
      Specified by:
      setGeneratedSql in interface SpiUpdate<T>
    • baseTable

      public String baseTable()
      Description copied from interface: SpiUpdate
      Return the name of the table being modified.
      Specified by:
      baseTable in interface SpiUpdate<T>
    • ormUpdateType

      public SpiUpdate.OrmUpdateType ormUpdateType()
      Description copied from interface: SpiUpdate
      Return the type of this - insert, update or delete.
      Specified by:
      ormUpdateType in interface SpiUpdate<T>