jhipster通过jdl生成实体代码时解析parse问题

entity SmsMt {
	id Long,
    epId Long,
    accountId Long,
    accountName String,
    appName String,
    destNumber String,
    content String,
    sign String,
    messageId String,
    submitTime LocalDate,
    submitStatus String,
    reportTime LocalDate,
    reportStatus String,
    redeemCode String,
    redeemBeginDate LocalDate,
    redeemEndDate LocalDate,
    redeemStatus Boolean,
    redeemAccountId Long,
    redeemAccountName String,
    couponId Long,
	scanStartTime LocalDate,
    memberId Long
}

entity DataTask {
	id Long,
    spId Integer,
    epId Long,
    accountId Long,
    accountName String,
    appName String,
    messageType enum,
    taskType String,
    content String,
    destFilePath String,
    extSrc String,
    createTime LocalDate,
    orderTime LocalDate,
    totalNum Integer,
    checkStatus String,
    previewNotice String,
    checkNotice String,
    optTime LocalDate,
    optName String,
    newDest String,
    submitFlag String,
    messageId String,
    submitStatus String,
    submitDetail String,
    optIp String
}

dto * with mapstruct
service all with serviceImpl

当执行命令jhipster import-jdl smsmt.jh,会出现下面错误

为什么出现这个问题呢。那是因为jdl文件中定义的字段类型jdl解析不出来。所以报错了而且提醒的很清楚在1.33这个未知,通过查看不难发现刚好对应的字段给的类型是enum。该类型是无法解析的。必须将enum换成别的类型,比如String即可。从中可发现目前jhipster对类型的支持还不是很完善。

也许你会问。但是业务中改字段必须是enum呀。很简单,使用jhipster只是简化初期项目搭建的简单性。为了业务需求,你可以在jhipster将基本项目代码生成完成后。手动将自动生成的实体代码以及liquibase文件中该字段改成enum。修改完成后,启动项目。你会愉快的发现通过liquibase生成的数据库表中该字段已经是enum了。

  快来和博主打成一片吧^_^

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值