Writing query for foreign key association

I have 2 tables in database User and Link. The userid is a foreign in the link table. I have used hibernate reverse engg xml to create the model classes in java. It has created the User, Link, LinkId class. Here the Link class links the 2 tables, while LinkId contains the attributes of Link. I am trying to query the link table using the userid. The query I have is "createQuery( "from com.paypal.socialpay.models.LinkId li where li.userid=?").setInteger(0, id).list();" But on execution of the query I get "java.lang.IllegalArgumentException: No positional parameters in query: from com.paypal.socialpay.models.LinkId li where li.userid=?" Can someone tell me what I am doing wrong class name="com.paypal.socialpay.models.Link" table="link" catalog="socialdb">

以上就是Writing query for foreign key association的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准