Recently, support for aliasing via an outer join was added to the Criteria class. The method
createAlias(String associationPath, String alias, int joinType)
, however, is not defined for DetachedCriteria. Adding this functionality would be extremely helpful for applications that expose detached criteria as their query api, and also for subqueries.
Hibernate 3.1, SQLServer2000
I've attached a simple patch against 3.1.3 that implements this feature. Actually, what the patch does is implement relevant functions in Criteria in the DetachedCriteria class. Those are:
All variants of createAlias()
All variants of createCriteria()
All variants of setLockMode()
setComment() (not used much, I suppose, but why not?)
It wasn't clear whether setFlushMode() and setCacheMode() should be applied to DetachedCriteria. My guess is that those are more properties of the executable criteria, like setFirstResult()/setMaxResult(), and aren't part of the query itself, but rather, of the execution environment.
Fixed in trunk/3.2
Bulk closing stale resolved issues