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.schema; |
7 | |
8 | import org.h2.engine.DbObjectBase; |
9 | |
10 | /** |
11 | * The base class for classes implementing SchemaObject. |
12 | */ |
13 | public abstract class SchemaObjectBase extends DbObjectBase implements |
14 | SchemaObject { |
15 | |
16 | private Schema schema; |
17 | |
18 | /** |
19 | * Initialize some attributes of this object. |
20 | * |
21 | * @param newSchema the schema |
22 | * @param id the object id |
23 | * @param name the name |
24 | * @param traceModule the trace module name |
25 | */ |
26 | protected void initSchemaObjectBase(Schema newSchema, int id, String name, |
27 | String traceModule) { |
28 | initDbObjectBase(newSchema.getDatabase(), id, name, traceModule); |
29 | this.schema = newSchema; |
30 | } |
31 | |
32 | @Override |
33 | public Schema getSchema() { |
34 | return schema; |
35 | } |
36 | |
37 | @Override |
38 | public String getSQL() { |
39 | return schema.getSQL() + "." + super.getSQL(); |
40 | } |
41 | |
42 | @Override |
43 | public boolean isHidden() { |
44 | return false; |
45 | } |
46 | |
47 | } |