-->
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: How to retrieve column names and their values ?
PostPosted: Fri Jan 30, 2004 6:51 am 
Beginner
Beginner

Joined: Thu Jan 22, 2004 6:16 am
Posts: 40
Location: Luxembourg
Suppose one row in a "ResultSet" ( i.e ScrollableResult in Hibernate ) looks like this :

<column1><column2><column3>
<string1><string2><string3>

How can I get the columnnames out, and their corresponding value (strings in this case )?
I.e, I want something like :

column1 , string1
column2 , string2
column3 , string3

Maybe this can't be done with ScrollableResults ? Is there any other way to do this with Hibernate ?

Cheers


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 30, 2004 1:43 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
reformulate.
Hibernate is an ORM tool, so there is no relational concept form the cleint perspective (column name is pointless).

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 30, 2004 5:23 pm 
Regular
Regular

Joined: Fri Sep 05, 2003 12:01 am
Posts: 80
Location: Bogot
how about getting a JDBC connection from hibernate and then using the pain old DatabaseMetadata object?

Mind you, not all JDBC drivers have a good implementation of this...

_________________
Mauricio Hern


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 30, 2004 6:09 pm 
Beginner
Beginner

Joined: Tue Nov 11, 2003 4:49 am
Posts: 47
Location: Florence, Italy
Why not
Code:
sessionfactory.getClassMetadata(YourClass.class);
from metadata API ?


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.