EJB QL的功能已经不错了,如果你是在有特殊需要就用BMP好了

解决方案 »

  1.   

    为什么要写成'%?1%',你可以把‘%’直接放到参数里传进去,直接写 like ?1 就行了啊
      

  2.   

    可以考虑在sessionBean中来写SQL语句了
      

  3.   

    没办法啊
    只能用BMP
    BMP是最方便的了
    只是写起来麻烦些
      

  4.   

    我在水木清华的BBS找到一篇文章介绍到,用like CONCAT(CONCAT('%',?1),'%')
    的写法解决了但是我用这种方法时,却得到异常:
    没有这样的 DataAccessSpec:FindByFuzzyCode. The backend datastore does not suppo
    rt the SQLStatement needed by this AccessIntent: access intent: (pessimistic upd
    ate-weakestLockAtLoad)(collections: transaction/25) (resource manager prefetch:
    0)。我是这样写的:select distinct object(o) from ItemGroup o where o.groupCode like
    concat(concat('%',?1),'%')我的数据库是Oracle,开发环境WSAD
    难道其它数据库支持,Oracle不支持?
    应该怎么样解决?谢谢!!
      

  5.   

    DAO....
    写连接池或用自带的连接池