sql - subselect vs outer join

sql - subselect vs outer join

Consider the following 2 queries: select tblA.a,tblA.b,tblA.c,tblA.d from tblA where tblA.a not in(select tblB.a from tblB) select tblA.a,tblA.b,tblA.c,tblA.d from tblA left outer join tblB on tblA…


Transact-SQL-sub query or left-join?

I have two tables containing Tasks and Notes, and want to retrieve a list of tasks with the number of associated notes for each one. These two queries do the job: select t.TaskId,(select coun…


NHibernate Eager loading multi-level child objects

I have a hierarchy of objects, Order, Contact, Address: public class Order{public virtual Contact BillingContact{get; set;}} public class Contact{public virtual Address Address{g…


hibernate - JPA: please help understanding “join fetch”

I have the following entity structure: Business--> Campaign--> Promotion, where ONE Business can have MANY Campaigns and ONE Campaign can have MANY Promotions. Both one-to-many relations are declare…


java - Does JPA support mapping to sql views?

I'm currently using Eclipselink, but I know now days most JPA implementations have been pretty standardized. Is there a native way to map a JPA entity to a view? I am not looking to insert/update, but…


NHibernate Fluent vs. Attributes

I'm interested in moving some NHibernate configurations/mappings into the code to help with some maintenance issues. Can anyone provide any advice/pros/cons/comparisons of Fluent NHibernate vs. NHibe…


php - Doctrine-subquery in from

I have a query in MySQL: SELECT*FROM(SELECT COUNT(*) AS count, t.name AS name FROM tag t INNER JOIN video_has_tag v USING(idTag) GROUP BY v.idTag ORDER BY count DESC LIMIT…


java - Hibernate Criteria Subquery

I need to do this SQL query with detachedCriteria: SELECT g.id FROM games g WHERE NOT EXISTS(SELECT 1 FROM users_games ug WHERE ug.user_id=1 AND g.id=ug.game_id) The idea is to get the ids…


java - Force eager loading of otherwise lazy loaded properties

I've got a Hibernate object which's properties are all loaded lazy. Most of these properties are other Hibernate objects or PersistentSets. Now I want to force Hibernate to eager load these properties…


Multiple Fetches in linq to nhibernate

I was looking at this Be careful not to eagerly fetch multiple collection properties at the same time. Although this statement will work fine: var employees=session.Query().Fetch(e…





join nhibernate fetch hibernate subquery not batch working query performance