-->
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: Getting DB informations - how to
PostPosted: Thu Feb 16, 2006 12:28 pm 
Newbie

Joined: Mon Jan 16, 2006 1:12 pm
Posts: 3
Hi,
I would like to know how could I get db informations (table names and column attributes) via Hibernate.
I've seen in the package org.hibernate.mapping, the class Column; It would be nice.

Is there anyone who can help me?
Many thanx.

Gigi


Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.0

Name and version of the database you are using: MySql


Top
 Profile  
 
 Post subject: meta
PostPosted: Thu Feb 16, 2006 2:10 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
Please clarify if you need DB information or mapping information.
If you want to explore DB than you can get JDBC metadata by calling session.connection().getMetaData() and go from there

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 16, 2006 2:38 pm 
Newbie

Joined: Mon Jan 16, 2006 1:12 pm
Posts: 3
Thanks for the answer.

Yes, I know I can obtain all the informations from the DB with the JDBC but I would like to use Hibernate objects instead of JDBC o.
Maybe I could use mapping; I need only to know table names (or bean), column names, type and length.

In case of mapping, how should I do?

Thanks

Gigi


Top
 Profile  
 
 Post subject: session
PostPosted: Thu Feb 16, 2006 2:46 pm 
Expert
Expert

Joined: Fri Jul 22, 2005 2:42 pm
Posts: 670
Location: Seattle, WA
session.getSessionFactory().getClassMetadata(Class persistentClass)

but not all the mapping information is exposed

_________________
--------------
Konstantin

SourceLabs - dependable OpenSource systems


Top
 Profile  
 
 Post subject: Re: meta
PostPosted: Mon Oct 22, 2012 4:15 pm 
Newbie

Joined: Wed Jul 08, 2009 8:11 am
Posts: 8
kgignatyev wrote:
Please clarify if you need DB information or mapping information.
If you want to explore DB than you can get JDBC metadata by calling session.connection().getMetaData() and go from there


Hi! I have a question for you. Session no longer has a connection property in 4.x of Hibernate. Any ideas how I would get connection metadata in the later versions of Hibernate?


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.