办理Hibernate原生SQL映射问题[Java编程]
本文“办理Hibernate原生SQL映射问题[Java编程]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:
在问答里和论坛中,常常看到有人问,怎样将利用本地SQL查询出来的后果映射为值对象的问题,这里就Hibernate中供应的办法做个结论.前提,这里没有利用属性的耽误加载技术.
假定有个值对像,以下:
Java代码
package test;
public class Person {
private Long id;
private String name;
private Long age;
private Long phone;
private String address;
public Person(Long id, String name, Long age, Long phone, String address) {
this.id = id;
this.name = name;
this.age = age;
this.phone = phone;
this.address = address;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Long getAge() {
return age;
}
public void setAge(Long age) {
this.age = age;
}
public Long getPhone() {
return phone;
}
public void setPhone(Long phone) {
this.phone = phone;
}
public String getAddress() {
return address;
}
public void setAddress(String address) {
this.address = address;
}
}
以上是“办理Hibernate原生SQL映射问题[Java编程]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:
本文地址: | 与您的QQ/BBS好友分享! |