|
#macro ( accessM $name $type )
|
public #javatype02(${type}) get#lucf02($name)() {
|
return this.$name;
|
}
|
|
public void set#lucf02($name)(#javatype02(${type}) ${name}) {
|
this.${name} = ${name};
|
this.isset_${name} = true;
|
}
|
|
@JsonIgnore
|
public boolean isEmpty#lucf02($name)() {
|
#if (${stringUtils.getJavaType($type)} == "String")
|
return this.${name} == null || this.${name}.length() == 0;
|
#else
|
return this.${name} == null;
|
#end
|
}
|
#end
|
|
#macro ( lower02 $value )${value.toLowerCase()}#end
|
#macro ( upper02 $value )${value.toUpperCase()}#end
|
#macro ( lcf02 $name )${stringUtils.toLowerCaseFirst($name)}#end
|
#macro ( ucf02 $name )${stringUtils.toUpperCaseFirst($name)}#end
|
#macro ( lucf02 $value )${stringUtils.toUpperCaseFirst(${value.toLowerCase()})}#end
|
#macro ( javatype02 $type )${stringUtils.getJavaType($type)}#end##
|
#############################################################################################
|
package com.iplatform.model.po;
|
|
import com.fasterxml.jackson.annotation.JsonAutoDetect;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
import com.walker.jdbc.BasePo;
|
|
/**
|
* 表名:#upper02($table_name)
|
*
|
* @author genrator
|
*/
|
@JsonAutoDetect(fieldVisibility = JsonAutoDetect.Visibility.ANY)
|
public class #lucf02($table_name) extends BasePo<#lucf02($table_name)> {
|
// 序列化版本号
|
private static final long serialVersionUID = 1L;
|
|
## 主键
|
// 主键
|
private #javatype02(${pk_type}) ${pk_name} = null;
|
@JsonIgnore
|
protected boolean isset_${pk_name} = false;
|
|
## 属性
|
// 属性列表
|
#foreach ($property in $columns)
|
private #javatype02($property.type) ${property.name} = null;
|
@JsonIgnore
|
protected boolean isset_${property.name} = false;
|
|
#end
|
/**
|
* 默认构造函数
|
*/
|
public #lucf02(${table_name})() {
|
}
|
|
/**
|
* 根据主键构造对象
|
*/
|
public #lucf02(${table_name})(#javatype02(${pk_type}) ${pk_name}) {
|
this.set#ucf02(${pk_name})(${pk_name});
|
}
|
|
/**
|
* 设置主键值
|
*/
|
@Override
|
public void setPkValue(Object value) {
|
this.set#ucf02(${pk_name})((#javatype02(${pk_type})) value);
|
}
|
|
## 2023-05-16
|
## 主键 get set
|
public #javatype02(${pk_type}) get#lucf02(${pk_name})() {
|
return this.${pk_name};
|
}
|
public void set#lucf02(${pk_name})(#javatype02(${pk_type}) ${pk_name}) {
|
this.${pk_name} = ${pk_name};
|
this.isset_${pk_name} = true;
|
}
|
@JsonIgnore
|
public boolean isEmpty#lucf02(${pk_name})() {
|
#if (${stringUtils.getJavaType(${pk_type})} == "String")
|
return this.${pk_name} == null || this.${pk_name}.length() == 0;
|
#else
|
return this.${pk_name} == null;
|
#end
|
}
|
|
##属性setter getter isEmpty
|
#foreach ($property in $columns)
|
|
public #javatype02(${property.type}) get#lucf02(${property.name})() {
|
return this.${property.name};
|
}
|
public void set#lucf02(${property.name})(#javatype02(${property.type}) ${property.name}) {
|
this.${property.name} = ${property.name};
|
this.isset_${property.name} = true;
|
##// ${property.name}, ${property.type}
|
}
|
@JsonIgnore
|
public boolean isEmpty#lucf02(${property.name})() {
|
#if (${stringUtils.getJavaType(${property.type})} == "String")
|
return this.${property.name} == null || this.${property.name}.length() == 0;
|
#else
|
return this.${property.name} == null;
|
#end
|
}
|
|
#end
|
|
/**
|
* 重写 toString() 方法
|
*/
|
@Override
|
public String toString() {
|
return new StringBuilder()
|
.append("${pk_name}=").append(this.${pk_name})
|
#foreach ($property in $columns)
|
.append("${property.name}=").append(this.${property.name})
|
#end
|
.toString();
|
}
|
|
/**
|
* 克隆
|
*/
|
public #lucf02($table_name) $clone() {
|
#lucf02($table_name) #lower02($table_name) = new #lucf02($table_name)();
|
|
// 数据库名称
|
//#lower02($table_name).setDatabaseName_(this.getDatabaseName_());
|
|
// 主键
|
if (this.isset_${pk_name}) {
|
#lower02($table_name).set#ucf02(${pk_name})(this.get#ucf02(${pk_name})());
|
}
|
// 普通属性
|
#foreach ($property in $columns)
|
if (this.isset_${property.name}) {
|
#lower02($table_name).set#ucf02($property.name)(this.get#ucf02($property.name)());
|
}
|
#end
|
return #lower02($table_name);
|
}
|
}
|