我如何使用 hibernate.reveng 生成 @Enumerated
我自己遇到了这个问题,我设法枚举了作为外键的实体的属性(简单的目录->实体场景),但是每次更新我的bean时我都必须执行此过程:
@Column(name = "idcampaign_status", nullable = false)
@Enumerated(EnumType.ORDINAL)
public CampaignStatus getCampaignStatus() {
return this.campaignStatus;
}
我还排除了生成的CampaignStatus,因为它将是 reveng 文件上的枚举:
<table-filter match-name="campaign_status"
match-catalog="mycatalog" exclude="true">
</table-filter>
那么有没有一种方法可以使用 hibernate.reveng 来执行此操作,指定枚举器或我可以用作替代方案的自定义创建工具。或者在这种情况下有什么策略可以继续进行?
i encounter myself with this problem, i managed to enumerate attributes of an entity that are Foreign keys (simple catalog->entity scenario) nevertheless i must do this process everytime that i update my beans:
@Column(name = "idcampaign_status", nullable = false)
@Enumerated(EnumType.ORDINAL)
public CampaignStatus getCampaignStatus() {
return this.campaignStatus;
}
I also exclude the CampaignStatus for the generation since it will be a enum on reveng file:
<table-filter match-name="campaign_status"
match-catalog="mycatalog" exclude="true">
</table-filter>
So is there a way to do this with hibernate.reveng, specify the enumerator or a custom creation tool that i can use as an alternative. Or any strategy to proceed in this case?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
似乎 Hibernate.reveng 具有属性类型,以便在代码生成中指定类型,我这样解决了它:
无论如何,谢谢
Seems that Hibernate.reveng has the property type in order to specify a Type in the Code generation i solved it like this:
Thanks anyway