-->
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: Printing table name in logs
PostPosted: Mon Mar 10, 2008 4:50 am 
Newbie

Joined: Tue Jan 29, 2008 9:37 am
Posts: 4
Dear users,

I am new to hibernate. I crated one table using hibernate, i just want to print that table name in logs, is it possible to print table name in logs using hibernate methods?

-Thanks in Advance


Top
 Profile  
 
 Post subject: Configuration class
PostPosted: Mon Mar 10, 2008 6:04 am 
Newbie

Joined: Mon Sep 03, 2007 9:10 am
Posts: 7
You have the Configuration class.

To see usage examples:

http://www.softwaresecretweapons.com/js ... nguinemaps


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 10, 2008 7:28 am 
Newbie

Joined: Tue Jan 29, 2008 9:37 am
Posts: 4
Hi,

I want to print table names which are crated by hibernate, is there any method to print table names which are crated by hibernate?

-Thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 10, 2008 11:11 am 
Senior
Senior

Joined: Fri Jun 01, 2007 12:41 pm
Posts: 121
I don't remember any such method that like getTableForEntity(Entity) in hibernate API. But you can refer to the package hibernate.cfg. While building session factory, hibernate builds of Map of table names. This map contains mapping between Entity and it's table name.

You have to copy this Map to your local variable. And you can use it to print table name in logs.

But, what is the advantage of printing only table names. Why don't you use show_sql hibernate property. It will print the whole query-->and you can get table names from here.

Thanks


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.