-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: influence cascade param with revenge engineering
PostPosted: Tue Nov 25, 2008 11:59 am 
Newbie

Joined: Thu Nov 13, 2008 8:21 am
Posts: 8
Hibernate version: Hibernate Tools 3.2.2.Beta1

I want to influence the cascade param of a one-two-many relation with the process of reverse engineer db tables.

The hibernate.reveng.xml doesn't give me possibility to set it.

I also evaluated an implementation of DelegatingReverseEngineeringStrategy but it doesn't seemed to be the right approach as well. There is no method defined which I can assign to my claim.

What is the solution here?

Mario


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 28, 2008 4:55 am 
Newbie

Joined: Thu Nov 13, 2008 8:21 am
Posts: 8
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.