-->
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.  [ 5 posts ] 
Author Message
 Post subject: hibernate-reverse-engineering - how to express this
PostPosted: Sun Jun 12, 2005 6:40 pm 
Newbie

Joined: Sun Jun 12, 2005 6:31 pm
Posts: 4
Location: Seattle
In the hibernate-reverse-engineering file how would I express
the following constraints:

Only reverse-engineer all tables in the UCN schema *and* the one table "CLIENT" in the SHIPLOGDB schema

Put another way:

Reverse-engineer only UCN.* and SHIPLOGDB.CLIENT

Any help is appreciated - Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 13, 2005 2:08 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Code:
<hibernate-reverse-engineering>
   <table-filter match-schema="UCN"/>
   <table-filter match-schema="SHIPLOGDB" match-name="CLIENT"/>
   <table-filter match-schema=".*" exclude="true" />
</ibernate-reverse-engineering>


voila...the logic:

include everything that matches schema="UCN"
include everything that matches schema="SHIPLOGDB" AND name="CLIENT"
exclude everything else.

Remember that the ordering matters...first hit wins
[/code]

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 13, 2005 10:23 am 
Newbie

Joined: Sun Jun 12, 2005 6:31 pm
Posts: 4
Location: Seattle
"...Remember that the ordering matters...first hit wins"

Ah ha. That last comment says a lot!

Thanks for the help.

Ron

_________________
Thanks,

Ron


Top
 Profile  
 
 Post subject: Re: hibernate-reverse-engineering - how to express this
PostPosted: Mon Jun 13, 2005 7:12 pm 
Newbie

Joined: Sun Jun 12, 2005 6:31 pm
Posts: 4
Location: Seattle
Hmm...

More strangeness. Tried Max's suggestion:

---- file: hibernate.reveng.xml ---

<?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="UCN"/>
<table-filter match-schema="SHIPLOGDB" match-name="CLIENT"/>
<table-filter match-schema=".*" exclude="true" />
</hibernate-reverse-engineering>

---- end file: hibernate.reveng.xml ---

When I use the wizard to reverse engineer my database I get a (vague) error message:

org.hibernate.MappingException:Could not configure overrides from file: C:\Java\Projects\UCN\com.expd.domain.ucn\src\hibernate.reveng.xml

Is there somewhere a more detailed stack trace can be found ?

Thanks,

Ron

_________________
Thanks,

Ron


Top
 Profile  
 
 Post subject: Found the error
PostPosted: Mon Jun 13, 2005 8:12 pm 
Newbie

Joined: Sun Jun 12, 2005 6:31 pm
Posts: 4
Location: Seattle
Responding to my own post...

More details were in the error log view. Turns out the match-name
attribute is *required* so I added match-name to each entry and things
started coming together.

<hibernate-reverse-engineering>
<table-filter match-schema="UCN" match-name=".*" />
<table-filter match-schema="SHIPLOGDB" match-name="CLIENT"/>
<table-filter match-schema=".*" match-name=".*" exclude="true" />
</ibernate-reverse-engineering>

Thanks Again to Max for both adding this feature and helping out.

Onward...

Ron

_________________
Thanks,

Ron


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