![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
hibernate
singtorain
这个作者很懒,什么都没留下…
展开
-
Hibernate使用SQL查询返回实体类型
注意实体类数据名称要和查询字段名称一样 String sql = null; sql="select a.tagid,a.datetime,a.value,b.tagname,b.danwei,b.image,b.standvalue from Station"+station+" a left join tagDesc b on a.tagid=b.tagid where a.tagid原创 2016-10-28 10:00:25 · 1905 阅读 · 0 评论 -
Hibernate中用注解配置一对多双向关联和多对一单向关联
http://www.cnblogs.com/hmy-1365/p/5790087.html Hibernate中用注解配置一对多双向关联和多对一单向关联 Hibernate提供了Hibernate Annotations扩展包,使用注解完成映射。在Hibernate3.3之前,需单独下载注解开发包 配置持久化类 配置关联关系 下面我们先从多对一单向关联关系讲起,转载 2016-11-29 10:44:35 · 668 阅读 · 0 评论 -
hibernate中mappedby的理解
mappedBy的意思就是“被映射”,即mappedBy这方不用管关联关系,关联关系交给另一方处理 1.规律:凡是双向关联,mapped必设,因为根本都没必要在2个表中都存在一个外键关联,在数据库中只要定义一边就可以了 a) 只有OneToOne,OneToMany,ManyToMany上才有mappedBy属性,ManyToOne不存在该属性; b) mappedBy标签一定是定义在th转载 2016-11-24 20:51:49 · 4327 阅读 · 0 评论