-->
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.  [ 11 posts ] 
Author Message
 Post subject: Problem with reverse engineering using wizard
PostPosted: Mon May 21, 2007 9:11 am 
Newbie

Joined: Thu Dec 07, 2006 4:11 pm
Posts: 12
Hi all,
I want to make reverse engineering from a big database (mysql). I had downloading Hibernate tools 3.2.0 beta 9a, installing, using, ... all is ok, i see my data schema in the wizard.
The problem is when i want to generate hbm.xml files thanks to configurations. In the wizard, i have defined a configuration for generating them (*.hbm.xml) and a reveng.xml file in which i have specified type mapping. It runs very good when i don't use the reveng.xml file in the configuration. When i want to use it (i have select org.hibernate.cfg.reveng.ReverseEngineeringStrategyUtil as reveng. strategy), i have this error :

Quote:
org.hibernate.console.HibernateConsoleRuntimeException: Could not create or find org.hibernate.cfg.reveng.ReverseEngineeringStrategyUtil with default no-arg constructor
java.lang.IllegalAccessException: Class org.hibernate.eclipse.launch.CodeGenerationLaunchDelegate can not access a member of class org.hibernate.cfg.reveng.ReverseEngineeringStrategyUtil with modifiers "private"


Does anyone help me ?


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 21, 2007 10:45 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
your class and constructor of reveng class needs to be public

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 21, 2007 11:14 am 
Newbie

Joined: Thu Dec 07, 2006 4:11 pm
Posts: 12
ok, but org.hibernate.cfg.reveng.ReverseEngineeringStrategyUtil is not one of my own classes. It belongs to hibernate-tools-3.2.0.beta9a.jar and i have no access to its source code. Moreover, it's the wizard which propose to me this strategy. It's amazing that no runs directly ...


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 21, 2007 11:33 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
it only suggest that if you browse for it because it matches the name *ReverseEngineering* - unfortunatly I haven't figured out how to make the type chooser in eclipse only show subclasses of a specific type.

If you don't have a class to use for it don't fill it out.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 22, 2007 3:28 am 
Newbie

Joined: Thu Dec 07, 2006 4:11 pm
Posts: 12
ok, so i want to use my reveng.xml file, i have to create my own strategy. This class will have to have public constructor and modifiers ...


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 22, 2007 4:02 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
no, you don't need a custom class for using a reveng.xml.

A custom class is only needed if you want to do something programmatically instead of declaring it explicilty in the reveng.xml

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 22, 2007 8:23 am 
Newbie

Joined: Thu Dec 07, 2006 4:11 pm
Posts: 12
ok, it runs fine with DelegatingReverseEngineeringStrategy, the reveng.xml is used this time.
Thanks max


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 22, 2007 10:31 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
just don't put anything in the reveng strategy class field...

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 22, 2007 11:05 am 
Newbie

Joined: Thu Dec 07, 2006 4:11 pm
Posts: 12
i have another problem with the wizard, on the same basis as the precedent :
now i want to use custom template (i. e. dao generation).
I paste the source code of daohome.ftl provided in hibernate-tools-3.2.0.beta9a.jar in a file with the same name in my project under a directory called template (i have just changed one thing : instead of public class ${declarationName}Home, i put public class ${declarationName}Dao.
In the configuration wizard, i check "use custom templates" and specify the path of my templates directory with the same configuration like before (reveng.xml + org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy).

But, in fact the generator doesn't use my custom template when i check the generation result ...


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 22, 2007 11:38 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
did you put it in a directory named dao like where you copied it from ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 23, 2007 3:36 am 
Newbie

Joined: Thu Dec 07, 2006 4:11 pm
Posts: 12
That's it, one more time thanks a lot max ...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 11 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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.