Hibernate联合主键 以及根据联合主键中字段查询

这篇博客介绍了如何在Hibernate中处理联合主键,并展示了如何根据联合主键的单个字段进行查询。示例中,`PropertyFileBsline` 类的主键由 `Bslineid` 和 `Bslinepropertyid` 两个字段组成,通过 `Hibernate-mapping` 定义了映射关系。此外,还展示了对应的主键类 `PropertyFileBslinePK` 的构造以及HQL查询语句,如 `from PropertyFileBsline a where a.id.bslineid =?`。
摘要由CSDN通过智能技术生成
hibernate里联合主键配置
  1. <hibernate-mapping package="com.boise">  
  2.     <class name="PropertyFileBsline" table="property_file_bsline">  
  3.        <composite-id name="Id" class="PropertyFileBslinePK">  
  4.           <key-property name="Bslineid" column="bslineid" type="string"/>  
  5.           <key-property name="Bslinepropertyid" column="bslinepropertyid"  
  6.     type="string"/>  
  7.        </composite-id>  
  8.        <property   
  9.           name="Bslinepropertyname"  
  10.           column="bslinepropertyname"  
  11.           type
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值