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.String
CONFIG_PARAM_MAX_RETRIES
static java.lang.String
CONFIG_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 void
alterSeriesTable(java.sql.Connection conn, DeploymentImpl deployments, ItemDeployment depl, de.hybris.platform.persistence.numberseries.DefaultSerialNumberDAO.TableInfo info)
protected java.lang.String
calculateTableName(HybrisDataSource ds)
void
createSeries(java.lang.String key, int type, long startValue)
Deprecated.since agesvoid
createSeries(java.lang.String key, int type, long startValue, java.lang.String template)
protected void
createSeriesTable(java.sql.Connection conn, DeploymentImpl deployments, ItemDeployment depl)
NumberSeries
fetchUniqueRange(java.lang.String key, int count)
java.util.Collection<NumberSeries>
getAllCurrent()
protected java.sql.Connection
getConnection(HybrisDataSource ds)
NumberSeries
getCurrent(java.lang.String key)
protected HybrisDataSource
getDataSource()
protected de.hybris.platform.persistence.numberseries.DefaultSerialNumberDAO.TableInfo
getTableInfo(java.sql.Connection conn, java.lang.String expectedName)
void
initPersistence()
protected void
initTable(java.sql.Connection conn, DeploymentImpl deployments, ItemDeployment depl, de.hybris.platform.persistence.numberseries.DefaultSerialNumberDAO.TableInfo info)
protected boolean
isOldNumerMigrationRequired(de.hybris.platform.persistence.numberseries.DefaultSerialNumberDAO.TableInfo info)
protected boolean
isSchemaInitOrUpdateRequired(de.hybris.platform.persistence.numberseries.DefaultSerialNumberDAO.TableInfo info)
void
removeSeries(java.lang.String key)
void
resetSeries(java.lang.String key, int type, long startValue)
protected void
tryToClose(java.sql.Connection connection, java.sql.Statement statement, java.sql.ResultSet resultSet)
protected void
tryToClose(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:
createSeries
in interfaceSerialNumberDAO
-
createSeries
@Deprecated public void createSeries(java.lang.String key, int type, long startValue)
Deprecated.since ages- Specified by:
createSeries
in interfaceSerialNumberDAO
-
fetchUniqueRange
public NumberSeries fetchUniqueRange(java.lang.String key, int count)
- Specified by:
fetchUniqueRange
in interfaceSerialNumberDAO
-
removeSeries
public void removeSeries(java.lang.String key)
- Specified by:
removeSeries
in interfaceSerialNumberDAO
-
resetSeries
public void resetSeries(java.lang.String key, int type, long startValue)
- Specified by:
resetSeries
in interfaceSerialNumberDAO
-
getCurrent
public NumberSeries getCurrent(java.lang.String key)
- Specified by:
getCurrent
in interfaceSerialNumberDAO
-
getAllCurrent
public java.util.Collection<NumberSeries> getAllCurrent()
- Specified by:
getAllCurrent
in 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)
-
-