-->
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: virtual column mapping
PostPosted: Tue Jan 25, 2005 5:34 am 
Newbie

Joined: Thu Dec 23, 2004 3:53 am
Posts: 19
Hibernate version:2.1.7

Mapping documents: 2 mapping documents: mapping1.hbm.xml and mapping2.hbm.xml

Name and version of the database you are using: Oracle9i

Hi.

My issue is as follows:
I want to create a mmaping hbm file let say mapping2.hbm.xml that has the following:
* id - sequence (I know how to do that)
* some virtual property, component, what ever (here is my problem) that creates no column in the database but maps to other db table

The mapping1 hbm file is the table that I want to refer to from the mapping2 hbm file.

Can I do that?

Thanks in advance...


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 25, 2005 6:39 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
if you want a read only column in another table, read about formula in the reference guide or hibernate in action
if you want full persistence feature about this column: you'll need associated entity
if you need specific issue, get some comercial support ;), there may be a solution

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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 25, 2005 7:21 am 
Newbie

Joined: Thu Dec 23, 2004 3:53 am
Posts: 19
Before I purchase a commercial support, I need to know if creating such a thing is possible.

create a mapping to virtual column for example:
I want class AA mapped to table A to have a field 'aa' with no column in that table (A) and this field will be my user type that writes to another table (B), i.e. when field aa is persisted table B is modified accordingly

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 25, 2005 7:28 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Yes, thats possible.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 25, 2005 7:34 am 
Newbie

Joined: Thu Dec 23, 2004 3:53 am
Posts: 19
Thanks, I'll go around some more and then I'll decide.

Thanks any way...


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.