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.internal.rules;
17  
18  import org.mybatis.generator.api.IntrospectedTable;
19  
20  /**
21   * This class encapsulates all the code generation rules for a table using the
22   * flat model.
23   * 
24   * @author Jeff Butler
25   * 
26   */
27  public class FlatModelRules extends BaseRules {
28  
29      /**
30       * Instantiates a new flat model rules.
31       *
32       * @param introspectedTable
33       *            the introspected table
34       */
35      public FlatModelRules(IntrospectedTable introspectedTable) {
36          super(introspectedTable);
37      }
38  
39      /**
40       * We never generate a primary key in the flat model.
41       * 
42       * @return true if the primary key should be generated
43       */
44      public boolean generatePrimaryKeyClass() {
45          return false;
46      }
47  
48      /**
49       * We always generate a base record in the flat model.
50       * 
51       * @return true if the class should be generated
52       */
53      public boolean generateBaseRecordClass() {
54          return true;
55      }
56  
57      /**
58       * We never generate a record with BLOBs class in the flat model.
59       * 
60       * @return true if the record with BLOBs class should be generated
61       */
62      public boolean generateRecordWithBLOBsClass() {
63          return false;
64      }
65  }