Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Database/JDBC/SQL/JDO/Hibernate  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 这样hsql语句怎写?
lisycn





发贴: 11
积分: 0
于 2007-07-26 15:44 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
表 a:

id (主键) a1 a2

1 a aa

2 aa aaaa

表 b:

id (主键) a.id(外键) b1 b2

1 1 b bb

2 1 bb bbbb

a( id)与b(a.id)表一对多关系 ,现在要删除b表的某一行记录(即b.id=2这一行记录),只知道a.id(外键) 和 b1或 b2

hibernate 如何写hsql



作者 Re:这样hsql语句怎写? [Re:lisycn]
snowbug



CJSDN高级会员


发贴: 418
积分: 130
于 2007-08-02 02:55 user profilesend a private message to usersend email to snowbugsearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
delete from ClassB b
where b.classA = :classA and b.b1 = :b1

然后传入参数 :classA 和 :b1

:classA 通过 session.get(a.id) 取得。




flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923