The <commentGenerator> Element
The <commentGenerator> element is used to define properties of the Comment Generator. The Comment Generator is used to generate comments for the various elements generated by MyBatis Generator (MBG) (Java fields, Java methods, XML elements, etc.). The default Comment Generator adds JavaDoc comments to all generated Java elements to enable the Java merge functionality in the Eclipse plugin. Also, comments are added to each generated XML element. The purpose of the comments is also to inform users that the elements are generated and are subject to regeneration (i.e. - they shouldn't be altered). This element is an optional child element of the <context> element.
The default implementation is org.mybatis.generator.internal.DefaultCommentGenerator. The default implementation is designed for extensibility if you only want to modify certain behaviors.
Optional Attributes
Attribute | Description |
---|---|
type | This may be used to specify the type of the user provided Comment Generator. The class must implement the interface org.mybatis.generator.api.CommentGenerator and must have a public default constructor. The attribute also accepts the special value DEFAULT in which case the default implementation will be used (this has the same effect as not specifying the type). |
Child Elements
- <property> (0..N)
Supported Properties
This table lists the properties of the default comment generator that can be specified with the <property> child element:
Property Name | Property Values | ||||
---|---|---|---|---|---|
suppressAllComments |
This property is used to specify whether MBG will include any coments in the
generated code.
The property supports these values:
Warning: if you set this value to true, then all code merging will be disabled. |
||||
suppressDate |
This property is used to specify whether MBG will include the generation
timestamp in the generated comments.
The property supports these values:
|