-->
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: matter of getting the names of columns...
PostPosted: Tue Mar 27, 2007 9:45 am 
Newbie

Joined: Sun Jan 01, 2006 7:57 am
Posts: 8
Hibernate version:
3.0

Is it possible to get the NAME of a table column using the NAME of the attribute in the class through the xml mapping.
for example:
you have this...

<many-to-one name="okresyId" entity-name="org.unss.is.dl.model.Okres" cascade="none" foreign-key="fk_okresy" column="okresy_id"/>

And I want get this "okresy_id" using this "okresyId"...
Thanks in advanced...

johnypt

_________________
--johnypt--


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 27, 2007 11:00 am 
Beginner
Beginner

Joined: Sun Nov 16, 2003 3:04 pm
Posts: 24
I realize you are asking about the xml mapping, but, since you are using hibernate3, if you use the annotations for mapping, instead of the xml, its a piece of cake to pull them out and get their values.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 27, 2007 11:50 am 
Newbie

Joined: Sun Jan 01, 2006 7:57 am
Posts: 8
Well I know that through annotations it would be no problem,
but I need to know how to solve this concrete problem with using xml mapping.

_________________
--johnypt--


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 27, 2007 12:04 pm 
Newbie

Joined: Wed Jun 28, 2006 3:32 pm
Posts: 16
You can either parse the XML yourself and look it up, or you can get the Hibernate metadata from the SessionFactory and look through those.


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.