View Javadoc
1   /**
2    *    Copyright 2006-2016 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    *       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  package org.mybatis.generator.config;
17  
18  import static org.mybatis.generator.internal.util.EqualsUtil.areEqual;
19  import static org.mybatis.generator.internal.util.HashCodeUtil.hash;
20  import static org.mybatis.generator.internal.util.HashCodeUtil.SEED;
21  import static org.mybatis.generator.internal.util.messages.Messages.getString;
22  import static org.mybatis.generator.internal.util.StringUtility.composeFullyQualifiedTableName;
23  import static org.mybatis.generator.internal.util.StringUtility.isTrue;
24  import static org.mybatis.generator.internal.util.StringUtility.stringHasValue;
25  
26  import java.util.ArrayList;
27  import java.util.HashMap;
28  import java.util.List;
29  import java.util.Map;
30  
31  import org.mybatis.generator.api.dom.xml.Attribute;
32  import org.mybatis.generator.api.dom.xml.XmlElement;
33  
34  /**
35   * The Class TableConfiguration.
36   *
37   * @author Jeff Butler
38   */
39  public class TableConfiguration extends PropertyHolder {
40      
41      /** The insert statement enabled. */
42      private boolean insertStatementEnabled;
43  
44      /** The select by primary key statement enabled. */
45      private boolean selectByPrimaryKeyStatementEnabled;
46  
47      /** The select by example statement enabled. */
48      private boolean selectByExampleStatementEnabled;
49  
50      /** The update by primary key statement enabled. */
51      private boolean updateByPrimaryKeyStatementEnabled;
52  
53      /** The delete by primary key statement enabled. */
54      private boolean deleteByPrimaryKeyStatementEnabled;
55  
56      /** The delete by example statement enabled. */
57      private boolean deleteByExampleStatementEnabled;
58  
59      /** The count by example statement enabled. */
60      private boolean countByExampleStatementEnabled;
61  
62      /** The update by example statement enabled. */
63      private boolean updateByExampleStatementEnabled;
64  
65      /** The column overrides. */
66      private List<ColumnOverride> columnOverrides;
67  
68      /** The ignored columns. */
69      private Map<IgnoredColumn, Boolean> ignoredColumns;
70  
71      /** The generated key. */
72      private GeneratedKey generatedKey;
73  
74      /** The select by primary key query id. */
75      private String selectByPrimaryKeyQueryId;
76  
77      /** The select by example query id. */
78      private String selectByExampleQueryId;
79  
80      /** The catalog. */
81      private String catalog;
82      
83      /** The schema. */
84      private String schema;
85      
86      /** The table name. */
87      private String tableName;
88      
89      /** The domain object name. */
90      private String domainObjectName;
91      
92      /** The alias. */
93      private String alias;
94      
95      /** The model type. */
96      private ModelType modelType;
97      
98      /** The wildcard escaping enabled. */
99      private boolean wildcardEscapingEnabled;
100     
101     /** The configured model type. */
102     private String configuredModelType;
103     
104     /** The delimit identifiers. */
105     private boolean delimitIdentifiers;
106 
107     /** The column renaming rule. */
108     private ColumnRenamingRule columnRenamingRule;
109     
110     /** The is all column delimiting enabled. */
111     private boolean isAllColumnDelimitingEnabled;
112 
113     /**
114      * Instantiates a new table configuration.
115      *
116      * @param context
117      *            the context
118      */
119     public TableConfiguration(Context context) {
120         super();
121 
122         this.modelType = context.getDefaultModelType();
123 
124         columnOverrides = new ArrayList<ColumnOverride>();
125         ignoredColumns = new HashMap<IgnoredColumn, Boolean>();
126 
127         insertStatementEnabled = true;
128         selectByPrimaryKeyStatementEnabled = true;
129         selectByExampleStatementEnabled = true;
130         updateByPrimaryKeyStatementEnabled = true;
131         deleteByPrimaryKeyStatementEnabled = true;
132         deleteByExampleStatementEnabled = true;
133         countByExampleStatementEnabled = true;
134         updateByExampleStatementEnabled = true;
135     }
136 
137     /**
138      * Checks if is delete by primary key statement enabled.
139      *
140      * @return true, if is delete by primary key statement enabled
141      */
142     public boolean isDeleteByPrimaryKeyStatementEnabled() {
143         return deleteByPrimaryKeyStatementEnabled;
144     }
145 
146     /**
147      * Sets the delete by primary key statement enabled.
148      *
149      * @param deleteByPrimaryKeyStatementEnabled
150      *            the new delete by primary key statement enabled
151      */
152     public void setDeleteByPrimaryKeyStatementEnabled(
153             boolean deleteByPrimaryKeyStatementEnabled) {
154         this.deleteByPrimaryKeyStatementEnabled = deleteByPrimaryKeyStatementEnabled;
155     }
156 
157     /**
158      * Checks if is insert statement enabled.
159      *
160      * @return true, if is insert statement enabled
161      */
162     public boolean isInsertStatementEnabled() {
163         return insertStatementEnabled;
164     }
165 
166     /**
167      * Sets the insert statement enabled.
168      *
169      * @param insertStatementEnabled
170      *            the new insert statement enabled
171      */
172     public void setInsertStatementEnabled(boolean insertStatementEnabled) {
173         this.insertStatementEnabled = insertStatementEnabled;
174     }
175 
176     /**
177      * Checks if is select by primary key statement enabled.
178      *
179      * @return true, if is select by primary key statement enabled
180      */
181     public boolean isSelectByPrimaryKeyStatementEnabled() {
182         return selectByPrimaryKeyStatementEnabled;
183     }
184 
185     /**
186      * Sets the select by primary key statement enabled.
187      *
188      * @param selectByPrimaryKeyStatementEnabled
189      *            the new select by primary key statement enabled
190      */
191     public void setSelectByPrimaryKeyStatementEnabled(
192             boolean selectByPrimaryKeyStatementEnabled) {
193         this.selectByPrimaryKeyStatementEnabled = selectByPrimaryKeyStatementEnabled;
194     }
195 
196     /**
197      * Checks if is update by primary key statement enabled.
198      *
199      * @return true, if is update by primary key statement enabled
200      */
201     public boolean isUpdateByPrimaryKeyStatementEnabled() {
202         return updateByPrimaryKeyStatementEnabled;
203     }
204 
205     /**
206      * Sets the update by primary key statement enabled.
207      *
208      * @param updateByPrimaryKeyStatementEnabled
209      *            the new update by primary key statement enabled
210      */
211     public void setUpdateByPrimaryKeyStatementEnabled(
212             boolean updateByPrimaryKeyStatementEnabled) {
213         this.updateByPrimaryKeyStatementEnabled = updateByPrimaryKeyStatementEnabled;
214     }
215 
216     /**
217      * Checks if is column ignored.
218      *
219      * @param columnName
220      *            the column name
221      * @return true, if is column ignored
222      */
223     public boolean isColumnIgnored(String columnName) {
224         for (Map.Entry<IgnoredColumn, Boolean> entry : ignoredColumns
225                 .entrySet()) {
226             IgnoredColumn ic = entry.getKey();
227             if (ic.isColumnNameDelimited()) {
228                 if (columnName.equals(ic.getColumnName())) {
229                     entry.setValue(Boolean.TRUE);
230                     return true;
231                 }
232             } else {
233                 if (columnName.equalsIgnoreCase(ic.getColumnName())) {
234                     entry.setValue(Boolean.TRUE);
235                     return true;
236                 }
237             }
238         }
239 
240         return false;
241     }
242 
243     /**
244      * Adds the ignored column.
245      *
246      * @param ignoredColumn
247      *            the ignored column
248      */
249     public void addIgnoredColumn(IgnoredColumn ignoredColumn) {
250         ignoredColumns.put(ignoredColumn, Boolean.FALSE);
251     }
252 
253     /**
254      * Adds the column override.
255      *
256      * @param columnOverride
257      *            the column override
258      */
259     public void addColumnOverride(ColumnOverride columnOverride) {
260         columnOverrides.add(columnOverride);
261     }
262 
263     /* (non-Javadoc)
264      * @see java.lang.Object#equals(java.lang.Object)
265      */
266     @Override
267     public boolean equals(Object obj) {
268         if (this == obj) {
269             return true;
270         }
271 
272         if (!(obj instanceof TableConfiguration)) {
273             return false;
274         }
275 
276         TableConfiguration other = (TableConfiguration) obj;
277 
278         return areEqual(this.catalog, other.catalog)
279                 && areEqual(this.schema, other.schema)
280                 && areEqual(this.tableName, other.tableName);
281     }
282 
283     /* (non-Javadoc)
284      * @see java.lang.Object#hashCode()
285      */
286     @Override
287     public int hashCode() {
288         int result = SEED;
289         result = hash(result, catalog);
290         result = hash(result, schema);
291         result = hash(result, tableName);
292 
293         return result;
294     }
295 
296     /**
297      * Checks if is select by example statement enabled.
298      *
299      * @return true, if is select by example statement enabled
300      */
301     public boolean isSelectByExampleStatementEnabled() {
302         return selectByExampleStatementEnabled;
303     }
304 
305     /**
306      * Sets the select by example statement enabled.
307      *
308      * @param selectByExampleStatementEnabled
309      *            the new select by example statement enabled
310      */
311     public void setSelectByExampleStatementEnabled(
312             boolean selectByExampleStatementEnabled) {
313         this.selectByExampleStatementEnabled = selectByExampleStatementEnabled;
314     }
315 
316     /**
317      * May return null if the column has not been overridden.
318      *
319      * @param columnName
320      *            the column name
321      * @return the column override (if any) related to this column
322      */
323     public ColumnOverride getColumnOverride(String columnName) {
324         for (ColumnOverride co : columnOverrides) {
325             if (co.isColumnNameDelimited()) {
326                 if (columnName.equals(co.getColumnName())) {
327                     return co;
328                 }
329             } else {
330                 if (columnName.equalsIgnoreCase(co.getColumnName())) {
331                     return co;
332                 }
333             }
334         }
335 
336         return null;
337     }
338 
339     /**
340      * Gets the generated key.
341      *
342      * @return the generated key
343      */
344     public GeneratedKey getGeneratedKey() {
345         return generatedKey;
346     }
347 
348     /**
349      * Gets the select by example query id.
350      *
351      * @return the select by example query id
352      */
353     public String getSelectByExampleQueryId() {
354         return selectByExampleQueryId;
355     }
356 
357     /**
358      * Sets the select by example query id.
359      *
360      * @param selectByExampleQueryId
361      *            the new select by example query id
362      */
363     public void setSelectByExampleQueryId(String selectByExampleQueryId) {
364         this.selectByExampleQueryId = selectByExampleQueryId;
365     }
366 
367     /**
368      * Gets the select by primary key query id.
369      *
370      * @return the select by primary key query id
371      */
372     public String getSelectByPrimaryKeyQueryId() {
373         return selectByPrimaryKeyQueryId;
374     }
375 
376     /**
377      * Sets the select by primary key query id.
378      *
379      * @param selectByPrimaryKeyQueryId
380      *            the new select by primary key query id
381      */
382     public void setSelectByPrimaryKeyQueryId(String selectByPrimaryKeyQueryId) {
383         this.selectByPrimaryKeyQueryId = selectByPrimaryKeyQueryId;
384     }
385 
386     /**
387      * Checks if is delete by example statement enabled.
388      *
389      * @return true, if is delete by example statement enabled
390      */
391     public boolean isDeleteByExampleStatementEnabled() {
392         return deleteByExampleStatementEnabled;
393     }
394 
395     /**
396      * Sets the delete by example statement enabled.
397      *
398      * @param deleteByExampleStatementEnabled
399      *            the new delete by example statement enabled
400      */
401     public void setDeleteByExampleStatementEnabled(
402             boolean deleteByExampleStatementEnabled) {
403         this.deleteByExampleStatementEnabled = deleteByExampleStatementEnabled;
404     }
405 
406     /**
407      * Are any statements enabled.
408      *
409      * @return true, if successful
410      */
411     public boolean areAnyStatementsEnabled() {
412         return selectByExampleStatementEnabled
413                 || selectByPrimaryKeyStatementEnabled || insertStatementEnabled
414                 || updateByPrimaryKeyStatementEnabled
415                 || deleteByExampleStatementEnabled
416                 || deleteByPrimaryKeyStatementEnabled
417                 || countByExampleStatementEnabled
418                 || updateByExampleStatementEnabled;
419     }
420 
421     /**
422      * Sets the generated key.
423      *
424      * @param generatedKey
425      *            the new generated key
426      */
427     public void setGeneratedKey(GeneratedKey generatedKey) {
428         this.generatedKey = generatedKey;
429     }
430 
431     /**
432      * Gets the alias.
433      *
434      * @return the alias
435      */
436     public String getAlias() {
437         return alias;
438     }
439 
440     /**
441      * Sets the alias.
442      *
443      * @param alias
444      *            the new alias
445      */
446     public void setAlias(String alias) {
447         this.alias = alias;
448     }
449 
450     /**
451      * Gets the catalog.
452      *
453      * @return the catalog
454      */
455     public String getCatalog() {
456         return catalog;
457     }
458 
459     /**
460      * Sets the catalog.
461      *
462      * @param catalog
463      *            the new catalog
464      */
465     public void setCatalog(String catalog) {
466         this.catalog = catalog;
467     }
468 
469     /**
470      * Gets the domain object name.
471      *
472      * @return the domain object name
473      */
474     public String getDomainObjectName() {
475         return domainObjectName;
476     }
477 
478     /**
479      * Sets the domain object name.
480      *
481      * @param domainObjectName
482      *            the new domain object name
483      */
484     public void setDomainObjectName(String domainObjectName) {
485         this.domainObjectName = domainObjectName;
486     }
487 
488     /**
489      * Gets the schema.
490      *
491      * @return the schema
492      */
493     public String getSchema() {
494         return schema;
495     }
496 
497     /**
498      * Sets the schema.
499      *
500      * @param schema
501      *            the new schema
502      */
503     public void setSchema(String schema) {
504         this.schema = schema;
505     }
506 
507     /**
508      * Gets the table name.
509      *
510      * @return the table name
511      */
512     public String getTableName() {
513         return tableName;
514     }
515 
516     /**
517      * Sets the table name.
518      *
519      * @param tableName
520      *            the new table name
521      */
522     public void setTableName(String tableName) {
523         this.tableName = tableName;
524     }
525 
526     /**
527      * Gets the column overrides.
528      *
529      * @return the column overrides
530      */
531     public List<ColumnOverride> getColumnOverrides() {
532         return columnOverrides;
533     }
534 
535     /**
536      * This method returns a List of Strings. The values are the columns
537      * that were specified to be ignored in the table, but do not exist in the
538      * table.
539      * 
540      * @return a List of Strings - the columns that were improperly configured
541      *         as ignored columns
542      */
543     public List<String> getIgnoredColumnsInError() {
544         List<String> answer = new ArrayList<String>();
545 
546         for (Map.Entry<IgnoredColumn, Boolean> entry : ignoredColumns
547                 .entrySet()) {
548             if (Boolean.FALSE.equals(entry.getValue())) {
549                 answer.add(entry.getKey().getColumnName());
550             }
551         }
552 
553         return answer;
554     }
555 
556     /**
557      * Gets the model type.
558      *
559      * @return the model type
560      */
561     public ModelType getModelType() {
562         return modelType;
563     }
564 
565     /**
566      * Sets the configured model type.
567      *
568      * @param configuredModelType
569      *            the new configured model type
570      */
571     public void setConfiguredModelType(String configuredModelType) {
572         this.configuredModelType = configuredModelType;
573         this.modelType = ModelType.getModelType(configuredModelType);
574     }
575 
576     /**
577      * Checks if is wildcard escaping enabled.
578      *
579      * @return true, if is wildcard escaping enabled
580      */
581     public boolean isWildcardEscapingEnabled() {
582         return wildcardEscapingEnabled;
583     }
584 
585     /**
586      * Sets the wildcard escaping enabled.
587      *
588      * @param wildcardEscapingEnabled
589      *            the new wildcard escaping enabled
590      */
591     public void setWildcardEscapingEnabled(boolean wildcardEscapingEnabled) {
592         this.wildcardEscapingEnabled = wildcardEscapingEnabled;
593     }
594 
595     /**
596      * To xml element.
597      *
598      * @return the xml element
599      */
600     public XmlElement toXmlElement() {
601         XmlElement xmlElement = new XmlElement("table"); //$NON-NLS-1$
602         xmlElement.addAttribute(new Attribute("tableName", tableName)); //$NON-NLS-1$
603 
604         if (stringHasValue(catalog)) {
605             xmlElement.addAttribute(new Attribute("catalog", catalog)); //$NON-NLS-1$
606         }
607 
608         if (stringHasValue(schema)) {
609             xmlElement.addAttribute(new Attribute("schema", schema)); //$NON-NLS-1$
610         }
611 
612         if (stringHasValue(alias)) {
613             xmlElement.addAttribute(new Attribute("alias", alias)); //$NON-NLS-1$
614         }
615 
616         if (stringHasValue(domainObjectName)) {
617             xmlElement.addAttribute(new Attribute(
618                     "domainObjectName", domainObjectName)); //$NON-NLS-1$
619         }
620 
621         if (!insertStatementEnabled) {
622             xmlElement.addAttribute(new Attribute("enableInsert", "false")); //$NON-NLS-1$ //$NON-NLS-2$
623         }
624 
625         if (!selectByPrimaryKeyStatementEnabled) {
626             xmlElement.addAttribute(new Attribute(
627                     "enableSelectByPrimaryKey", "false")); //$NON-NLS-1$ //$NON-NLS-2$
628         }
629 
630         if (!selectByExampleStatementEnabled) {
631             xmlElement.addAttribute(new Attribute(
632                     "enableSelectByExample", "false")); //$NON-NLS-1$ //$NON-NLS-2$
633         }
634 
635         if (!updateByPrimaryKeyStatementEnabled) {
636             xmlElement.addAttribute(new Attribute(
637                     "enableUpdateByPrimaryKey", "false")); //$NON-NLS-1$ //$NON-NLS-2$
638         }
639 
640         if (!deleteByPrimaryKeyStatementEnabled) {
641             xmlElement.addAttribute(new Attribute(
642                     "enableDeleteByPrimaryKey", "false")); //$NON-NLS-1$ //$NON-NLS-2$
643         }
644 
645         if (!deleteByExampleStatementEnabled) {
646             xmlElement.addAttribute(new Attribute(
647                     "enableDeleteByExample", "false")); //$NON-NLS-1$ //$NON-NLS-2$
648         }
649 
650         if (!countByExampleStatementEnabled) {
651             xmlElement.addAttribute(new Attribute(
652                     "enableCountByExample", "false")); //$NON-NLS-1$ //$NON-NLS-2$
653         }
654 
655         if (!updateByExampleStatementEnabled) {
656             xmlElement.addAttribute(new Attribute(
657                     "enableUpdateByExample", "false")); //$NON-NLS-1$ //$NON-NLS-2$
658         }
659 
660         if (stringHasValue(selectByPrimaryKeyQueryId)) {
661             xmlElement.addAttribute(new Attribute(
662                     "selectByPrimaryKeyQueryId", selectByPrimaryKeyQueryId)); //$NON-NLS-1$
663         }
664 
665         if (stringHasValue(selectByExampleQueryId)) {
666             xmlElement.addAttribute(new Attribute(
667                     "selectByExampleQueryId", selectByExampleQueryId)); //$NON-NLS-1$
668         }
669 
670         if (configuredModelType != null) {
671             xmlElement.addAttribute(new Attribute(
672                     "modelType", configuredModelType)); //$NON-NLS-1$
673         }
674 
675         if (wildcardEscapingEnabled) {
676             xmlElement.addAttribute(new Attribute("escapeWildcards", "true")); //$NON-NLS-1$ //$NON-NLS-2$
677         }
678 
679         if (isAllColumnDelimitingEnabled) {
680             xmlElement.addAttribute(new Attribute("delimitAllColumns", "true")); //$NON-NLS-1$ //$NON-NLS-2$
681         }
682 
683         if (delimitIdentifiers) {
684             xmlElement
685                     .addAttribute(new Attribute("delimitIdentifiers", "true")); //$NON-NLS-1$ //$NON-NLS-2$
686         }
687 
688         addPropertyXmlElements(xmlElement);
689 
690         if (generatedKey != null) {
691             xmlElement.addElement(generatedKey.toXmlElement());
692         }
693 
694         if (columnRenamingRule != null) {
695             xmlElement.addElement(columnRenamingRule.toXmlElement());
696         }
697 
698         if (ignoredColumns.size() > 0) {
699             for (IgnoredColumn ignoredColumn : ignoredColumns.keySet()) {
700                 xmlElement.addElement(ignoredColumn.toXmlElement());
701             }
702         }
703 
704         if (columnOverrides.size() > 0) {
705             for (ColumnOverride columnOverride : columnOverrides) {
706                 xmlElement.addElement(columnOverride.toXmlElement());
707             }
708         }
709 
710         return xmlElement;
711     }
712 
713     /* (non-Javadoc)
714      * @see java.lang.Object#toString()
715      */
716     @Override
717     public String toString() {
718         return composeFullyQualifiedTableName(catalog, schema,
719                 tableName, '.');
720     }
721 
722     /**
723      * Checks if is delimit identifiers.
724      *
725      * @return true, if is delimit identifiers
726      */
727     public boolean isDelimitIdentifiers() {
728         return delimitIdentifiers;
729     }
730 
731     /**
732      * Sets the delimit identifiers.
733      *
734      * @param delimitIdentifiers
735      *            the new delimit identifiers
736      */
737     public void setDelimitIdentifiers(boolean delimitIdentifiers) {
738         this.delimitIdentifiers = delimitIdentifiers;
739     }
740 
741     /**
742      * Checks if is count by example statement enabled.
743      *
744      * @return true, if is count by example statement enabled
745      */
746     public boolean isCountByExampleStatementEnabled() {
747         return countByExampleStatementEnabled;
748     }
749 
750     /**
751      * Sets the count by example statement enabled.
752      *
753      * @param countByExampleStatementEnabled
754      *            the new count by example statement enabled
755      */
756     public void setCountByExampleStatementEnabled(
757             boolean countByExampleStatementEnabled) {
758         this.countByExampleStatementEnabled = countByExampleStatementEnabled;
759     }
760 
761     /**
762      * Checks if is update by example statement enabled.
763      *
764      * @return true, if is update by example statement enabled
765      */
766     public boolean isUpdateByExampleStatementEnabled() {
767         return updateByExampleStatementEnabled;
768     }
769 
770     /**
771      * Sets the update by example statement enabled.
772      *
773      * @param updateByExampleStatementEnabled
774      *            the new update by example statement enabled
775      */
776     public void setUpdateByExampleStatementEnabled(
777             boolean updateByExampleStatementEnabled) {
778         this.updateByExampleStatementEnabled = updateByExampleStatementEnabled;
779     }
780 
781     /**
782      * Validate.
783      *
784      * @param errors
785      *            the errors
786      * @param listPosition
787      *            the list position
788      */
789     public void validate(List<String> errors, int listPosition) {
790         if (!stringHasValue(tableName)) {
791             errors.add(getString(
792                     "ValidationError.6", Integer.toString(listPosition))); //$NON-NLS-1$
793         }
794 
795         String fqTableName = composeFullyQualifiedTableName(
796                 catalog, schema, tableName, '.');
797 
798         if (generatedKey != null) {
799             generatedKey.validate(errors, fqTableName);
800         }
801 
802         // when using column indexes, either both or neither query ids
803         // should be set
804         if (isTrue(getProperty(PropertyRegistry.TABLE_USE_COLUMN_INDEXES))
805                 && selectByExampleStatementEnabled
806                 && selectByPrimaryKeyStatementEnabled) {
807             boolean queryId1Set = stringHasValue(selectByExampleQueryId);
808             boolean queryId2Set = stringHasValue(selectByPrimaryKeyQueryId);
809 
810             if (queryId1Set != queryId2Set) {
811                 errors.add(getString("ValidationError.13", //$NON-NLS-1$
812                         fqTableName));
813             }
814         }
815 
816         if (columnRenamingRule != null) {
817             columnRenamingRule.validate(errors, fqTableName);
818         }
819 
820         for (ColumnOverride columnOverride : columnOverrides) {
821             columnOverride.validate(errors, fqTableName);
822         }
823 
824         for (IgnoredColumn ignoredColumn : ignoredColumns.keySet()) {
825             ignoredColumn.validate(errors, fqTableName);
826         }
827     }
828 
829     /**
830      * Gets the column renaming rule.
831      *
832      * @return the column renaming rule
833      */
834     public ColumnRenamingRule getColumnRenamingRule() {
835         return columnRenamingRule;
836     }
837 
838     /**
839      * Sets the column renaming rule.
840      *
841      * @param columnRenamingRule
842      *            the new column renaming rule
843      */
844     public void setColumnRenamingRule(ColumnRenamingRule columnRenamingRule) {
845         this.columnRenamingRule = columnRenamingRule;
846     }
847 
848     /**
849      * Checks if is all column delimiting enabled.
850      *
851      * @return true, if is all column delimiting enabled
852      */
853     public boolean isAllColumnDelimitingEnabled() {
854         return isAllColumnDelimitingEnabled;
855     }
856 
857     /**
858      * Sets the all column delimiting enabled.
859      *
860      * @param isAllColumnDelimitingEnabled
861      *            the new all column delimiting enabled
862      */
863     public void setAllColumnDelimitingEnabled(
864             boolean isAllColumnDelimitingEnabled) {
865         this.isAllColumnDelimitingEnabled = isAllColumnDelimitingEnabled;
866     }
867 }