提交 00f4e5d1 编写于 作者: chenxiang@lab.ibiz5.com's avatar chenxiang@lab.ibiz5.com

NoSQL:MongoDB适配 create update返回

上级 25dc4fe1
...@@ -8,6 +8,8 @@ import java.util.HashMap; ...@@ -8,6 +8,8 @@ import java.util.HashMap;
import java.math.BigInteger; import java.math.BigInteger;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import cn.ibizlab.util.domain.EntityMongo;
import com.alibaba.fastjson.annotation.JSONField; import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore; import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
...@@ -47,7 +49,7 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker; ...@@ -47,7 +49,7 @@ import com.baomidou.mybatisplus.core.toolkit.IdWorker;
@JsonIgnoreProperties(value = "handler") @JsonIgnoreProperties(value = "handler")
@Document(collection = "{{entity.codeName}}") @Document(collection = "{{entity.codeName}}")
@ApiModel(value = "{{entity.name}}", description = "{{entity.logicName}}") @ApiModel(value = "{{entity.name}}", description = "{{entity.logicName}}")
public class {{entity.codeName}} extends EntityMP implements Serializable public class {{entity.codeName}} extends EntityMongo implements Serializable
{ {
{{#each entity.fields}} {{#each entity.fields}}
......
...@@ -162,7 +162,8 @@ public class {{entity.codeName}}ServiceBase implements {{entity.codeName}}Servic ...@@ -162,7 +162,8 @@ public class {{entity.codeName}}ServiceBase implements {{entity.codeName}}Servic
if(!update(et, (Wrapper) et.getUpdateWrapper(true).eq("{{lowerCase entity.keyField.name}}", et.get{{pascalCase keyField.codeName}}()))) if(!update(et, (Wrapper) et.getUpdateWrapper(true).eq("{{lowerCase entity.keyField.name}}", et.get{{pascalCase keyField.codeName}}())))
return false; return false;
{{else}} {{else}}
{{camelCase entity.codeName}}Repository.insert(et); {{entity.codeName}} rt = {{camelCase entity.codeName}}Repository.insert(et);
BeanUtils.copyProperties(rt, et);
{{/if}} {{/if}}
{{#each entity.nesteds}} {{#each entity.nesteds}}
{{#if listCode}} {{#if listCode}}
...@@ -213,7 +214,8 @@ public class {{entity.codeName}}ServiceBase implements {{entity.codeName}}Servic ...@@ -213,7 +214,8 @@ public class {{entity.codeName}}ServiceBase implements {{entity.codeName}}Servic
{{camelCase entity.indexRelation.entityCodeName}}Service.save({{camelCase entity.indexRelation.entityCodeName}}); {{camelCase entity.indexRelation.entityCodeName}}Service.save({{camelCase entity.indexRelation.entityCodeName}});
{{/entity.isIndexSubDE}} {{/entity.isIndexSubDE}}
{{camelCase entity.codeName}}Repository.save(et); {{entity.codeName}} rt = {{camelCase entity.codeName}}Repository.save(et);
BeanUtils.copyProperties(rt, et);
{{#each entity.nesteds}} {{#each entity.nesteds}}
{{#if listCode}} {{#if listCode}}
{{#unless columnName}} {{#unless columnName}}
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册