-->
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.  [ 4 posts ] 
Author Message
 Post subject: Reverse Engineering fails
PostPosted: Tue Apr 26, 2011 11:33 am 
Newbie

Joined: Tue Apr 26, 2011 11:24 am
Posts: 1
Hello,
I have a project using Spring and Hibernate to create the database connection. The spring configuration works well with a test entity I have written, persists etc. are possible.

I now want to reverse engineer the "real" entities from the database - but every time I try, nothing at all is generated.

The hibernate.cfg.xml (which I created solely for the reverse engineering process, as I normally use Spring to do the connection) is as follows:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
      "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
      "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
    <session-factory>
        <property name="hibernate.connection.driver_class">org.gjt.mm.mysql.Driver</property>
        <property name="hibernate.connection.password">coco</property>
        <property name="hibernate.connection.url">jdbc:mysql://localhost/cocolounge</property>
        <property name="hibernate.connection.username">coco</property>
        <property name="hibernate.default_schema">cocolounge</property>
        <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property>
    </session-factory>
</hibernate-configuration>


The hibernate.reveng.xml (shortened):
Code:
<?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="cocolounge" match-name=".*" />
   <table catalog="cocolounge" name="milestone"></table>
   <table catalog="cocolounge" name="contact"></table>
   <table catalog="cocolounge" name="task"></table>
</hibernate-reverse-engineering>


In the Hibernate Perspective in Eclipse, I have added the configuration file and the database connection obviously works, as I can dropdown the database connection there and see all the correct tables.
I have created a very simple Run Configuration which sets the Console Configuration, Output Dir, Reverse Engineering from DB, and a path to reveng.xml and Domain Code as the only exporter.

However, when i click on "Run", nothing at all seems to happen. I have no output whatsoever in the error log.
Can anyone help me here, suggest anything I might try to either get more info or get the correct results?

Thanks a lot!


Top
 Profile  
 
 Post subject: Re: Reverse Engineering fails
PostPosted: Sun May 01, 2011 4:08 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Make sure you use the same casing as the database returns, i.e. COLOUNGE instead of just colounge.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject: Re: Reverse Engineering fails
PostPosted: Tue Jun 28, 2011 8:26 am 
Newbie

Joined: Tue Jun 28, 2011 8:20 am
Posts: 1
Hi !
This is still failing to generate anything apart from the hibernate.cfg.xml, which only contains values from the hibernate.properties file.
Also, I am using ant build for this generation process.
The wizard based hibernate tool works fine.


Top
 Profile  
 
 Post subject: Re: Reverse Engineering fails
PostPosted: Tue Jun 28, 2011 9:18 am 
Senior
Senior

Joined: Tue Aug 04, 2009 7:45 am
Posts: 124
The line <table-filter match-schema="cocolounge" match-name=".*" />
filters out all the tables because of MySQL problem.
Use match-catalog="cocolounge"

See https://issues.jboss.org/browse/JBIDE-8802


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