protected Person getPersonById ( String id ) { Person person = null ; try { Long personId = Long . valueOf ( id ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Retrieving Person with id=[{}]" , personId ) ; } person = entityManager . find ( Person . class , personId ) ; } catch ( NumberFormatException e ) { if ( logger . isWarnEnabled ( ) ) { logger . warn ( "Invalid number format: {}" , id ) ; } } if ( person == null ) { throw new IllegalArgumentException ( ) ; } return person ; }
Retrieves the person with the given id . Throwing an IllegalArgumentException if there is no such person .