没有心思看这么多的代码,
不过如果是要用HQL进行符合主键的查询。那么这样就可以。
from RoleFunctionBO where RoleFunctionBO.RoleFunctionBOKey.roleId='条件'
这样就可以的。

解决方案 »

  1.   

    我是这样写的,报错了,感觉联合主键不应该用RoleFunctionBO.RoleFunctionBOKey.roleId吧
      

  2.   


      return this.getHibernateTemplate().find("from RoleFunctionBO where roleId= ? ", new Long(0));     这样写就行了,不用理睬那个xxxKey.
    它只是用来对主键进行抽取,以方便
    下面的调用:return (RoleFunctionBO )this.getHibernateTemplate().get(RoleFunctionBO .class, fkey);