Class DefaultSerialNumberDAO

  • All Implemented Interfaces:
    SerialNumberDAO

    public class DefaultSerialNumberDAO
    extends java.lang.Object
    implements SerialNumberDAO
    Default persistence implementation of SerialNumberDAO. Use existing number series tables. Please make sure to call initPersistence() once at each tenant start. This will initialize database tables and patch old number series data if necessary.
    • Field Detail

      • CONFIG_PARAM_SYNCHRONIZE_NUMBERGENERATION

        public static final java.lang.String CONFIG_PARAM_SYNCHRONIZE_NUMBERGENERATION
        See Also:
        Constant Field Values
      • CONFIG_PARAM_MAX_RETRIES

        public static final java.lang.String CONFIG_PARAM_MAX_RETRIES
        See Also:
        Constant Field Values
    • Constructor Detail

    • Method Detail

      • calculateTableName

        protected java.lang.String calculateTableName​(HybrisDataSource ds)
      • getConnection

        protected java.sql.Connection getConnection​(HybrisDataSource ds)
                                             throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • createSeries

        public void createSeries​(java.lang.String key,
                                 int type,
                                 long startValue,
                                 java.lang.String template)
        Specified by:
        createSeries in interface SerialNumberDAO
      • createSeries

        @Deprecated
        public void createSeries​(java.lang.String key,
                                 int type,
                                 long startValue)
        Deprecated.
        since ages
        Specified by:
        createSeries in interface SerialNumberDAO
      • resetSeries

        public void resetSeries​(java.lang.String key,
                                int type,
                                long startValue)
        Specified by:
        resetSeries in interface SerialNumberDAO
      • initPersistence

        public void initPersistence()
      • isOldNumerMigrationRequired

        protected boolean isOldNumerMigrationRequired​(de.hybris.platform.persistence.numberseries.DefaultSerialNumberDAO.TableInfo info)
      • isSchemaInitOrUpdateRequired

        protected boolean isSchemaInitOrUpdateRequired​(de.hybris.platform.persistence.numberseries.DefaultSerialNumberDAO.TableInfo info)
      • initTable

        protected void initTable​(java.sql.Connection conn,
                                 DeploymentImpl deployments,
                                 ItemDeployment depl,
                                 de.hybris.platform.persistence.numberseries.DefaultSerialNumberDAO.TableInfo info)
      • alterSeriesTable

        protected void alterSeriesTable​(java.sql.Connection conn,
                                        DeploymentImpl deployments,
                                        ItemDeployment depl,
                                        de.hybris.platform.persistence.numberseries.DefaultSerialNumberDAO.TableInfo info)
      • tryToClose

        protected void tryToClose​(java.sql.Statement statement,
                                  java.sql.ResultSet resultSet)
      • tryToClose

        protected void tryToClose​(java.sql.Connection connection,
                                  java.sql.Statement statement,
                                  java.sql.ResultSet resultSet)
      • getTableInfo

        protected de.hybris.platform.persistence.numberseries.DefaultSerialNumberDAO.TableInfo getTableInfo​(java.sql.Connection conn,
                                                                                                            java.lang.String expectedName)