1 | /* |
2 | * Copyright 2004-2014 H2 Group. Multiple-Licensed under the MPL 2.0, |
3 | * and the EPL 1.0 (http://h2database.com/html/license.html). |
4 | * Initial Developer: H2 Group |
5 | */ |
6 | package org.h2.command.dml; |
7 | |
8 | import org.h2.command.CommandInterface; |
9 | import org.h2.command.Prepared; |
10 | import org.h2.engine.Session; |
11 | import org.h2.result.ResultInterface; |
12 | |
13 | /** |
14 | * Represents an empty statement or a statement that has no effect. |
15 | */ |
16 | public class NoOperation extends Prepared { |
17 | |
18 | public NoOperation(Session session) { |
19 | super(session); |
20 | } |
21 | |
22 | @Override |
23 | public int update() { |
24 | return 0; |
25 | } |
26 | |
27 | @Override |
28 | public boolean isQuery() { |
29 | return false; |
30 | } |
31 | |
32 | @Override |
33 | public boolean isTransactional() { |
34 | return true; |
35 | } |
36 | |
37 | @Override |
38 | public boolean needRecompile() { |
39 | return false; |
40 | } |
41 | |
42 | @Override |
43 | public boolean isReadOnly() { |
44 | return true; |
45 | } |
46 | |
47 | @Override |
48 | public ResultInterface queryMeta() { |
49 | return null; |
50 | } |
51 | |
52 | @Override |
53 | public int getType() { |
54 | return CommandInterface.NO_OPERATION; |
55 | } |
56 | |
57 | } |