您的位置:首页 > 编程语言 > Java开发

快速生成 java bean 工具

2017-07-19 00:00 127 查看
摘要: 自己做的一个开发中常用工具

快速生成 java bean 工具

在写代码过程中经常会去写一张表的column,当一张表中内有五六十个字段的时候特别容易写错,本工具是快速生成 java Field 的一个工具,避免在写实体类过程中把字段名写错而诞生此工具



效果:

@NotNull(message="参数[theId]不能为空")
@Max(999999999)
private Long theId;//自增ID [the_id, 10]
@NotNull(message="参数[theName]不能为空")
@Length(message="参数[the_name]长度不能超过16", max = 16)
private String theName;//名 [the_name, 16]
@NotNull(message="参数[theValue]不能为空")
@Length(message="参数[the_value]长度不能超过32767", max = 32767)
private String theValue;//值 [the_value, 32767]
private byte[] thepic;//图片 [thePic, 65535]
@NotNull(message="参数[thenum]不能为空")
@Max(999999999)
private BigDecimal thenum;//number [theNum, 10]
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date thedate;//日期 [theDate, null]
private Timestamp thedatetime;//时间戳 [theDatetime, null]
@NotNull(message="参数[theDouble]不能为空")
@Max(999999999999999999999)
private Double theDouble;//Double [the_double, 22]
@NotNull(message="参数[theFloat]不能为空")
@Max(99999999999)
private Float theFloat;//浮点 [the_float, 12]
@NotNull(message="参数[theinteger]不能为空")
@Max(999999999)
private Long theinteger;//大Int(Integer) [theInteger, 10]
@NotNull(message="参数[theChar]不能为空")
@Length(message="参数[the_char]长度不能超过127", max = 127)
private String theChar;//字节 char [the_char, 127]
//共[11]个字段

git地址:http://git.oschina.net/zgdhd/JavaDBField

如果觉得还不错,请点个赞
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息