Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Cannot get Reverse Engineering to Work
PostPosted: Wed Feb 15, 2012 12:20 am 
Newbie

Joined: Tue Feb 14, 2012 11:58 pm
Posts: 7
Hi all,

I have just started learning Hibernate so as to evaluate it as a potential replacement to Struts 2 in an application I am writing. I am trying to get some of the basic elements going, but I am having a lot of trouble getting the reverse engineering functionality to work (running Eclipse Indigo and the latest version of Hibernate Tools). Basically, when I tell the project to create a new reverse engineering file and specify the configuration file, I get no errors but the wizard does not find any tables or anything in the database, and the process just produces a blank reverse engineering file.

I have set up a Hibernation configuration file and it pings the database successfully. Specifically, I have no idea if the catalog and/or schema properties are correct; as far as I can tell from reading around online, the catalog is just the same as the connection URL, and the schema is anything I decide to name it? The configuration file looks like this:

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 name="sessions">
  <property name="hibernate.connection.driver_class">org.gjt.mm.mysql.Driver</property>
  <property name="hibernate.connection.url">jdbc:mysql://localhost/test</property>
  <property name="hibernate.default_schema">myschema</property>
  <property name="hibernate.default_catalog">jdbc:mysql://localhost/test</property>
  <property name="hibernate.connection.username">root</property>
  <property name="hibernate.connection.password">correcthorsebatterystaple</property>
  <property name="hibernate.dialect">org.hibernate.dialect.MySQL</property>
</session-factory
</hibernate-configuration>



Can anyone lend me a hand?

Thanks,

-TennSeven


Top
 Profile  
 
 Post subject: Re: Cannot get Reverse Engineering to Work
PostPosted: Wed Feb 15, 2012 7:05 am 
Newbie

Joined: Tue Oct 20, 2009 6:28 am
Posts: 14
Sure,

can you give some information?

What's the error, what version of the tools are you using, if you are using eclipse or any other environment.

Some screenshots will be also nice.

Thank you.


Top
 Profile  
 
 Post subject: Re: Cannot get Reverse Engineering to Work
PostPosted: Wed Feb 15, 2012 11:02 am 
Senior
Senior

Joined: Tue Aug 04, 2009 7:45 am
Posts: 124
You have wrong default catalog. Set it to "test" and remove default_schema property.

Read also https://community.jboss.org/message/602330#602330 in case of problems.


Top
 Profile  
 
 Post subject: Re: Cannot get Reverse Engineering to Work
PostPosted: Wed Feb 15, 2012 3:25 pm 
Newbie

Joined: Tue Feb 14, 2012 11:58 pm
Posts: 7
Dmitry,

Thank you very much, that worked perfectly!

-TennSeven


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 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.