In the FAQ and forum, you often see questions about how to map the results of a local SQL query to a value object, and here's a conclusion on the methods provided in Hibernate. As a prerequisite, there is no deferred loading technique using attributes.
Suppose there is a value pair, as follows:
Java code
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, 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) {
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;
}
}