在Hibernate中load()vs get()的优点是什么? [英] What's the advantage of load() vs get() in Hibernate?

查看:123
本文介绍了在Hibernate中load()vs get()的优点是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

解决方案


在任何人都可以告诉我load()和get()在Hibernate中的优点吗?在Hibernate中load()vs get()的优点是什么?






例如:
如果我们调用 session.load(Student.class,new Integer(107) );



hibernate将在id为107的内存中创建一个假Student对象[行],但Student类的其余属性将不会被初始化。


来源


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

解决方案

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

这篇关于在Hibernate中load()vs get()的优点是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆