#*
说明文档:
属性
$packageName 选择的包名
$author 设置中的作者
$encode 设置的编码
$modulePath 选中的module路径
$projectPath 项目绝对路径
对象
$tableInfo 表对象
obj 表原始对象
name 表名(转换后的首字母大写)
comment 表注释
fullColumn 所有列
pkColumn 主键列
otherColumn 其他列
savePackageName 保存的包名
savePath 保存路径
saveModelName 保存的model名称
columnInfo 列对象
obj 列原始对象
name 列名(首字母小写)
comment 列注释
type 列类型(类型全名)
ext 附加字段(Map类型)
$tableInfoList 所有选中的表
$importList 所有需要导入的包集合
回调
&callback
setFileName(String) 设置文件储存名字
setSavePath(String) 设置文件储存路径,默认使用选中路径
工具
$tool
firstUpperCase(String) 首字母大写方法
firstLowerCase(String) 首字母小写方法
getClsNameByFullName(String) 通过包全名获取类名
getJavaName(String) 将下划线分割字符串转驼峰命名(属性名)
getClassName(String) 将下划线分割字符串转驼峰命名(类名)
append(… Object) 多个数据进行拼接
$time
currTime(String) 获取当前时间,指定时间格式(默认:yyyy-MM-dd HH:mm:ss)
*#
##设置包路径
##设置回调
!
c
a
l
l
b
a
c
k
.
s
e
t
F
i
l
e
N
a
m
e
(
!callback.setFileName(
!callback.setFileName(tool.append($tableInfo.name, “.java”))
!
c
a
l
l
b
a
c
k
.
s
e
t
S
a
v
e
P
a
t
h
(
!callback.setSavePath(
!callback.setSavePath(tool.append(KaTeX parse error: Expected 'EOF', got '#' at position 27: …avePath, "/")) #̲if(tableInfo.savePackageName)package $!{tableInfo.savePackageName}#{end};
#foreach($import in $importList)
import $!import;
#end
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Entity;
import org.hibernate.annotations.GenericGenerator;
import java.io.Serializable;
/**
- @description ! t a b l e I n f o . c o m m e n t ( !{tableInfo.comment}( !tableInfo.comment(tableInfo.obj.getName())表实体类
- @author $author
- @date
!
t
i
m
e
.
c
u
r
r
T
i
m
e
(
)
∗
/
@
E
n
t
i
t
y
@
T
a
b
l
e
(
n
a
m
e
=
"
!time.currTime() */ @Entity @Table(name = "
!time.currTime()∗/@Entity@Table(name="tableInfo.obj.getName()")
public class KaTeX parse error: Expected '}', got '#' at position 45: …Serializable { #̲foreach(column in KaTeX parse error: Expected 'EOF', got '#' at position 23: …fo.fullColumn) #̲if({velocityCount} == 1)
#end
#if(${column.comment})
/**
* ${column.comment}
*/
#end
private KaTeX parse error: Expected '}', got 'EOF' at end of input: …NameByFullName(column.type)} $!{column.name};
#end
#foreach($column in KaTeX parse error: Expected 'EOF', got '#' at position 23: …fo.fullColumn) #̲if({velocityCount} == 1)
@Id
@Column(name = “KaTeX parse error: Expected 'EOF', got '#' at position 138: …"system-uuid") #̲else @Colum…column.obj.getName()”)
#end
public KaTeX parse error: Expected '}', got 'EOF' at end of input: …NameByFullName(column.type)} getKaTeX parse error: Expected '}', got 'EOF' at end of input: …firstUpperCase(column.name)}() {
return $!{column.name};
}
public void set$!{tool.firstUpperCase($column.name)}($!{tool.getClsNameByFullName($column.type)} $!{column.name}) {
this.$!{column.name} = $!{column.name};
}
#end
}
————————————————
版权声明:本文为优快云博主「chenhq_」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.youkuaiyun.com/chenhq_/article/details/82693715