Class SqlSegmentProcessor
-
- All Implemented Interfaces:
public final class SqlSegmentProcessor- Since:
2019-06-06
trydofor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumSqlSegmentProcessor.DbsTypepublic enumSqlSegmentProcessor.ErrTypepublic final classSqlSegmentProcessor.Segmentpublic classSqlSegmentProcessor.Companion
-
Field Summary
Fields Modifier and Type Field Description public final static IntegerTYPE_OTHERpublic final static IntegerTYPE_PLAINpublic final static IntegerTYPE_TRACEpublic final static IntegerTYPE_SHARDpublic final static StringPLAIN_TABLEpublic final static StringSHARD_LINE_SEQpublic final static StringTRACE_DOLLARpublic final static StringTRACE_SU2_LINEpublic final static StringTRACE_PRE_LINEpublic final static SqlSegmentProcessor.CompanionCompanion
-
Constructor Summary
Constructors Constructor Description SqlSegmentProcessor(String commentSingle, String commentMultiple, String delimiterDefault, String delimiterCommand)
-
Method Summary
Modifier and Type Method Description final List<SqlSegmentProcessor.Segment>parse(SqlStatementParser statementParser, String text)Parse the SQL text to the sql segment that can be replaced and executed. final Stringmerge(SqlSegmentProcessor.Segment segment, Map<String, String> newTbl)Merge the segment with new table. final static UnitsetShardFormat(String reg)Set the RegExp of shard table, XXXis placeholder of plain tablefinal static UnitsetTraceFormat(String reg)Set the RegExp of trace table, XXXis placeholder of plain table-
-
Method Detail
-
parse
final List<SqlSegmentProcessor.Segment> parse(SqlStatementParser statementParser, String text)
Parse the SQL text to the sql segment that can be replaced and executed.
- Parameters:
statementParser- simple statement parsertext- SQL text
-
merge
final String merge(SqlSegmentProcessor.Segment segment, Map<String, String> newTbl)
Merge the segment with new table.
- Parameters:
segment- parsed sql segmentnewTbl- new table
-
setShardFormat
final static Unit setShardFormat(String reg)
Set the RegExp of shard table,
XXXis placeholder of plain table- Parameters:
reg- Regexp of shard table
-
setTraceFormat
final static Unit setTraceFormat(String reg)
Set the RegExp of trace table,
XXXis placeholder of plain table- Parameters:
reg- Regexp of shard table
-
-
-
-