File D:\maven-qcr-plugin-testsunitaires\qcr4java\h2-1.3.170-sources\target\site\qc\lecode\command\ddl\AlterView.java.html

1 /*
2 * Copyright 2004-2011 H2 Group. Multiple-Licensed under the H2 License,
3 * Version 1.0, and under the Eclipse Public License, Version 1.0
4 * (http://h2database.com/html/license.html).
5 * Initial Developer: H2 Group
6 */
7 package org.h2.command.ddl;
8
9 import org.h2.command.CommandInterface;
10 import org.h2.engine.Right;
11 import org.h2.engine.Session;
12 import org.h2.message.DbException;
13 import org.h2.table.TableView;
14
15 /**
16 * This class represents the statement
17 * ALTER VIEW
18 */
19 public class AlterView extends DefineCommand {
20
21 private TableView view;
22
23 public AlterView(Session session) {
24 super(session);
25 }
26
27 public void setView(TableView view) {
28 this.view = view;
29 }
30
31 public int update() {
32 session.commit(true);
33 session.getUser().checkRight(view, Right.ALL);
34 DbException e = view.recompile(session, false);
35 if (e != null) {
36 throw e;
37 }
38 return 0;
39 }
40
41 public int getType() {
42 return CommandInterface.ALTER_VIEW;
43 }
44
45 }
46