@@ -212,6 +212,7 @@ TOKEN: /* SQL Keywords. prefixed with K_ to avoid name clashes */
212212| <K_EXTENDED:"EXTENDED">
213213| <K_EXTRACT:"EXTRACT">
214214| <K_FETCH:"FETCH">
215+ | <K_ISOLATION:("UR" | "RS" | "RR" | "CS")>
215216| <K_FILTER: "FILTER">
216217| <K_FIRST: "FIRST">
217218| <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;
@@ -1877,7 +1879,7 @@ PlainSelect PlainSelect() #PlainSelect:
18771879 [LOOKAHEAD(<K_OFFSET>) offset = Offset() { plainSelect.setOffset(offset); } ]
18781880 [LOOKAHEAD(<K_LIMIT>, { limit==null }) limit = LimitWithOffset() { plainSelect.setLimit(limit); } ]
18791881 [LOOKAHEAD(<K_FETCH>) fetch = Fetch() { plainSelect.setFetch(fetch); } ]
1880-
1882+ [LOOKAHEAD(<K_WITH> <K_ISOLATION>) withIsolation = WithIsolation() { plainSelect.setWithIsolation(withIsolation); } ]
18811883 [LOOKAHEAD(2) <K_FOR> <K_UPDATE> { plainSelect.setForUpdate(true); }
18821884 [ <K_OF> updateTable = Table() { plainSelect.setForUpdateTable(updateTable); } ]
18831885 [ LOOKAHEAD(<K_WAIT>) wait = Wait() { plainSelect.setWait(wait); } ]
@@ -1903,6 +1905,7 @@ SelectBody SetOperationList() #SetOperationList: {
19031905 Limit limit = null;
19041906 Offset offset = null;
19051907 Fetch fetch = null;
1908+ WithIsolation withIsolation = null;
19061909 SelectBody select = null;
19071910 List<SelectBody> selects = new ArrayList<SelectBody>();
19081911 List<SetOperation> operations = new ArrayList<SetOperation>();
@@ -1927,6 +1930,7 @@ SelectBody SetOperationList() #SetOperationList: {
19271930 [LOOKAHEAD(<K_LIMIT>) limit=LimitWithOffset() {list.setLimit(limit);} ]
19281931 [LOOKAHEAD(<K_OFFSET>) offset = Offset() { list.setOffset(offset);} ]
19291932 [LOOKAHEAD(<K_FETCH>) fetch = Fetch() { list.setFetch(fetch);} ]
1933+ [LOOKAHEAD(<K_WITH> <K_ISOLATION>) withIsolation = WithIsolation() { list.setWithIsolation(withIsolation);} ]
19301934
19311935 {
19321936 if (selects.size()==1 && selects.get(0) instanceof PlainSelect && orderByElements==null) {
@@ -1958,6 +1962,7 @@ SelectBody SetOperationListWithoutIntialSelect(FromItem fromItem) #SetOperationL
19581962 Limit limit = null;
19591963 Offset offset = null;
19601964 Fetch fetch = null;
1965+ WithIsolation withIsolation = null;
19611966 SelectBody select;
19621967 List<SelectBody> selects = new ArrayList<SelectBody>();
19631968 List<SetOperation> operations = new ArrayList<SetOperation>();
@@ -2837,6 +2842,24 @@ Fetch Fetch():
28372842 }
28382843}
28392844
2845+ WithIsolation WithIsolation():
2846+ {
2847+ WithIsolation withIsolation = new WithIsolation();
2848+ Token token = null;
2849+ JdbcParameter jdbc;
2850+ }
2851+ {
2852+ (
2853+ //with (ur | cs | rs | rr)
2854+ <K_WITH>
2855+ token=<K_ISOLATION> { withIsolation.setIsolation(token.image); }
2856+
2857+ )
2858+ {
2859+ return withIsolation;
2860+ }
2861+ }
2862+
28402863OptimizeFor OptimizeFor():
28412864{
28422865 Token token;
0 commit comments