-->
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: how to exclude 'sysconstraints' and 'syssegmnts'
PostPosted: Wed Nov 09, 2005 1:53 pm 
Newbie

Joined: Sun Oct 23, 2005 7:03 pm
Posts: 12
Hi,
I'm using SQL2000 server.
I'm using 'ddl2hbm' to generate hbm.xml files from a database schema.
I found out that everytime I run it, two files 'sysconstraints.hbm.xml' and 'syssegments.hbm.xml' are generated.
I know those are related to system tables, but I don't know why are those two are generated, among all system tables.
I want to exlude those two hbm.xml from generating, and I put
-------------
<table-filter match-catalog="HibernateTest" match-schema="dbo" match-name="sysconstraints" exclude="true"/>
<table-filter match-catalog="HibernateTest" match-schema="dbo" match-name="syssegments" exclude="true"/>
-------------
in my 'hibernate.reveng.xml', but then NO hbm.xml is generated! Not even the ones that I want.

Can anybody advice me how to fix this?

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 10, 2005 6:56 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
ddl2hbm ? That is some very old hibernate 2 tools that have that ;)

yes, we had a bug in the filter logic in 3.1 beta1 which made it not include anything when you just have excludes in the list.

To work around it just do the following:

<table-filter match-catalog="HibernateTest" match-schema="dbo" match-name="sysconstraints" exclude="true"/>
<table-filter match-catalog="HibernateTest" match-schema="dbo" match-name="syssegments" exclude="true"/>
<table-filter match-name=".*" exclude="false"/>

or download the latest version.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 10, 2005 2:44 pm 
Newbie

Joined: Sun Oct 23, 2005 7:03 pm
Posts: 12
Hi, Max:
Thank you very much for your reply. Actually I was using hbm2hbmxml, it was a typo in my original post. I have a database with all tables, my task is to create a set of *.hbm.xml files from those tables(I include my ant target for this task). Should I use hbm2hbmxml for Hibernate3? If not, what should I use to achieve this goal?
Any comment would be greatly appreciated!!

Code:
<target name="ddl2xml" description="Generate .java from .hbm files.">
      <taskdef
        name="ddl2xml"
        classname="org.hibernate.tool.ant.HibernateToolTask"
        classpathref ="compile-classpath"
    />

    <ddl2xml destdir="${gen.dir}">
      <jdbcconfiguration configurationfile="${webapp.dir}/WEB-INF/classes/gen.cfg.xml"
             packagename="com.cucbc.cgo.data"
             revengfile="${webapp.dir}/WEB-INF/classes/hibernate.reveng.xml"
         /> <!-- database settings are read from hibernate.cfg.xml and/or via propertyfile if provided -->
     <hbm2hbmxml/>

   </ddl2xml>
</target>


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 10, 2005 2:49 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
and updating the cfg.xml as i wrote did not help?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 10, 2005 8:29 pm 
Newbie

Joined: Sun Oct 23, 2005 7:03 pm
Posts: 12
Yes, I put the following:
Code:
   <table-filter match-name="sysconstraints" exclude="true"/>
   <table-filter match-name="syssegments" exclude="true"/>
   <table-filter match-name=".*" exclude="false"/>


in my 'hibernate.reveng.xml', and it worked! Thanks a lot!
Could you please answer my question in my second post? Is 'hbm2hbmxml' with Hibernate3? I just want to make sure that I'm using the right tool with Hibernate3.

Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 11, 2005 1:24 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
yes you are using the hibernate 3 tools correctly.

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