1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.shardingsphere.sql.parser.sql.common.segment.dml.prepare;
19
20 import lombok.Getter;
21 import lombok.RequiredArgsConstructor;
22 import lombok.Setter;
23 import org.apache.shardingsphere.sql.parser.sql.common.segment.SQLSegment;
24 import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.DeleteStatement;
25 import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.InsertStatement;
26 import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.SelectStatement;
27 import org.apache.shardingsphere.sql.parser.sql.common.statement.dml.UpdateStatement;
28
29 import java.util.Optional;
30
31
32
33
34 @RequiredArgsConstructor
35 @Getter
36 @Setter
37 public final class PrepareStatementQuerySegment implements SQLSegment {
38
39 private final int startIndex;
40
41 private final int stopIndex;
42
43 private SelectStatement select;
44
45 private InsertStatement insert;
46
47 private UpdateStatement update;
48
49 private DeleteStatement delete;
50
51
52
53
54
55
56 public Optional<SelectStatement> getSelect() {
57 return Optional.ofNullable(select);
58 }
59
60
61
62
63
64
65 public Optional<InsertStatement> getInsert() {
66 return Optional.ofNullable(insert);
67 }
68
69
70
71
72
73
74 public Optional<UpdateStatement> getUpdate() {
75 return Optional.ofNullable(update);
76 }
77
78
79
80
81
82
83 public Optional<DeleteStatement> getDelete() {
84 return Optional.ofNullable(delete);
85 }
86 }