Class DefaultSerialNumberDAO
- java.lang.Object
-
- de.hybris.platform.persistence.numberseries.DefaultSerialNumberDAO
-
- All Implemented Interfaces:
SerialNumberDAO
public class DefaultSerialNumberDAO extends java.lang.Object implements SerialNumberDAO
Default persistence implementation ofSerialNumberDAO. Use existing number series tables. Please make sure to callinitPersistence()once at each tenant start. This will initialize database tables and patch old number series data if necessary.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCONFIG_PARAM_MAX_RETRIESstatic java.lang.StringCONFIG_PARAM_SYNCHRONIZE_NUMBERGENERATION
-
Constructor Summary
Constructors Constructor Description DefaultSerialNumberDAO(Tenant t, HybrisDataSource initDataSource)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidalterSeriesTable(java.sql.Connection conn, DeploymentImpl deployments, ItemDeployment depl, de.hybris.platform.persistence.numberseries.DefaultSerialNumberDAO.TableInfo info)protected java.lang.StringcalculateTableName(HybrisDataSource ds)voidcreateSeries(java.lang.String key, int type, long startValue)Deprecated.since agesvoidcreateSeries(java.lang.String key, int type, long startValue, java.lang.String template)protected voidcreateSeriesTable(java.sql.Connection conn, DeploymentImpl deployments, ItemDeployment depl)NumberSeriesfetchUniqueRange(java.lang.String key, int count)java.util.Collection<NumberSeries>getAllCurrent()protected java.sql.ConnectiongetConnection(HybrisDataSource ds)NumberSeriesgetCurrent(java.lang.String key)protected HybrisDataSourcegetDataSource()protected de.hybris.platform.persistence.numberseries.DefaultSerialNumberDAO.TableInfogetTableInfo(java.sql.Connection conn, java.lang.String expectedName)voidinitPersistence()protected voidinitTable(java.sql.Connection conn, DeploymentImpl deployments, ItemDeployment depl, de.hybris.platform.persistence.numberseries.DefaultSerialNumberDAO.TableInfo info)protected booleanisOldNumerMigrationRequired(de.hybris.platform.persistence.numberseries.DefaultSerialNumberDAO.TableInfo info)protected booleanisSchemaInitOrUpdateRequired(de.hybris.platform.persistence.numberseries.DefaultSerialNumberDAO.TableInfo info)voidremoveSeries(java.lang.String key)voidresetSeries(java.lang.String key, int type, long startValue)protected voidtryToClose(java.sql.Connection connection, java.sql.Statement statement, java.sql.ResultSet resultSet)protected voidtryToClose(java.sql.Statement statement, java.sql.ResultSet resultSet)
-
-
-
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
-
DefaultSerialNumberDAO
public DefaultSerialNumberDAO(Tenant t, HybrisDataSource initDataSource)
-
-
Method Detail
-
calculateTableName
protected java.lang.String calculateTableName(HybrisDataSource ds)
-
getDataSource
protected HybrisDataSource getDataSource()
-
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:
createSeriesin interfaceSerialNumberDAO
-
createSeries
@Deprecated public void createSeries(java.lang.String key, int type, long startValue)Deprecated.since ages- Specified by:
createSeriesin interfaceSerialNumberDAO
-
fetchUniqueRange
public NumberSeries fetchUniqueRange(java.lang.String key, int count)
- Specified by:
fetchUniqueRangein interfaceSerialNumberDAO
-
removeSeries
public void removeSeries(java.lang.String key)
- Specified by:
removeSeriesin interfaceSerialNumberDAO
-
resetSeries
public void resetSeries(java.lang.String key, int type, long startValue)- Specified by:
resetSeriesin interfaceSerialNumberDAO
-
getCurrent
public NumberSeries getCurrent(java.lang.String key)
- Specified by:
getCurrentin interfaceSerialNumberDAO
-
getAllCurrent
public java.util.Collection<NumberSeries> getAllCurrent()
- Specified by:
getAllCurrentin interfaceSerialNumberDAO
-
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)
-
createSeriesTable
protected void createSeriesTable(java.sql.Connection conn, DeploymentImpl deployments, ItemDeployment depl)
-
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)
-
-