-->
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.  [ 6 posts ] 
Author Message
 Post subject: why is my ReverseEngineeringStrategy being ignored?
PostPosted: Tue Aug 25, 2009 5:17 am 
Newbie

Joined: Tue Aug 25, 2009 3:25 am
Posts: 6
I have defined a ReverseEngineeringStrategy but somehow it is being ignored. When I run hbm2hbmxml with the ant ask below, I get:
"Using non-delegating strategy, thus packagename and revengfile will be ignored."
Anyone know why this is?
java 1.6/hibernate tools 3.2.4
My ant task is defined as follows
Code:
  <target name="schemaexport">
        <hibernatetool destdir="${build.dir}/generated">
            <jdbcconfiguration propertyfile="hibernate.properties"
                               packagename="package.name"
                               reversestrategy="com.asm.persist.ReverseEngStrategy"
                               detectmanytomany="true"
                    >
                <fileset dir="${src.dir}">
                    <include name="**/*.hbm.xml"/>
                    <exclude name="**/*Test.hbm.xml"/>
                </fileset>
            </jdbcconfiguration>
             <hbm2hbmxml destdir="${build.dir}/src"  />
        </hibernatetool>
    </target>

public class ReverseEngStrategy extends DefaultReverseEngineeringStrategy {
    private HashSet excludeTables;
//    private static final String SCHEMA = "PRODDTA";
    private static final String SCHEMA = "CRPDTA";

    static {
        System.out.println("Am I really doing this!");
    }

    public ReverseEngStrategy() {
//        new ReverseEngineeringSettings()
//        super.setSettings();
//        get
    }

    public void init() {

    }
    @Override
    public boolean excludeTable(TableIdentifier tableIdentifier) {
        System.out.println("hallo");
       
        if (excludeTables == null) {
            excludeTables = new HashSet();
            excludeTables.add("F5541021");
            System.out.println("Cool we are running");
        }

        if (!tableIdentifier.getSchema().toUpperCase().equals(SCHEMA) ||
                excludeTables.contains(tableIdentifier.getName())) {

            return false;
        } else {
            return true;
        }
    }
}


Top
 Profile  
 
 Post subject: Re: why is my ReverseEngineeringStrategy being ignored?
PostPosted: Tue Aug 25, 2009 7:43 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
because you don't implement the constructor that allows the tool to pass in the default strategies.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Re: why is my ReverseEngineeringStrategy being ignored?
PostPosted: Tue Aug 25, 2009 8:21 am 
Newbie

Joined: Tue Aug 25, 2009 3:25 am
Posts: 6
max wrote:
because you don't implement the constructor that allows the tool to pass in the default strategies.


Thanks for the help.
So yes. Dit that.
Said message disappears. However, My implemention of public boolean excludeTable(TableIdentifier tableIdentifier)
is not being called (see System.out.println("hallo")).

Anthing else I need to do?


Top
 Profile  
 
 Post subject: Re: why is my ReverseEngineeringStrategy being ignored?
PostPosted: Sun Aug 30, 2009 12:10 pm 
Newbie

Joined: Tue Aug 25, 2009 3:25 am
Posts: 6
Okay. I'm all sorted. It did'nt occur to me that Hibernate needs to read in all the metadata into memory before it starts applying the startegy. With more than 2000 tables it took a while.
Thanks again.
Stefaan


Top
 Profile  
 
 Post subject: Re: why is my ReverseEngineeringStrategy being ignored?
PostPosted: Sun Aug 30, 2009 12:18 pm 
Newbie

Joined: Tue Aug 25, 2009 3:25 am
Posts: 6
I can't for the life of me find where I can rate a post. How do I do this?
Stefaan


Top
 Profile  
 
 Post subject: Re: why is my ReverseEngineeringStrategy being ignored?
PostPosted: Wed Sep 16, 2009 4:57 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
I should change my signature since we had to disable that feature when upgrading phpdb ;)

_________________
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.  [ 6 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.