-->
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: Mapping string normalizations
PostPosted: Tue Sep 19, 2006 10:33 pm 
Newbie

Joined: Tue Sep 19, 2006 10:09 pm
Posts: 2
Hi guys,

I'm looking at migrating our currently hand-coded ORM to NHibernate. I'm having trouble with mapping a common idiom in our schemas. Here's an example:

Code:
class Session {
  public int ID;
  public string Workstation;
}


This is represented in the database as follows:

Code:
CREATE TABLE Workstation (
  ID int,
  Name varchar(max)
)

CREATE TABLE Session (
  ID int,
  Workstation int
)


With Session.Workstation referring to Workstation.ID.

I realise that the usual way to address this would be to create a Workstation class, and this is of course desirable if the object has any other problems - but we use this pattern a lot just to eliminate string duplication (ie, there will never be additional attributes of the Workstation object).

Is there a way to address this with an NH mapping? I haven't managed to find anything that seems relevant in the documentation.

Cheers,
-G


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 20, 2006 1:53 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
No, NHibernate currently doesn't support it (it would require NH support for <join> tag, which isn't yet implemented).


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 20, 2006 2:18 am 
Newbie

Joined: Tue Sep 19, 2006 10:09 pm
Posts: 2
Sergey,

Thanks for the reply. I'll have a look at the full docs for Hibernate and see what I can turn up.

I take it that the implementation of <join> is outside the scope of 1.2? :)

Thanks again,
-G


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 20, 2006 2:46 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Quote:
I take it that the implementation of <join> is outside the scope of 1.2? :)

Yes, unless somebody contributes a patch.


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.