public class MultipleSequenceDao extends Object
Constructor and Description |
---|
MultipleSequenceDao() |
Modifier and Type | Method and Description |
---|---|
Boolean |
getAdjust()
Getter method for property adjust.
|
Map<String,Map<String,Object>> |
getAllSequenceNameRecord()
获取所有的sequence记录
|
List<SequenceDataSourceHolder> |
getDataSourceList()
Getter method for property dataSourceList.
|
DataSourceSelector |
getDataSourceSelector() |
String |
getGmtCreateColumnName()
Getter method for property gmtCreateColumnName.
|
String |
getGmtModifiedColumnName()
Getter method for property gmtModifiedColumnName.
|
String |
getInnerStepColumnName()
Getter method for property innerStepColumnName.
|
String |
getMaxValueColumnName()
Getter method for property maxValueColumnName.
|
String |
getMinValueColumnName()
Getter method for property minValueColumnName.
|
String |
getNameColumnName()
Getter method for property nameColumnName.
|
int |
getRetryTimes()
Getter method for property retryTimes.
|
String |
getSelectAllRecord()
格式:select name,value,min_value,max_value,step from table_name(default:sequence)
|
Map<String,Map<String,Object>> |
getSequenceRecordByName(String sequenceName)
根据sequenceName来获取一条记录,便于查询sequence当期的区段.
|
String |
getSequenceRecordSql()
格式:select value,min_value,max_value,step from sequence where name=?
|
String |
getTableName()
Getter method for property tableName.
|
String |
getValueColumnName()
Getter method for property valueColumnName.
|
void |
init()
初始化multiSequenceDao
1)获取数据源的个数;2)生成随机对象; 3)初始化各个数据源包装器的sql等参数 |
void |
initSequenceRecord(String sequenceName,
long minValue,
long maxValue,
int innerStep)
初始化sequence的初始值,每个数据源都要去检查一遍,如果不存在就插入一条记录
|
SequenceRange |
nextRange(String sequenceName,
long minValue,
long maxValue,
int innerStep)
获取下一个sequence 段
|
void |
setAdjust(Boolean adjust)
Setter method for property adjust.
|
void |
setDataSourceList(List<DataSource> dataSourceList)
Setter method for property dataSourceList.
|
void |
setDataSourceSelector(DataSourceSelector dataSourceSelector) |
void |
setGmtCreateColumnName(String gmtCreateColumnName)
Setter method for property gmtCreateColumnName.
|
void |
setGmtModifiedColumnName(String gmtModifiedColumnName)
Setter method for property gmtModifiedColumnName.
|
void |
setInnerStepColumnName(String innerStepColumnName)
Setter method for property innerStepColumnName.
|
void |
setMaxValueColumnName(String maxValueColumnName)
Setter method for property maxValueColumnName.
|
void |
setMinValueColumnName(String minValueColumnName)
Setter method for property minValueColumnName.
|
void |
setNameColumnName(String nameColumnName)
Setter method for property nameColumnName.
|
void |
setRetryTimes(int retryTimes)
Setter method for property retryTimes.
|
void |
setTableName(String tableName)
Setter method for property tableName.
|
void |
setValueColumnName(String valueColumnName)
Setter method for property valueColumnName.
|
public void init()
SequenceException
public void initSequenceRecord(String sequenceName, long minValue, long maxValue, int innerStep) throws SequenceException
sequenceName
- sequence名称SequenceException
public Map<String,Map<String,Object>> getAllSequenceNameRecord() throws SQLException
SQLException
public Map<String,Map<String,Object>> getSequenceRecordByName(String sequenceName) throws SQLException, SequenceException
SQLException
SequenceException
public SequenceRange nextRange(String sequenceName, long minValue, long maxValue, int innerStep) throws SequenceException
sequenceName
- sequence名称SequenceException
public String getSequenceRecordSql()
public int getRetryTimes()
public void setRetryTimes(int retryTimes)
retryTimes
- value to be assigned to property retryTimespublic List<SequenceDataSourceHolder> getDataSourceList()
public void setDataSourceList(List<DataSource> dataSourceList)
dataSourceList
- value to be assigned to property dataSourceListpublic String getSelectAllRecord()
public String getTableName()
public void setTableName(String tableName)
tableName
- value to be assigned to property tableNamepublic String getNameColumnName()
public void setNameColumnName(String nameColumnName)
nameColumnName
- value to be assigned to property nameColumnNamepublic String getValueColumnName()
public void setValueColumnName(String valueColumnName)
valueColumnName
- value to be assigned to property valueColumnNamepublic String getGmtModifiedColumnName()
public void setGmtModifiedColumnName(String gmtModifiedColumnName)
gmtModifiedColumnName
- value to be assigned to property gmtModifiedColumnNamepublic Boolean getAdjust()
public void setAdjust(Boolean adjust)
adjust
- value to be assigned to property adjustpublic String getGmtCreateColumnName()
public void setGmtCreateColumnName(String gmtCreateColumnName)
gmtCreateColumnName
- value to be assigned to property gmtCreateColumnNamepublic String getMinValueColumnName()
public void setMinValueColumnName(String minValueColumnName)
minValueColumnName
- value to be assigned to property minValueColumnNamepublic String getMaxValueColumnName()
public void setMaxValueColumnName(String maxValueColumnName)
maxValueColumnName
- value to be assigned to property maxValueColumnNamepublic String getInnerStepColumnName()
public void setInnerStepColumnName(String innerStepColumnName)
innerStepColumnName
- value to be assigned to property innerStepColumnNamepublic DataSourceSelector getDataSourceSelector()
public void setDataSourceSelector(DataSourceSelector dataSourceSelector)
Copyright © 2006–2018 TinyGroup. All rights reserved.