mirror of
https://gitee.com/mybatis-flex/mybatis-flex.git
synced 2025-12-08 09:38:26 +08:00
Merge branch 'mybatis-flex:main' into main
This commit is contained in:
commit
53b1c72a22
@ -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 *
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -88,10 +88,12 @@ public class PackageInfoGenerator implements IGenerator {
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getTemplatePath() {
|
||||
return templatePath;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setTemplatePath(String templatePath) {
|
||||
this.templatePath = templatePath;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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() 方法
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user