View Javadoc
1   /*
2    * Licensed to the Apache Software Foundation (ASF) under one or more
3    * contributor license agreements.  See the NOTICE file distributed with
4    * this work for additional information regarding copyright ownership.
5    * The ASF licenses this file to You under the Apache License, Version 2.0
6    * (the "License"); you may not use this file except in compliance with
7    * the License.  You may obtain a copy of the License at
8    *
9    *     http://www.apache.org/licenses/LICENSE-2.0
10   *
11   * Unless required by applicable law or agreed to in writing, software
12   * distributed under the License is distributed on an "AS IS" BASIS,
13   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14   * See the License for the specific language governing permissions and
15   * limitations under the License.
16   */
17  
18  package org.apache.shardingsphere.infra.hint;
19  
20  import lombok.Getter;
21  import lombok.RequiredArgsConstructor;
22  import org.apache.shardingsphere.infra.props.TypedPropertyKey;
23  
24  /**
25   * Typed property key of SQL Hint.
26   */
27  @RequiredArgsConstructor
28  @Getter
29  public enum SQLHintPropertiesKey implements TypedPropertyKey {
30      
31      /**
32       * Hint data source name.
33       */
34      DATASOURCE_NAME_KEY("DATA_SOURCE_NAME", "dataSourceName", "", String.class),
35      
36      /**
37       * Whether hint route write data source or not.
38       */
39      WRITE_ROUTE_ONLY_KEY("WRITE_ROUTE_ONLY", "writeRouteOnly", String.valueOf(Boolean.FALSE), boolean.class),
40      
41      /**
42       * Whether to use traffic or not.
43       */
44      USE_TRAFFIC_KEY("USE_TRAFFIC", "useTraffic", String.valueOf(Boolean.FALSE), boolean.class),
45      
46      /**
47       * Whether hint skip sql rewrite or not.
48       */
49      SKIP_SQL_REWRITE_KEY("SKIP_SQL_REWRITE", "skipSQLRewrite", String.valueOf(Boolean.FALSE), boolean.class),
50      
51      /**
52       * Hint disable audit names.
53       */
54      DISABLE_AUDIT_NAMES_KEY("DISABLE_AUDIT_NAMES", "disableAuditNames", "", String.class),
55      
56      /**
57       * Hint sharding database value.
58       */
59      SHARDING_DATABASE_VALUE_KEY("SHARDING_DATABASE_VALUE", "shardingDatabaseValue", "", Comparable.class),
60      
61      /**
62       * Hint sharding table value.
63       */
64      SHARDING_TABLE_VALUE_KEY("SHARDING_TABLE_VALUE", "shardingTableValue", "", Comparable.class),
65      
66      /**
67       * Whether to use shadow or not.
68       */
69      SHADOW_KEY("SHADOW", "shadow", String.valueOf(Boolean.FALSE), boolean.class);
70      
71      private final String key;
72      
73      private final String alias;
74      
75      private final String defaultValue;
76      
77      private final Class<?> type;
78  }