Issue Type: Bug Bug
Affects Versions: 4.1.8
Assignee: Unassigned
Components: core
Created: 30/Nov/12 3:49 AM
Description:

The method

SimpleNaturalIdLoadAccess.getReference(Object naturalIdValue)

is documented with

"@return the persistent instance or proxy"

This is wrong. The method returns null if the entity is not found.

See implementation

@Override
public Object getReference(Object naturalIdValue) {
final Serializable entityId =
resolveNaturalId( getNaturalIdParameters( naturalIdValue ) );
if ( entityId == null ) { return null; }
return this.getIdentifierLoadAccess().getReference( entityId );
}

TestCase:

getSession().bySimpleNaturalId(User.class).getReference("NO_USER_WITH_THIS_NAME");

Environment: 4.1.8, postgresql
Project: Hibernate ORM
Labels: documentation
Priority: Minor Minor
Reporter: Janning Vygen
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira