public final class HintManager extends Object implements AutoCloseable
ThreadLocal.| 构造器和说明 |
|---|
HintManager() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addDatabaseShardingValue(String logicTable,
Comparable<?> value)
Add sharding value for database.
|
void |
addTableShardingValue(String logicTable,
Comparable<?> value)
Add sharding value for table.
|
void |
close() |
static HintManager |
getInstance()
Get a new instance for
HintManager. |
void |
setDatabaseShardingValue(Comparable<?> value)
Add sharding value for database sharding only.
|
void |
setMasterRouteOnly()
Set CRUD operation force route to master database only.
|
public static HintManager getInstance()
HintManager.HintManager instancepublic void setDatabaseShardingValue(Comparable<?> value)
The sharding operator is =
value - sharding valuepublic void setMasterRouteOnly()
public void addDatabaseShardingValue(String logicTable, Comparable<?> value)
The sharding operator is =
logicTable - logic table namevalue - sharding valuepublic void addTableShardingValue(String logicTable, Comparable<?> value)
The sharding operator is =
logicTable - logic table namevalue - sharding valuepublic void close()
close 在接口中 AutoCloseableCopyright © 2019. All rights reserved.