If my plan is not clear enough, I can give more details.
i have to generate certain JPA classes from a db at intervals of a couple of days. After generation I have to adapt some classes by hand, because of some biderectional relations. There I have to change the cascade attribute in the one-to-many part of the relation. I have to change it from
Code:
@OneToMany(cascade=CascadeType.ALL,fetch = FetchType.LAZY, mappedBy = "lsLdpWagen")
public Set<LsLdpFbaBetragTmZo> getLsLdpFbaBetragTmZos() {
return this.lsLdpFbaBetragTmZos;
}
to
Code:
@OneToMany(cascade={CascadeType.REFRESH,CascadeType.REMOVE},fetch = FetchType.LAZY, mappedBy = "lsLdpWagen")
public Set<LsLdpFbaBetragTmZo> getLsLdpFbaBetragTmZos() {
return this.lsLdpFbaBetragTmZos;
}
Best case would be adapted customizations via generation process automatically.
I'm not sure which approach to choose. As I mentioned before, I tried to solve it via hibernate.reveng.xml or to implement a custom strategy but nothing gave me the possibiliy for my comprehension.
I have no idea.
Thx for some advice!
Mario