摘要: 原理:1.通过Configuration().configure();读取并解析hibernate.cfg.xml配置文件2.由hibernate.cfg.xml中的<mapping resource="com/xx/User.hbm.xml"/>读取并解析映射信息3.通过config.buildS 阅读全文
posted @ 2017-07-28 21:45 青春不再少年时 阅读(85) 评论(0) 推荐(0) 编辑
摘要: 表关联时,外键关联非主键id时-hbm.xml配置: (由于hibernate默认为关联主键查询,故需要配置相关hql语句的属性) <many-to-one name="areas" class="com.hnqy.entity.Areas" fetch="select" property-ref= 阅读全文
posted @ 2017-07-28 21:27 青春不再少年时 阅读(574) 评论(0) 推荐(0) 编辑