-->
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.  [ 1 post ] 
Author Message
 Post subject: Query with 2 tables
PostPosted: Wed Nov 22, 2006 2:58 pm 
Newbie

Joined: Wed Nov 22, 2006 2:41 pm
Posts: 1
Hibernate version: 1.0.3

Name and version of the database you are using:SQL Server 2000

I'm new using NHibernate, can do the basic operations on a single sql table(Select, Insert, Delete, Update.
Tried to make a Select, using 2 tables, and there comes the problem. I've read the NHibernate reference, some HQL query examples/guides, and i don't get it.

table1: columnZ,....
table2:columnD, .... , columnA

if i want a simple query like:
select * from table1 t1, table2 t2 where t2.columnA='text' AND t2.columnA = t1.columnZ

columnA (in table2) is a Foreign Key to columnZ in table1 (PrimaryKey in table1)

How can I make this in HQL?
IList result = session.Find(??????)


Thank you in advance


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.