当前位置: 代码迷 >> PB >> PBWDP项目未解决有关问题总结
  详细解决方案

PBWDP项目未解决有关问题总结

热度:46   发布时间:2016-04-29 08:14:10.0
PBWDP项目未解决问题总结

1. [email protected]

??? @Entity(name="greenpages.jpa.model.Listing")
??? @Table(name="LISTING")
??? public class Listing implements Serializable{

? ? ...... ??

??? }

?

??? String queryString = "select l from Listing l where upper(l.lastName) like ?";
??? List<Listing> list = this.getHibernateTemplate().find(queryString,new Object[]{"%" +

??? term.toUpperCase() + "%"});

?

??? 说明:[email protected],上述查询语句:queryString或写成:

??? select l from greenpages.jpa.model.Listing l where upper(l.lastName) like ?,

??? 都将产生异常:

??? org.hibernate.QueryException: in expected: l [select l from Listing l where upper(l.lastName)

??? like ?],

??? 若不指定该属性,则查询语句:queryString也可写成:

??? select l from greenpages.jpa.model.Listing l where upper(l.lastName) like ?,查询均成功。

2.

?

?

  相关解决方案