Class HierarchicalModelRules
java.lang.Object
org.mybatis.generator.internal.rules.BaseRules
org.mybatis.generator.internal.rules.HierarchicalModelRules
- All Implemented Interfaces:
Rules
This class encapsulates all the code generation rules for a table using the
hierarchical model.
- Author:
- Jeff Butler
-
Field Summary
Fields inherited from class org.mybatis.generator.internal.rules.BaseRules
introspectedTable, isModelOnly, tableConfiguration
-
Constructor Summary
ConstructorDescriptionHierarchicalModelRules
(IntrospectedTable introspectedTable) Instantiates a new hierarchical model rules. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Implements the rule for generating a base record.boolean
Implements the rule for determining whether to generate a primary key class.boolean
Implements the rule for generating a record with BLOBs.Methods inherited from class org.mybatis.generator.internal.rules.BaseRules
calculateAllFieldsClass, generateBaseColumnList, generateBaseResultMap, generateBlobColumnList, generateCountByExample, generateDeleteByExample, generateDeleteByPrimaryKey, generateExampleClass, generateInsert, generateInsertSelective, generateJavaClient, generateMyBatis3UpdateByExampleWhereClause, generateResultMapWithBLOBs, generateSelectByExampleWithBLOBs, generateSelectByExampleWithoutBLOBs, generateSelectByPrimaryKey, generateSQLExampleWhereClause, generateUpdateByExampleSelective, generateUpdateByExampleWithBLOBs, generateUpdateByExampleWithoutBLOBs, generateUpdateByPrimaryKeySelective, generateUpdateByPrimaryKeyWithBLOBs, generateUpdateByPrimaryKeyWithoutBLOBs, getIntrospectedTable
-
Constructor Details
-
HierarchicalModelRules
Instantiates a new hierarchical model rules.- Parameters:
introspectedTable
- the introspected table
-
-
Method Details
-
generatePrimaryKeyClass
public boolean generatePrimaryKeyClass()Implements the rule for determining whether to generate a primary key class. If the physical table has a primary key, then we generate the class.- Returns:
- true if the primary key should be generated
-
generateBaseRecordClass
public boolean generateBaseRecordClass()Implements the rule for generating a base record. If the table has fields that are not in the primary key, and non-BLOB fields, then generate the class.- Returns:
- true if the class should be generated
-
generateRecordWithBLOBsClass
public boolean generateRecordWithBLOBsClass()Implements the rule for generating a record with BLOBs. A record with BLOBs is generated if the table contains any BLOB fields.- Returns:
- true if the record with BLOBs class should be generated
-