Merge branch 'mybatis-flex:main' into main

This commit is contained in:
Jiabin Zhuang 2023-06-08 09:08:38 +08:00 committed by GitHub
commit 53b1c72a22
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 21 additions and 1 deletions

View File

@ -47,6 +47,10 @@ select * from tb_account
where id >= 100
```
::: tip 问题:以上示例中,`ACCOUNT.ID.ge(100)` 中的 `ACCOUNT` 是怎么来的?
MyBatis-Flex 使用了 APT 技术,这个 `ACCOUNT` 是自动生成的。
参考:《[MyBatis-Flex APT 配置](../others/apt.md)》章节。
:::
## select *

View File

@ -73,10 +73,12 @@ public class ControllerGenerator implements IGenerator {
globalConfig.getTemplateConfig().getTemplate().generate(params, templatePath, controllerJavaFile);
}
@Override
public String getTemplatePath() {
return templatePath;
}
@Override
public void setTemplatePath(String templatePath) {
this.templatePath = templatePath;
}

View File

@ -73,10 +73,12 @@ public class EntityGenerator implements IGenerator {
globalConfig.getTemplateConfig().getTemplate().generate(params, templatePath, entityJavaFile);
}
@Override
public String getTemplatePath() {
return templatePath;
}
@Override
public void setTemplatePath(String templatePath) {
this.templatePath = templatePath;
}

View File

@ -73,10 +73,12 @@ public class MapperGenerator implements IGenerator {
globalConfig.getTemplateConfig().getTemplate().generate(params, templatePath, mapperJavaFile);
}
@Override
public String getTemplatePath() {
return templatePath;
}
@Override
public void setTemplatePath(String templatePath) {
this.templatePath = templatePath;
}

View File

@ -70,10 +70,12 @@ public class MapperXmlGenerator implements IGenerator {
globalConfig.getTemplateConfig().getTemplate().generate(params, templatePath, mapperXmlFile);
}
@Override
public String getTemplatePath() {
return templatePath;
}
@Override
public void setTemplatePath(String templatePath) {
this.templatePath = templatePath;
}

View File

@ -88,10 +88,12 @@ public class PackageInfoGenerator implements IGenerator {
});
}
@Override
public String getTemplatePath() {
return templatePath;
}
@Override
public void setTemplatePath(String templatePath) {
this.templatePath = templatePath;
}

View File

@ -73,10 +73,12 @@ public class ServiceGenerator implements IGenerator {
globalConfig.getTemplateConfig().getTemplate().generate(params, templatePath, serviceJavaFile);
}
@Override
public String getTemplatePath() {
return templatePath;
}
@Override
public void setTemplatePath(String templatePath) {
this.templatePath = templatePath;
}

View File

@ -73,10 +73,12 @@ public class ServiceImplGenerator implements IGenerator {
globalConfig.getTemplateConfig().getTemplate().generate(params, templatePath, serviceImplJavaFile);
}
@Override
public String getTemplatePath() {
return templatePath;
}
@Override
public void setTemplatePath(String templatePath) {
this.templatePath = templatePath;
}

View File

@ -73,10 +73,12 @@ public class TableDefGenerator implements IGenerator {
globalConfig.getTemplateConfig().getTemplate().generate(params, templatePath, tableDefJavaFile);
}
@Override
public String getTemplatePath() {
return templatePath;
}
@Override
public void setTemplatePath(String templatePath) {
this.templatePath = templatePath;
}

View File

@ -34,7 +34,7 @@ public class EnjoyTemplate implements ITemplate {
public EnjoyTemplate() {
engine = Engine.create("mybatis-flex", engine -> {
engine.addSharedMethod(StringUtil.class);
engine.addSharedStaticMethod(StringUtil.class);
engine.setSourceFactory(new FileAndClassPathSourceFactory());
});
// 以下配置将支持 user.girl 表达式去调用 user 对象的 boolean isGirl() 方法