Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ Then, in your MyBatis Generator configuration, include the plugin:

<!-- disable annotations -->
<property name="allArgsConstructor" value="false"/>

<!-- disable @Mapper annotations -->
<property name="mapper" value="false"/>
</plugin>

<!-- other configurations -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ public class LombokPlugin extends PluginAdapter {

private final Collection<Annotations> annotations;

private final String MAPPER = "mapper";

/**
* LombokPlugin constructor
*/
Expand Down Expand Up @@ -189,9 +191,12 @@ public boolean clientGenerated(
TopLevelClass topLevelClass,
IntrospectedTable introspectedTable
) {
interfaze.addImportedType(new FullyQualifiedJavaType(
"org.apache.ibatis.annotations.Mapper"));
interfaze.addAnnotation("@Mapper");
String excludeMapper = this.properties.getProperty(MAPPER, "true");
if(Boolean.parseBoolean(excludeMapper)) {
interfaze.addImportedType(new FullyQualifiedJavaType(
"org.apache.ibatis.annotations.Mapper"));
interfaze.addAnnotation("@Mapper");
}
return true;
}

Expand Down