-->
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.  [ 8 posts ] 
Author Message
 Post subject: When DTD for hibernate-reverse-engineering isn't available
PostPosted: Fri Sep 15, 2006 10:52 am 
Regular
Regular

Joined: Wed Mar 15, 2006 1:48 pm
Posts: 91
Last night, URI(http://hibernate.sourceforge.net/hibern ... ng-3.0.dtd) for hibernate DTD was down and then I can't use hibernate tool to work properly. I read some docs about doctype and know I can use local DTD file or embed DTD in xml file. I don't like the later way since it makes my xml file long and look ugly.

If I use local DTD file, how can I specify file path so it can be used in both hibernate tool and tomcat server? Thanks!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 15, 2006 10:59 am 
Regular
Regular

Joined: Wed Mar 15, 2006 1:48 pm
Posts: 91
Or does anyone know a smart way to swtich from remote DTD to local one when URI is down?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 15, 2006 11:26 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
if you use the DTD references that is in all our examples/docs then everything works fine without a internet connection....

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 15, 2006 11:36 am 
Regular
Regular

Joined: Wed Mar 15, 2006 1:48 pm
Posts: 91
What do you mean? I used DTD reference from hibernate tool doc as below,

<!DOCTYPE hibernate-reverse-engineering SYSTEM "http://hibernate.sourceforge.net/hibernate-reverse-engineering-3.0.dtd" >

This is the ONLY dtd file I found from doc(http://www.hibernate.org/hib_docs/tools ... ml_single/), which requires Internet connection obviously.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 15, 2006 11:38 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
and what is the problem with that ?

works for me in my end when i don't have any internet access.

What is your concrete problem ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 15, 2006 12:24 pm 
Regular
Regular

Joined: Wed Mar 15, 2006 1:48 pm
Posts: 91
I used dom4j to write an ant task to generate revegn.xml file dynamically. It will read my template reveng.xml as below but stops working if remote dtd file isn't available.

document = new SAXReader().read(new File("template.reveng.xml"));

After I have a complete reveng.xml file for multiple tables, I will call hibernate tool to generate hbm files for these tables.

If you know how to let dom4j ignore dtd when reading xml, please let me know.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 15, 2006 1:05 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
eh - what do you need to write a reveng.xml file for dynamically ?

please tell ...

to read it use the DTD entity resolver used by hibernate (and the tools) to resolve it from the classpath.

look for XMLHelper.DEFAULT_DTD_RESOLVER.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 15, 2006 1:09 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
ah - you are the one who wanted to reveng multiple tables as input to the tools...got it.


(for me it would make more sense to write a reveng strategy that just took the list of table names instead of generating...but that is just me ;)

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