The one difference between get() and load() is how they indicate that the
instance could not be found. If no row with the given identifier value exists in the
database, get() returns null. The load() method throws an ObjectNotFoundException
. It’s your choice what error-handling you prefer.

译文如下:

get()方法和load()在没有找到相关实体类的情况下,处理方式有所不同。get()方法会返回null,而load()则抛出ObjectNotFoundException。调用者可以根据异常处理方式来调用相关方法。

More important, the load() method may return a proxy, a placeholder, without
hitting the database. A consequence of this is that you may get an ObjectNotFoundException
later, as soon as you try to access the returned placeholder and force
its initialization (this is also called lazy loading; we discuss load optimization in later
chapters.)

译文如下:

更重要的是,load()方法会返回代理类,不会调用数据库。造成的结果是,调用者有可能延迟的获得ObjectNotFoundException(因为当调用者正宗需要某个对象的时候,代理类才会初始化,这叫做懒加载)。
 

The load() method always tries to return a proxy, and only returns an
initialized object instance if it’s already managed by the current persistence context.
In the example shown earlier, no database hit occurs at all!The get()
method on the other hand never returns a proxy, it always hits the database.
You may ask why this option is useful—after all, you retrieve an object to
access it. It’s common to obtain a persistent instance to assign it as a reference to
another instance. For example, imagine that you need the item only for a single
purpose: to set an association with a Comment: aComment.setForAuction(item).
If this is all you plan to do with the item, a proxy will do fine; there is no need to
hit the database. In other words, when the Comment is saved, you need the foreign
key value of an item inserted into the COMMENT table. The proxy of an Item provides
just that: an identifier value wrapped in a placeholder that looks like the
real thing.
 

译文如下:

load()方法总是试图返回一个代理类,只返回一个初始化的对象实例,如果它已经由目前的持久化上下文管理。另一方面get()方法永远不会返回一个代理代理,它始终会访问数据库。你可能会问,为什么load()方法要这么做?例如:设置aComment:aComment.setForAuction(item)。当aComment保存的时候,你只需要item的主键,item对象的代理类也仅仅提供其主键。