-->
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: JDBC and Hibernate mappings
PostPosted: Thu Sep 16, 2004 1:55 am 
Newbie

Joined: Sat Aug 28, 2004 1:47 am
Posts: 4
Hi,

This is about use of JDBC along with Hibernate when required.

Mapping of objects is available to Hibernate. So it can know which column corresponds to which attribute of an object and generate SQL queries accordingly.

But if an application has to use JDBC (alongside with use of Hibernate) then to write a SQL query based on any attribute (a simple example), how would the application retrieve the corresponding column name?

It seems that the application has to ensure on its own that it uses correct column name (the one that is specified in the mapping). If I have not mistaken or missed anything, Hibernate does not seem to provide helper for application to retrieve such info.

Please let us know.

Thanks,
Jay


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 16, 2004 2:59 am 
Expert
Expert

Joined: Thu Jan 29, 2004 2:31 am
Posts: 362
Location: Switzerland, Bern
RTM chapter 13 of the reference manual.

If this is not enough, and you want to relay on the mapping look at
http://www.hibernate.org/118.html#A19

HTH
Ernst


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 16, 2004 3:01 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
does this help?
http://www.hibernate.org/hib_docs/refer ... a-metadata

you can get all metadata info stored into the mapping files

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 16, 2004 3:13 am 
Newbie

Joined: Sat Aug 28, 2004 1:47 am
Posts: 4
Thanks Ernst and Anthony for a quick response. I feel information on your links will be sufficient for me.

Jay


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 16, 2004 4:27 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
I once wrote a nasty hack for something like this - don't know if it still works http://www.gloegl.de/26.html


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.