简体   繁体   中英

Like in hibernate named query

I added named query in my hbm.xml file and is not working, as code below.

<query name="ca.getChildCategories"><![CDATA[
from category as ca where ca.name like :name
        ]]></query>

and am calling it as

getHibernateTemplate().findByNamedQueryAndNamedParam("ca.getChildCategories" , 
                                new String[] { "name"},
                                new Object[] { likeKey});

The application is not able to UP. Any help wil be very much appreciated.

请使用from Category ca where ca.name like :name不使用as写HQL查询时。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM