[jboss-user] [JBoss Tools] New message: "Re: How to reverse engineer tables from multiple schemas?"

Wouter Hartog do-not-reply at jboss.com
Fri Jan 15 13:21:31 EST 2010


User development,

A new message was posted in the thread "How to reverse engineer tables from multiple schemas?":

http://community.jboss.org/message/520382#520382

Author  : Wouter Hartog
Profile : http://community.jboss.org/people/wouterhartog

Message:
--------------------------------------------------------------
Thanks to the replies from Denis and Max, I tried a few more things and got it to work now.
 
The issue was with the hibernate.reveng.xml file.
Based on what the wizard created, I had just this in in the reveng.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering PUBLIC "-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >
 
<hibernate-reverse-engineering>
  <table-filter match-schema="maintenance" match-name=".*"/>
  <table-filter match-schema="consultant_db" match-name=".*"/>
</hibernate-reverse-engineering>
I also changed the 'match-schema' attribute to 'match-catalog', but that didn't help.
 
However, when I changed it to the following, it worked fine:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-reverse-engineering PUBLIC "-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >
 
<hibernate-reverse-engineering>
  <schema-selection match-catalog="maintenance" />
  <schema-selection match-catalog="consultant_db" />
</hibernate-reverse-engineering>
 
In other words, just using 'table-filter' doesn't make it look at different catalogs/ databases in MySQL, but the 'schema-selection' element does.
I think this is quite acceptable for how it works.
 
However, the Hibernate reverse engineering editor can perhaps be improved:
- How can we get multiple schemas to show up in the wizard? It looks like the wizard looks at the hibernate.connection.url property in the hibernate-console.properties file. However, when I leave out the name of the database (e.g.   jdbc:mysql://localhost:3306) without the database, the wizard does not return any tables.
- The wizard could have an extra tab at the bottom where you can select the schemas/ catalogs you want, effectively creating the <schema-selection ...> tags
 
Thank you!

--------------------------------------------------------------

To reply to this message visit the message page: http://community.jboss.org/message/520382#520382




More information about the jboss-user mailing list