正则表达式Hibernate别名

时间:2015-05-06 12:10:39

标签: java regex hibernate

如何在sqlRestriction中的hibernate中使用别名.. 这是我的代码,但它不起作用,它不能识别" emet"和" dest"作为别名

criteria.createAlias("personne", "emet", JoinFragment.INNER_JOIN);
criteria.createAlias("destinataire", "dest", JoinFragment.INNER_JOIN)
        .createCriteria("fichier")
        .add(Restrictions.sqlRestriction("({alias}.codic SIMILAR TO 'U[AB0-9]{4}' and emet.cod = 'ERF') OR (emet.codic SIMILAR TO '[^U]%' and dest.codic like 'AA%') OR (emet.codic SIMILAR TO 'U[AB0-9]{4}' and {dest}.codic SIMILAR TO '[^U]%')"));           

0 个答案:

没有答案