Hibernate中的构造方法,获取方法和设置方法的顺序

I have just started with Hibernate and wanted to know the order of how the getters, setters and constructors are called while persisting and reading to/from database. I ran a simple program and below is the order of call to getters,setters and constructor.

主要

Session session = HibernateUtil.buildSessionFactory().openSession();


session.getTransaction().begin();


Teacher t = new Teacher("John");
session.save(t);
Teacher t1= (Teacher) session.get(Teacher.class,1);


session.getTransaction().commit();



session.close();

老师

@Entity
@Table(name="Teacher")
public class Teacher {

    @Id
    @GeneratedValue(strategy=GenerationType.AUTO)
    int id;

    @Column
    String name;



    public Teacher(String name) {
        super();

        this.name = name;
    }

    public Teacher()
    {
        System.out.println("const");
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Column
    @Access(AccessType.PROPERTY) 
    public String getName() {
        System.out.println("get Name");
        return name;
    }
    @Column
    @Access(AccessType.PROPERTY) 
    public void setName(String name) {
        System.out.println("set Name");
        this.name = name;
    }

O / P

get Name
Hibernate: insert into janumerijaan (name) values (?)
Hibernate: select teacher0_.id as id1_2_0_, teacher0_.name as name2_2_0_ from janumerijaan teacher0_ where teacher0_.id=?
const
set Name
get Name
get Name

Can someone please explain why there is a call to getters twice at the end of the output