Class DefaultOrmUpdate<T>

    • Constructor Detail

    • Method Detail

      • setTimeout

        public DefaultOrmUpdate<TsetTimeout​(int secs)
        Description copied from interface: Update
        Set a timeout for statement execution.

        This will typically result in a call to setQueryTimeout() on a preparedStatement. If the timeout occurs an exception will be thrown - this will be a SQLException wrapped up in a PersistenceException.

        Specified by:
        setTimeout in interface Update<T>
        Parameters:
        secs - the timeout in seconds. Zero implies unlimited.
      • execute

        public int execute()
        Description copied from interface: Update
        Execute the statement returning the number of rows modified.
        Specified by:
        execute in interface Update<T>
      • setNotifyCache

        public DefaultOrmUpdate<TsetNotifyCache​(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 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()
        Description copied from interface: Update
        Return the name if it is a named update.
        Specified by:
        getName in interface Update<T>
      • setLabel

        public Update<TsetLabel​(String label)
        Description copied from interface: Update
        Set a label meaning performance metrics will be collected for the execution of this update.
        Specified by:
        setLabel in interface Update<T>
      • set

        public DefaultOrmUpdate<Tset​(int position,
                                       Object value)
        Description copied from interface: Update
        Set an ordered bind parameter.

        position starts at value 1 (not 0) to be consistent with PreparedStatement.

        Set a value for each ? you have in the sql.

        Specified by:
        set in interface Update<T>
        Parameters:
        position - the index position of the parameter starting with 1.
        value - the parameter value to bind.
      • setParameter

        public DefaultOrmUpdate<TsetParameter​(int position,
                                                Object value)
        Description copied from interface: Update
        Set and ordered bind parameter (same as bind).
        Specified by:
        setParameter in interface Update<T>
        Parameters:
        position - the index position of the parameter starting with 1.
        value - the parameter value to bind.
      • setNull

        public DefaultOrmUpdate<TsetNull​(int position,
                                           int jdbcType)
        Description copied from interface: Update
        Set an ordered parameter that is null. The JDBC type of the null must be specified.

        position starts at value 1 (not 0) to be consistent with PreparedStatement.

        Specified by:
        setNull in interface Update<T>
      • set

        public DefaultOrmUpdate<Tset​(String name,
                                       Object value)
        Description copied from interface: Update
        Set a named parameter. Named parameters have a colon to prefix the name.

        A more succinct version of setParameter() to be consistent with Query.

        Specified by:
        set in interface Update<T>
        Parameters:
        name - the parameter name.
        value - the parameter value.
      • setNull

        public DefaultOrmUpdate<TsetNull​(String name,
                                           int jdbcType)
        Description copied from interface: Update
        Set a named parameter that is null. The JDBC type of the null must be specified.

        A more succinct version of setNullParameter().

        Specified by:
        setNull in interface Update<T>
        Parameters:
        name - the parameter name.
        jdbcType - the type of the property being bound.