我有以下两个实体:
公共类Entity1 { 公共IList e2 {get;组; } }
公共类Entity2 { public string Title {get;组; } }
我只有Entity1的存储库,我知道我可以使用以下标准执行LIKE查询:
criteria.CreateAlias(“e2”,“e1e2”)。添加(Restrictions.LIKE(“Title”,“needle”,Match.Anywhere);
但我需要反过来搜索:
Restrictions.LIKE(“needle”,“Title”,Match.Anywhere)
我该怎么做?
答案 0 :(得分:3)
我认为它不是开箱即用的。
您可以使用SQLCriterion创建它,也可以使用HQL。