public class GlobalConfig extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
GlobalConfig |
camelCaseToSnake(boolean convert) |
GlobalConfig |
closeAfterExecuted(boolean close) |
static GlobalConfig |
configer() |
GlobalConfig |
debug(boolean debug) |
GlobalConfig |
defaultPageLimit(int defaultPageLimit) |
static long |
getDataCenterId() |
static int |
getDefaultPageLimit() |
static int |
getMaxFieldSize() |
static int |
getQueryMaxRows() |
static int |
getQueryTimeout() |
static long |
getWorkerId() |
static boolean |
isCamelCaseToSnake() |
static boolean |
isCloseAfterExecuted() |
static boolean |
isDebug() |
GlobalConfig |
maxFieldSize(int max)
设置
ResultSet 中可返回的字符或字节列的最大量限制。 |
GlobalConfig |
queryMaxRows(int max)
为
Statement 查询操作生成的 ResultSet 设置最大行数限制。 |
GlobalConfig |
queryTimeout(int seconds)
为
Statement 中 execute,executeUpdate,
executeQuery 设置执行超时时间 |
GlobalConfig |
registerKeyGenerator(Class<? extends KeyGenerator> clazz)
Registers the implementation class of
KeyGenerator by yourself. |
GlobalConfig |
setDataCenterId(long id) |
GlobalConfig |
setWorkerId(long id) |
public static GlobalConfig configer()
public static long getWorkerId()
public static long getDataCenterId()
public static boolean isCamelCaseToSnake()
public static boolean isDebug()
public static int getDefaultPageLimit()
public static int getQueryTimeout()
public static int getQueryMaxRows()
public static int getMaxFieldSize()
public static boolean isCloseAfterExecuted()
public GlobalConfig setWorkerId(long id)
public GlobalConfig setDataCenterId(long id)
public GlobalConfig camelCaseToSnake(boolean convert)
public GlobalConfig registerKeyGenerator(Class<? extends KeyGenerator> clazz)
KeyGenerator by yourself.clazz - the implementation class of KeyGenerator, must not nullpublic GlobalConfig debug(boolean debug)
public GlobalConfig defaultPageLimit(int defaultPageLimit)
public GlobalConfig queryTimeout(int seconds)
Statement 中 execute,executeUpdate,
executeQuery 设置执行超时时间seconds - 操作执行超时时间。如果设置为 0,表示没有限制。单位:秒Statement.setQueryTimeout(int)public GlobalConfig queryMaxRows(int max)
Statement 查询操作生成的 ResultSet 设置最大行数限制。
如果超出了该限制,剩余的行数将被删除。max - 最大行数。如果设置为 0,表示没有限制Statement.setMaxRows(int)public GlobalConfig maxFieldSize(int max)
ResultSet 中可返回的字符或字节列的最大量限制。
该限制仅仅可被设置在 BINARY,VARBINARY,
LONGVARBINARY,CHAR,VARCHAR,
NCHAR,NVARCHAR,LONGNVARCHAR,
LONGVARCHAR 类型的字段上。
如果超出该限制,多余的数据将被丢弃。
为了最大限度的实现可移植,值要尽可能大于 256。max - 最大的字节量。如果设置为 0,表示没有限制public GlobalConfig closeAfterExecuted(boolean close)
Copyright © 2019. All rights reserved.