org.springframework.jdbc.support.incrementer

Class AbstractDataFieldMaxValueIncrementer

  • java.lang.Object
    • org.springframework.jdbc.support.incrementer.AbstractDataFieldMaxValueIncrementer
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      protected int paddingLength
      The length to which a string result should be pre-pended with zeroes.
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method and Description
      void afterPropertiesSet()
      Invoked by the containing BeanFactory after it has set all bean properties and satisfied BeanFactoryAware, ApplicationContextAware etc.
      javax.sql.DataSource getDataSource()
      Return the data source to retrieve the value from.
      java.lang.String getIncrementerName()
      Return the name of the sequence/table.
      protected abstract long getNextKey()
      Determine the next key to use, as a long.
      int getPaddingLength()
      Return the padding length for String values.
      int nextIntValue()
      Increment the data store field's max value as int.
      long nextLongValue()
      Increment the data store field's max value as long.
      java.lang.String nextStringValue()
      Increment the data store field's max value as String.
      void setDataSource(javax.sql.DataSource dataSource)
      Set the data source to retrieve the value from.
      void setIncrementerName(java.lang.String incrementerName)
      Set the name of the sequence/table.
      void setPaddingLength(int paddingLength)
      Set the padding length, i.e.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • paddingLength

        protected int paddingLength
        The length to which a string result should be pre-pended with zeroes.
    • Constructor Detail

      • AbstractDataFieldMaxValueIncrementer

        public AbstractDataFieldMaxValueIncrementer(javax.sql.DataSource dataSource,
                                                    java.lang.String incrementerName)
        Convenience constructor.
        Parameters:
        dataSource - the DataSource to use
        incrementerName - the name of the sequence/table to use
    • Method Detail

      • setDataSource

        public void setDataSource(javax.sql.DataSource dataSource)
        Set the data source to retrieve the value from.
      • getDataSource

        public javax.sql.DataSource getDataSource()
        Return the data source to retrieve the value from.
      • setIncrementerName

        public void setIncrementerName(java.lang.String incrementerName)
        Set the name of the sequence/table.
      • getIncrementerName

        public java.lang.String getIncrementerName()
        Return the name of the sequence/table.
      • setPaddingLength

        public void setPaddingLength(int paddingLength)
        Set the padding length, i.e. the length to which a string result should be pre-pended with zeroes.
      • getPaddingLength

        public int getPaddingLength()
        Return the padding length for String values.
      • afterPropertiesSet

        public void afterPropertiesSet()
        Description copied from interface: InitializingBean
        Invoked by the containing BeanFactory after it has set all bean properties and satisfied BeanFactoryAware, ApplicationContextAware etc.

        This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.

        Specified by:
        afterPropertiesSet in interface InitializingBean
      • getNextKey

        protected abstract long getNextKey()
        Determine the next key to use, as a long.
        Returns:
        the key to use as a long. It will eventually be converted later in another format by the public concrete methods of this class.