nhibernate - Crossjoin using QueryOver -
how replace hql query below using queryover api?
var sql = "from role r, action r.active = :active , a.active = :active"; var result = manager.session.getisession().createquery(sql) .setboolean("active", true).list();
i don't believe there's way in queryover, since both joinalias
, joinqueryover
require expression describing path related entity.
however, easy accomplish in linq-to-nhibernate:
var result = (from role in manager.session.getisession().query<role>() action in manager.session.getisession().query<action>() role.active == true && action.active == true).tolist();
with nh 3.2, here's sql get:
select role0_.id col_0_0_, action1_.id col_1_0_ [role] role0_, [action] action1_ role0_.isactive = 1 /* @p0 */ , action1_.isactive = 1 /* @p1 */
Comments
Post a Comment