-->
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.  [ 3 posts ] 
Author Message
 Post subject: List table fields
PostPosted: Mon Mar 31, 2008 11:12 am 
Newbie

Joined: Mon Mar 31, 2008 11:02 am
Posts: 2
Hi all,

I'm using Hibernate 3.1on DB2 express edition.

I have the necessity to get the fields of a table. I thought that java-reflection could help me but because of Hibernate mapping (e.g foreign key are mapped with classes) I couldn't retrieve fields name from the table.

If someone is able to help me I would appreciate it.

Thanks in advance.

R.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 31, 2008 11:26 am 
Regular
Regular

Joined: Mon Aug 06, 2007 10:49 am
Posts: 67
Location: Banska Bystrica, Slovakia
from Configuration object used to build the session factory u can extract class mapping:
Code:
PersistentClass classMapping = config.getClassMapping("test.User");


and from class mapping u can get column names etc.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 31, 2008 11:52 am 
Newbie

Joined: Mon Mar 31, 2008 11:02 am
Posts: 2
Tnx.

It works..


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