-->
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.  [ 3 posts ] 
Author Message
 Post subject: using reveng file with my reversestrategy
PostPosted: Mon Jun 30, 2008 3:55 am 
Newbie

Joined: Fri Jun 13, 2008 10:17 am
Posts: 18
Hi people,

I would like to know how to merge the work of a reversestrategy class with with a revengfile.

I mean, i wrote a reversestrategy class which will be used by other people, but they have to filter their tables (idealy with the reveng file system).

So is it posible to use a reveng file from the reversestrategy class, or any ohter way?

Thnak you by advance,
Regards,
Slimane Médini.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 02, 2008 4:12 am 
Newbie

Joined: Fri Jun 13, 2008 10:17 am
Posts: 18
OK, i see that what i request is already done, and i understood the DelegatingReverseEngineeringStrategy.

i rode l.50 from org.hibernate.tool.ant.JDBCConfigurationTask

Code:
      if(revengFiles!=null) {
         OverrideRepository or = new OverrideRepository();
         
         String[] fileNames = revengFiles.list();
         for (int i = 0; i < fileNames.length; i++) {
            or.addFile(new File(fileNames[i]) );
         }
         strategy = or.getReverseEngineeringStrategy(defaultStrategy);         
      }
      
      if(reverseEngineeringStrategyClass!=null) {
         strategy = loadreverseEngineeringStrategy(reverseEngineeringStrategyClass, strategy);         
      }


Top
 Profile  
 
 Post subject:
PostPosted: Sat Jul 12, 2008 7:39 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yes, if you are reveng class has a constructor it gets any existing reveng strategy it can delegate too if it wants ;)

The reveng strategy then work likes a chain-of-command pattern and works from most specific (your reveng strategy), through any reveng.xml and finally the default behavior.

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.