开发者

How can i generate @Enumerated with 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:

开发者_JAVA技巧
@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?


Seems that Hibernate.reveng has the property type in order to specify a Type in the Code generation i solved it like this:

<column name="iduser_type"  type="UserType" />

Thanks anyway

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜