1 /*
2 * Copyright 2015-2018 HuntLabs.cn
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */16 modulehunt.sql.ast.statement.SQLPrimaryKeyImpl;
17 18 importhunt.sql.visitor.SQLASTVisitor;
19 importhunt.sql.ast.statement.SQLUnique;
20 importhunt.sql.ast.statement.SQLPrimaryKey;
21 importhunt.collection;
22 importhunt.sql.ast.SQLObject;
23 importhunt.sql.ast.statement.SQLSelectOrderByItem;
24 25 publicclassSQLPrimaryKeyImpl : SQLUnique , SQLPrimaryKey {
26 27 aliascloneTo = SQLUnique.cloneTo;
28 29 protectedboolclustered = false; // sql server30 31 32 overrideprotectedvoidaccept0(SQLASTVisitorvisitor) {
33 if (visitor.visit(this)) {
34 acceptChild(visitor, this.getName());
35 acceptChild!SQLSelectOrderByItem(visitor, this.getColumns());
36 }
37 visitor.endVisit(this);
38 }
39 40 overridepublicSQLPrimaryKeyImplclone() {
41 SQLPrimaryKeyImplx = newSQLPrimaryKeyImpl();
42 cloneTo(x);
43 returnx;
44 }
45 46 publicvoidcloneTo(SQLPrimaryKeyImplx) {
47 super.cloneTo(x);
48 x.clustered = clustered;
49 }
50 51 publicboolisClustered() {
52 returnclustered;
53 }
54 55 publicvoidsetClustered(boolclustered) {
56 this.clustered = clustered;
57 }
58 }