-->
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.  [ 4 posts ] 
Author Message
 Post subject: Accessing real Table-Metadata (database-independent)
PostPosted: Wed Nov 09, 2005 8:55 am 
Newbie

Joined: Wed Nov 09, 2005 6:21 am
Posts: 2
We're currently migrating to hibernate.

The software we're developing already has a (JDBC-)feature, where a user
can browse through the database and take a look at the Metadata
(before anybody asks, we need this feature for debugging- and migration-processes only).
We're implementing our software in very different enviroments with databases of various manufactures.
Because hibernates understands several dialects, I was wondering if there's
a way to request the "real"-db-Metadata (which -I think- is different than
the mapped Metadata which you can request via the ClassMetadata-Object).
I know that I could probably implement this by giving the correct
SQL-Statement to hibernate (or JBDC :) ), but I would have to know the
correct SQL-Syntax (and sometimes DBMS-Strukture) of every database
we encounter.

So is there a way to make this stuff database-independent with hibernate ?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 09, 2005 8:57 am 
Senior
Senior

Joined: Mon Apr 04, 2005 8:04 am
Posts: 128
Location: Manchester, NH USA
You could use session.connection().getMetaData() to get the JDBC DatabaseMetaData object. Is that what you want?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 09, 2005 11:53 am 
Newbie

Joined: Wed Nov 09, 2005 6:21 am
Posts: 2
Yes and No :)

Our software already operates with the JDBC DatabaseMetaData object. We have the problem, that the Meta-Data contained in that object (most important: the structure -> catalogs etc) are different with every DBMS we encounter. For example, oracle has a different structure than mysql. I just thought that maybe there is a (hibernate-)way to represent that Meta-Data in a universal, db-independent object. The optimal way for us would be, if the user could be able to "see" the same structure with every database hibernate supports :).

(I'll give you a credit anyway ;) )


Top
 Profile  
 
 Post subject:
PostPosted: Wed Nov 09, 2005 1:36 pm 
Senior
Senior

Joined: Mon Apr 04, 2005 8:04 am
Posts: 128
Location: Manchester, NH USA
Aren't the methods in the JDBC API standard across databases? Or are you saying that the metadata returned from the methods is non-standard, and you want some useful abstraction of that?


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