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.mode.repository.standalone.jdbc.sql;
19  
20  import com.fasterxml.jackson.annotation.JsonProperty;
21  import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
22  import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
23  import lombok.Getter;
24  
25  /**
26   * JDBC repository SQL.
27   * `required` in {@link com.fasterxml.jackson.annotation.JsonProperty} only provides Metadata without detecting Null values, which is actually consistent with the design of the JAXB API.
28   * See <a href="https://github.com/FasterXML/jackson-dataformat-xml/issues/625">FasterXML/jackson-dataformat-xml#625</a>
29   *
30   * @see JsonProperty
31   */
32  @JacksonXmlRootElement(localName = "sql")
33  @Getter
34  public final class JDBCRepositorySQL {
35      
36      @JsonProperty(required = true)
37      @JacksonXmlProperty(isAttribute = true)
38      private String type;
39      
40      @JsonProperty(required = true)
41      @JacksonXmlProperty(localName = "driver-class-name", isAttribute = true)
42      private String driverClassName;
43      
44      @JacksonXmlProperty(localName = "default", isAttribute = true)
45      private boolean isDefault;
46      
47      @JsonProperty(required = true)
48      @JacksonXmlProperty(localName = "create-table")
49      private String createTableSQL;
50      
51      @JsonProperty(required = true)
52      @JacksonXmlProperty(localName = "select-by-key")
53      private String selectByKeySQL;
54      
55      @JsonProperty(required = true)
56      @JacksonXmlProperty(localName = "select-by-parent")
57      private String selectByParentKeySQL;
58      
59      @JsonProperty(required = true)
60      @JacksonXmlProperty(localName = "insert")
61      private String insertSQL;
62      
63      @JsonProperty(required = true)
64      @JacksonXmlProperty(localName = "update")
65      private String updateSQL;
66      
67      @JsonProperty(required = true)
68      @JacksonXmlProperty(localName = "delete")
69      private String deleteSQL;
70  }