shikeying
2024-01-11 3b67e947e36133e2a40eb2737b15ea375e157ea0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
#macro ( property $name $type )
    private $type $name;
#end
#macro ( vaccess $name $type )
    public #javatype(${type}) get#ucf($name)() {
        return this.$name;
    }
 
    public void set#ucf($name)(#javatype(${type}) ${name}) {
        this.${name} = ${name};
    }
#end
#macro ( lower $value )${value.toLowerCase()}#end
#macro ( upper $value )${value.toUpperCase()}#end
#macro ( lcf $name )${stringUtils.toLowerCaseFirst($name)}#end
#macro ( ucf $name )${stringUtils.toUpperCaseFirst($name)}#end
#macro ( lucf $value )${stringUtils.toUpperCaseFirst(${value.toLowerCase()})}#end
#macro ( javatype $type )${stringUtils.getJavaType($type)}#end
#############################################################################################
package com.iplatform.model.vo;
 
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
 
import java.io.Serializable;
 
 
/**
 * 表名:${table_name}
 *
 * @deprecated
 */
@deprecated
public class #lucf(${table_name})_t implements Serializable {
    // 序列化版本号
    private static final long serialVersionUID = 1L;
 
## 主键
    // 主键
    private #javatype(${pk_type}) ${pk_name} = null;
 
## 属性
    // 属性列表
#foreach ($property in $columns)
    private #javatype($property.type) ${property.name} = null;
 
#end
    /**
     * 默认构造函数
     */
    public #lucf(${table_name})_t() {
    }
 
    /**
     * 根据主键构造对象
     */
    public #lucf(${table_name})_t(#javatype(${pk_type}) ${pk_name}) {
        this.set#ucf(${pk_name})(${pk_name});
    }
 
    #vaccess(${pk_name} ${pk_type})
 
##属性setter getter
#foreach ($property in $columns)
    #vaccess(${property.name} ${property.type})
 
#end
 
    /**
     * 重写 toString() 方法
     */
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.DEFAULT_STYLE)
                .append("${pk_name}", this.${pk_name})
#foreach ($property in $columns)
                .append("${property.name}", this.${property.name})
#end  
                .toString();
    }
}