Hey,
I got a SELECT query and I want to perform a join between two tables. The thing is that in table CountryT I have a primary key (countrycode) and in the other table (StoreT) I have primary key storeno with countrycode as a
foreign key.
So, I first performed this query:
Code:
Query q = session.createQuery("SELECT st.storeno, st.storename, co.countrycode FROM net.sf.hibernate.CountryT co, net.sf.hibernate.StoreT st WHERE co.id=st.id AND co.id='DK'");
Now this doesn't work since Hibernate then compares countrycode with storeno.
So how do I write a query that compare the the primary key with the foreign key? (that is like....countrycode=countrycode)
Br. Newman