数据库为达梦,sql语句为:
select * from table_ where 1 = 1 and contains(column_,'内容')
现在拼接hql语句
select * from com.table_ where 1 = 1 这句可以正常执行
select * from table_ where 1 = 1 and contains(column_,'内容'); 报出unexpected AST node: 错误
肯定是contains无法解析了,请问下如何在hibernate的hql语句使用该函数呢?
clasee TableSerice extends HibernateDaoSupport{
//返回list<map>
public List<Map> exeSqlToListMap(sql){
Query query =super.currentSession().createSQLQuery(sql);
List<Map> list=query.setResultTransformer(CriteriaSpecification.ALIAS_TO_ENTITY_MAP).list();
returl list;
}
//返回List<Model>
public List<T> exeSqlToList(sql){
Query query =super.currentSession().createSQLQuery(sql2.toString()).addEntity(AfArchive.class);
List<T> list=query.list();
returl list;
}
}