-->
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.  [ 6 posts ] 
Author Message
 Post subject: Reveng with Eclipse : Problem with default schema & cata
PostPosted: Fri Aug 24, 2007 8:43 am 
Newbie

Joined: Fri Aug 17, 2007 4:27 am
Posts: 5
Hi,

I can't make default schema & default catalog to work when I'm reverse engineering with Eclipse. (Even if a assign them they don't seem to have any effect)

I have following lines on my hibernate.cfg.xml:
Code:
<hibernate-configuration>
    <session-factory>
        ... db-settings ...
        <property name="hibernate.default_catalog">CATALOG</property>
        <property name="hibernate.default_schema">SCHEMA</property>
    </session-factory>
</hibernate-configuration>


I got following lines in the reveng.xml but with these, the specific table configurations (property names etc) aren't used.
Code:
<table name="TABLE" class="ClassName">
        ... conf ...
   </table>

So that results as

Quote:
2007-08-24 15:23:48,609 WARN Worker-5 org.hibernate.cfg.reveng.JDBCReader - The JDBC driver didn't report any primary key columns in TABLE. Asking rev.eng. strategy
2007-08-24 15:23:48,609 WARN Worker-5 org.hibernate.cfg.reveng.JDBCReader - Rev.eng. strategy did not report any primary key columns for TABLE


Then, after I changed my reveng.xml to include schema and catalog like following, then the configurations work fine.
Code:
<table catalog="CATALOG" schema="SCHEMA" name="TABLE"
      class="ClassName">
        ... conf ...
</table>


So, anybody got some idea what's wrong and how I could avoid copy-pasting those catalog & schema settings to each table?

Using following:
Hibernate & Hibernate Tools 3.2.0
MS SQL Server, jTDS JDBC driver

Btw. there seems to be a typo in Hibernate Tools reference 5.2.4 section - there is written "hiberante.default_catalog" and "hiberante.default_schema". Didn't still work with them either.

Best regards,
Touko


Top
 Profile  
 
 Post subject:
PostPosted: Sat Aug 25, 2007 2:03 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
sounsd weird that it does not work when default catalog and schema is set to the same as the one you you use in <table>

Your first example should just work assuming that your db returns proper table/schema/catalog names....which db is it ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 27, 2007 7:31 am 
Newbie

Joined: Fri Aug 17, 2007 4:27 am
Posts: 5
Hi again,

used DB is MS SQL Server 2000 and used JDBC driver is jTDS 1.2.1. I'm using Hib. Tools through Eclipse configuration

For some reason, after some refreshing, trying etc. it works now. Only with one subtle "reversed" anomality:

I got same default_schema and default_catalog properties in my hibernate.cfg.xml as before. And now following works as supposed:
Code:
<table name="TABLE" class="ClassName">
        ... conf ...
   </table>


But if I try the previously worked one:
Code:
<table catalog="CATALOG" schema="SCHEMA" name="TABLE"
      class="ClassName">
        ... conf ...
</table>

then the configuration doesn't work.

Misspelling would otherwise be a good guess but I think I've checked the names for a couple of times. Also, to get some idea for the catalog/schema names and to ignore other tables (for testing only one at first), I've had following in my reveng.xml since beginning:
Code:
<table-filter
   match-catalog="CATALOG"
   match-schema="SCHEMA"
   match-name="TABLE"
   exclude="false"/>


Is there some possibility to Eclipse cache and use some old configurations ,xml:s or something like that. Probably not but that could explain thing...

Have no idea. But I'll post another time if I catch up something.. Thanks anyway.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 27, 2007 7:50 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
hmm ...explicit naming should actually work if the short versions work (AND default catalog/schema is really equal to that name)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 27, 2007 8:22 am 
Newbie

Joined: Fri Aug 17, 2007 4:27 am
Posts: 5
I checked still once and copy-pasted those names from the default definitions but no change.

Maybe my eyes just are ignoring something important or there's something fuzzy there.

Thanks anyway
-Touko


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 27, 2007 8:30 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
...at most it is a suttle non-blocking bug, but it is also something that is not the recommended way of doing things ;)

well the idea is that the reveng.xml should be usable across db installations and thus setting default schema/catalog is definitily recommendable so you do not list catalog/schema in the reveng.xml unless the schema/catalog actually mean something (e.g. if you have mutliple schemas/catalog in your app)

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