-->
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: Joined subclass and native SQL query
PostPosted: Wed Jan 25, 2006 9:12 am 
Beginner
Beginner

Joined: Mon Dec 19, 2005 4:13 am
Posts: 27
Location: Prague, Czech Republic
Please can someone post an example how to use simple SQL native query to return instances of class Person which extends the class Subject and is mapped as joined subclass? I don't know how to tell NHibernate I need columns from two tables to bind to one class.

The only way I found is to hack it by typing query following way:

Code:
SELECT {c.*}
FROM Company c
  INNER JOIN Subject c_1_ ON c_1_.id_Subject = c.id_Company


It works because {c.*} is translated to:
- c.ColumnName for properties in Company table
- [c_1_].ColumnName for properties in Subject table

And it really is not the way I want to use? Is there any example somewhere?

Many thanks![/b]


Top
 Profile  
 
 Post subject: Joined subclass and native SQL query
PostPosted: Mon Jun 04, 2007 10:41 am 
Newbie

Joined: Thu Jun 22, 2006 4:04 am
Posts: 8
Location: Prague
Same problem here :(
Is there solution to this ?

NH v1.0.2

Thanx


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.