nhibernate « Join « JPA Q&A

1. (N)Hibernate Auto-Join    stackoverflow.com

I'm developing a web- application using NHibernate. Can you tell me how to write a NHibernate Query for the following SQL query: select v1.Id from View v1 left join View v2 on v1.SourceView = ...

2. Left Join in NHibernate HQL    stackoverflow.com

Is it possible to perform a left join between two tables that are not related each other through a parent-child or many-to-many relationship ?. All the samples I found around only ...

3. Converting from SQL to HQL fail    stackoverflow.com

Trying to go from here this SQL:

FROM            Issue AS iss
INNER JOIN      Message ON ...

4. NHibernate: How to exclude a class which is part of a join using the Criteria API    stackoverflow.com

I am still new to Hibernate and am attempting to use it for a web site I have inherited. Unfortunately that means sometimes the db schemas don't always make sense. With ...

5. NHibernate Joining Data in HQL    stackoverflow.com

I have the following two tables mapped in NHibernate: VehicleCheck

ID (int) 
VehicleReg (varchar) 
DriverName (varchar) 
TS (datetime)
ID (int)
VehicleCheckID (int)
CheckType (int)
Passed (bit)
What I want to do is get the most recent vehicleCheck ...

6. NHibernate Native SQL multiple joins    stackoverflow.com

I"m having some problems with Nhibernate and native sql. I've got an entity with alot of collections and I am doing an SQL Fulltext search on it. So when returning 100 or ...

7. NHibernate how to join to table twice in HQL    stackoverflow.com

public class Case
    public int Id { get; set; }
    public string Number { get; set; }
    public Employee Employee { get; ...

8. Automatic join with NHibernate / Many-to-one / HQL    stackoverflow.com

I'm working on a .NET C# project on which I had to use NHibernate Mapping Attributes to map my objects to my tables in my database. Now let's explain what my problem ...

9. hql join - Path expected for join    stackoverflow.com

I have the following hql. This works fine if i don't try and include the "OrderItem" entity. I understand that there is no "on" clause in hql. What is the best ...

10. NHibernate HQL - Joining    stackoverflow.com

I want todo a simple join, well just comparing the ID's in two tables.. I have my Group Table, containing;

  • ID
  • Name
  • etc..
And i have my GroupMap Table containing;
  • ID
  • GroupID
  • ItemID
My query takes a GroupMap.ItemID and is ...

11. NHibernate inner join gives "Path expected for join"    stackoverflow.com

I have three Tables:

- Person
- User
- PersonSecret
where PersonSecret reference to Person and User:
<class name="PersonSecret" table="PersonSecret" lazy="false"  >
<id name="Id" column="Id" type="Guid">      

12. HQL Path expected for join (when joining same table)    stackoverflow.com

I am trying to get pairs of measurement for two different devices, joined on equal Timestamps. In SQL, this works as expected:

  leftItem.Timestamp, leftItem.Value, rightItem.Value
  DataTable leftItem
  inner ...

13. How to inner join a derived table with Hibernate/NHibernate?    stackoverflow.com

(First i'd like to apologize if this is a duplicate, I can't find any good solution for it even though it must be simple) I'm creating reports from sales-data and need to ...

14. HQL join vs. Exists    stackoverflow.com

I'm trying to adjust an existing HQL query's WHERE clause; where currently I'm filtering on the 'User.Affiliate' property (user record has a FK to affiliate):

select u from User u  where ...

15. How to do ThenFetch in Hql and How do you break up many joins in nhibernate linq?    stackoverflow.com

I have 2 questions

  1. How do you do a then fetch in hql?
like in linq it would be
var allRecords = session.Query<Table1P>().FetchMany(x => x.Table2).ThenFetchMany(x => x.Table5s);
  1. How to break up a query when you ...