-->
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.  [ 2 posts ] 
Author Message
 Post subject: How to map a property to multiple columns
PostPosted: Mon Jun 07, 2004 9:11 am 
Newbie

Joined: Mon Jun 07, 2004 8:44 am
Posts: 1
Location: Denver, CO
I was wondering if it is possible (and if so, how) to map a property to multiple columns in the database.

For instance, I have a User class with a property called commonName which maps to a column in the users table called "commonname", which contains the first and last name of the user.

But in some implementations, we may want to actually map the User class to a database that does not have a "commonname" column in its users table, but instead has "firstname" and "lastname" as separate columns. Is it possible to map the commonName property to a combination of both these columns? (Some way of mapping it to "firstname" + "lastname")

I suppose that there is really a very easy way to do this, but I am brand new to hibernate and also have limited database experience, so thanks to anyone who can help.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 07, 2004 9:25 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
use a CompositeUserType


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