What's the advantage of load() vs get() in Hibernate?

前端 未结 10 2737
感情败类
感情败类 2020-12-02 04:58

Can anyone tell me what\'s the advantage of load() vs get() in Hibernate?

10条回答
  •  情话喂你
    2020-12-02 05:28

    Whats the advantage of load() vs get() in Hibernate?


    source

    Proxy means, hibernate will prepare some fake object with given identifier value in the memory without hitting a database.

    For Example:
    If we call session.load(Student.class,new Integer(107));

    hibernate will create one fake Student object [row] in the memory with id 107, but remaining properties of Student class will not even be initialized.

    Source

提交回复
热议问题