@@ -213,6 +213,7 @@ TOKEN: /* SQL Keywords. prefixed with K_ to avoid name clashes */
213213| <K_EXTENDED:"EXTENDED">
214214| <K_EXTRACT:"EXTRACT">
215215| <K_FETCH:"FETCH">
216+ | <K_ISOLATION:("UR" | "RS" | "RR" | "CS")>
216217| <K_FILTER: "FILTER">
217218| <K_FIRST: "FIRST">
218219| <K_FALSE: "FALSE">
@@ -1809,6 +1810,7 @@ PlainSelect PlainSelect() #PlainSelect:
18091810 Limit limit = null;
18101811 Offset offset = null;
18111812 Fetch fetch = null;
1813+ WithIsolation withIsolation = null;
18121814 OptimizeFor optimize = null;
18131815 Top top = null;
18141816 Skip skip = null;
@@ -1876,7 +1878,7 @@ PlainSelect PlainSelect() #PlainSelect:
18761878 [LOOKAHEAD(<K_OFFSET>) offset = Offset() { plainSelect.setOffset(offset); } ]
18771879 [LOOKAHEAD(<K_LIMIT>, { limit==null }) limit = LimitWithOffset() { plainSelect.setLimit(limit); } ]
18781880 [LOOKAHEAD(<K_FETCH>) fetch = Fetch() { plainSelect.setFetch(fetch); } ]
1879-
1881+ [LOOKAHEAD(<K_WITH> <K_ISOLATION>) withIsolation = WithIsolation() { plainSelect.setWithIsolation(withIsolation); } ]
18801882 [LOOKAHEAD(2) <K_FOR> <K_UPDATE> { plainSelect.setForUpdate(true); }
18811883 [ <K_OF> updateTable = Table() { plainSelect.setForUpdateTable(updateTable); } ]
18821884 [ LOOKAHEAD(<K_WAIT>) wait = Wait() { plainSelect.setWait(wait); } ]
@@ -1902,6 +1904,7 @@ SelectBody SetOperationList() #SetOperationList: {
19021904 Limit limit = null;
19031905 Offset offset = null;
19041906 Fetch fetch = null;
1907+ WithIsolation withIsolation = null;
19051908 SelectBody select = null;
19061909 List<SelectBody> selects = new ArrayList<SelectBody>();
19071910 List<SetOperation> operations = new ArrayList<SetOperation>();
@@ -1926,6 +1929,7 @@ SelectBody SetOperationList() #SetOperationList: {
19261929 [LOOKAHEAD(<K_LIMIT>) limit=LimitWithOffset() {list.setLimit(limit);} ]
19271930 [LOOKAHEAD(<K_OFFSET>) offset = Offset() { list.setOffset(offset);} ]
19281931 [LOOKAHEAD(<K_FETCH>) fetch = Fetch() { list.setFetch(fetch);} ]
1932+ [LOOKAHEAD(<K_WITH> <K_ISOLATION>) withIsolation = WithIsolation() { list.setWithIsolation(withIsolation);} ]
19291933
19301934 {
19311935 if (selects.size()==1 && selects.get(0) instanceof PlainSelect && orderByElements==null) {
@@ -1957,6 +1961,7 @@ SelectBody SetOperationListWithoutIntialSelect(FromItem fromItem) #SetOperationL
19571961 Limit limit = null;
19581962 Offset offset = null;
19591963 Fetch fetch = null;
1964+ WithIsolation withIsolation = null;
19601965 SelectBody select;
19611966 List<SelectBody> selects = new ArrayList<SelectBody>();
19621967 List<SetOperation> operations = new ArrayList<SetOperation>();
@@ -2836,6 +2841,24 @@ Fetch Fetch():
28362841 }
28372842}
28382843
2844+ WithIsolation WithIsolation():
2845+ {
2846+ WithIsolation withIsolation = new WithIsolation();
2847+ Token token = null;
2848+ JdbcParameter jdbc;
2849+ }
2850+ {
2851+ (
2852+ //with (ur | cs | rs | rr)
2853+ <K_WITH>
2854+ token=<K_ISOLATION> { withIsolation.setIsolation(token.image); }
2855+
2856+ )
2857+ {
2858+ return withIsolation;
2859+ }
2860+ }
2861+
28392862OptimizeFor OptimizeFor():
28402863{
28412864 Token token;
0 commit comments