View Javadoc
1   /*
2    *    Copyright 2010-2022 the original author or authors.
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    *       https://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  package org.apache.ibatis.migration.options;
17  
18  public class DatabaseOperationOption {
19    private static final String DEFAULT_CHANGELOG_TABLE = "CHANGELOG";
20  
21    private static final String DEFAULT_DELIMITER = ";";
22  
23    private String changelogTable;
24  
25    private boolean stopOnError = true;
26  
27    private boolean throwWarning = true;
28  
29    private boolean autoCommit;
30  
31    private boolean sendFullScript;
32  
33    private boolean removeCRs;
34  
35    private boolean escapeProcessing = true;
36  
37    private boolean fullLineDelimiter = false;
38  
39    private String delimiter;
40  
41    public String getChangelogTable() {
42      return changelogTable == null ? DEFAULT_CHANGELOG_TABLE : changelogTable;
43    }
44  
45    public void setChangelogTable(String changelogTable) {
46      this.changelogTable = changelogTable;
47    }
48  
49    public boolean isStopOnError() {
50      return stopOnError;
51    }
52  
53    public void setStopOnError(boolean stopOnError) {
54      this.stopOnError = stopOnError;
55    }
56  
57    public boolean isThrowWarning() {
58      return throwWarning;
59    }
60  
61    public void setThrowWarning(boolean throwWarning) {
62      this.throwWarning = throwWarning;
63    }
64  
65    public boolean isAutoCommit() {
66      return autoCommit;
67    }
68  
69    public void setAutoCommit(boolean autoCommit) {
70      this.autoCommit = autoCommit;
71    }
72  
73    public boolean isSendFullScript() {
74      return sendFullScript;
75    }
76  
77    public void setSendFullScript(boolean sendFullScript) {
78      this.sendFullScript = sendFullScript;
79    }
80  
81    public boolean isRemoveCRs() {
82      return removeCRs;
83    }
84  
85    public void setRemoveCRs(boolean removeCRs) {
86      this.removeCRs = removeCRs;
87    }
88  
89    public boolean isEscapeProcessing() {
90      return escapeProcessing;
91    }
92  
93    public void setEscapeProcessing(boolean escapeProcessing) {
94      this.escapeProcessing = escapeProcessing;
95    }
96  
97    public boolean isFullLineDelimiter() {
98      return fullLineDelimiter;
99    }
100 
101   public void setFullLineDelimiter(boolean fullLineDelimiter) {
102     this.fullLineDelimiter = fullLineDelimiter;
103   }
104 
105   public String getDelimiter() {
106     return delimiter == null ? DEFAULT_DELIMITER : delimiter;
107   }
108 
109   public void setDelimiter(String delimiter) {
110     this.delimiter = delimiter;
111   }
112 }