org.apache.ibatis.ibator.internal.rules
Class HierarchicalModelRules

java.lang.Object
  extended by org.apache.ibatis.ibator.internal.rules.IbatorRules
      extended by org.apache.ibatis.ibator.internal.rules.HierarchicalModelRules

public class HierarchicalModelRules
extends IbatorRules

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.apache.ibatis.ibator.internal.rules.IbatorRules
introspectedTable, tableConfiguration
 
Constructor Summary
HierarchicalModelRules(TableConfiguration tableConfiguration, IntrospectedTable introspectedTable)
           
 
Method Summary
 boolean generateBaseRecordClass()
          Implements the rule for generating a base record.
 boolean generatePrimaryKeyClass()
          Implements the rule for determining whether to generate a primary key class.
 boolean generateRecordWithBLOBsClass()
          Implements the rule for generating a record with BLOBs.
 
Methods inherited from class org.apache.ibatis.ibator.internal.rules.IbatorRules
calculateAllFieldsClass, generateBaseResultMap, generateCountByExample, generateDeleteByExample, generateDeleteByPrimaryKey, generateExampleClass, generateInsert, generateInsertSelective, generateResultMapWithBLOBs, generateSelectByExampleWithBLOBs, generateSelectByExampleWithoutBLOBs, generateSelectByPrimaryKey, generateSQLExampleWhereClause, generateUpdateByExampleSelective, generateUpdateByExampleWithBLOBs, generateUpdateByExampleWithoutBLOBs, generateUpdateByPrimaryKeySelective, generateUpdateByPrimaryKeyWithBLOBs, generateUpdateByPrimaryKeyWithoutBLOBs
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HierarchicalModelRules

public HierarchicalModelRules(TableConfiguration tableConfiguration,
                              IntrospectedTable introspectedTable)
Method Detail

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.

Specified by:
generatePrimaryKeyClass in class IbatorRules
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.

Specified by:
generateBaseRecordClass in class IbatorRules
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.

Specified by:
generateRecordWithBLOBsClass in class IbatorRules
Returns:
true if the record with BLOBs class should be generated