| 1 |
/* |
| 2 |
* Copyright 2004-2023 H2 Group. Multiple-Licensed under the MPL 2.0, |
| 3 |
* and the EPL 1.0 (https://h2database.com/html/license.html). |
| 4 |
* Initial Developer: H2 Group |
| 5 |
*/ |
| 6 |
package org.h2.command.ddl; |
| 7 |
|
| 8 |
import org.h2.engine.SessionLocal; |
| 9 |
import org.h2.schema.Schema; |
| 10 |
|
| 11 |
/** |
| 12 |
* This class represents a non-transaction statement that involves a schema and |
| 13 |
* requires schema owner rights. |
| 14 |
*/ |
| 15 |
abstract class SchemaOwnerCommand extends SchemaCommand { |
| 16 |
|
| 17 |
/** |
| 18 |
* Create a new command. |
| 19 |
* |
| 20 |
* @param session |
| 21 |
* the session |
| 22 |
* @param schema |
| 23 |
* the schema |
| 24 |
*/ |
| 25 |
SchemaOwnerCommand(SessionLocal session, Schema schema) { |
| 26 |
super(session, schema); |
| 27 |
} |
| 28 |
|
| 29 |
@Override |
| 30 |
public final long update() { |
| 31 |
Schema schema = getSchema(); |
| 32 |
session.getUser().checkSchemaOwner(schema); |
| 33 |
return update(schema); |
| 34 |
} |
| 35 |
|
| 36 |
abstract long update(Schema schema); |
| 37 |
|
| 38 |
} |