Spring-data-jpa 中 findOne 与 getOne 的区别

T findOne(ID id)

Retrieves an entity by its id.
Parameters:
id - must not be null.
Returns:
the entity with the given id or null if none found
Throws:
IllegalArgumentException - if id is null

T getOne(ID id)

Returns a reference to the entity with the given identifier.
Parameters:
id - must not be null.
Returns:
a reference to the entity with the given identifier.
See Also:
EntityManager.getReference(Class, Object)

{ % ossimag os-admin-debug.png % }
DEBUG下:osAdmin 为getOne()查询的结果,osAdmin2为findOne查询的结果