Buggy code:
@ Repository public class CollaboratorRepositoryImpl implements CollaboratorRepository { private final JdbcTemplate jdbcTemplate ; @ Autowired public CollaboratorRepositoryImpl ( JdbcTemplate jdbcTemplate ) { } @ Transactional ( readOnly = true ) @ Override public List < Collaborator > findAll ( ) { final String query = "select<seq2seq4repair_space>" + ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( ( "<seq2seq4repair_space>p.id,<seq2seq4repair_space>" + "<seq2seq4repair_space>p.name,<seq2seq4repair_space>" ) + "<seq2seq4repair_space>p.gender,<seq2seq4repair_space>" ) + "<seq2seq4repair_space>p.birth_date,<seq2seq4repair_space>" ) + "<seq2seq4repair_space>c.start_date,<seq2seq4repair_space>" ) + "<seq2seq4repair_space>c.release_date,<seq2seq4repair_space>" ) + "<seq2seq4repair_space>c.observation,<seq2seq4repair_space>" ) + "<seq2seq4repair_space>u.id<seq2seq4repair_space>as<seq2seq4repair_space>user_credentials_id,<seq2seq4repair_space>" ) + "<seq2seq4repair_space>u.username,<seq2seq4repair_space>" ) + "<seq2seq4repair_space>u.password,<seq2seq4repair_space>" ) + "<seq2seq4repair_space>u.user_role<seq2seq4repair_space>" ) + "from<seq2seq4repair_space>" ) + "<seq2seq4repair_space>Collaborator<seq2seq4repair_space>c<seq2seq4repair_space>" ) + "<seq2seq4repair_space>inner<seq2seq4repair_space>join<seq2seq4repair_space>Person<seq2seq4repair_space>p<seq2seq4repair_space>on<seq2seq4repair_space>p.id<seq2seq4repair_space>=<seq2seq4repair_space>c.person_id<seq2seq4repair_space>" ) + "<seq2seq4repair_space>inner<seq2seq4repair_space>join<seq2seq4repair_space>UserCredentials<seq2seq4repair_space>u<seq2seq4repair_space>on<seq2seq4repair_space>u.id<seq2seq4repair_space>=<seq2seq4repair_space>c.usercredentials_id<seq2seq4repair_space>" ) + "order<seq2seq4repair_space>by<seq2seq4repair_space>" ) + "<seq2seq4repair_space>p.name" ) ; final List < Collaborator > collaborators = jdbcTemplate . query ( query , new Object [ ] { } , new org . springframework . jdbc . core . RowMapper < Collaborator > ( ) { @ Override public Collaborator mapRow ( ResultSet resultSet , int i ) throws SQLException { final Person person = new Person ( ) ; person . setId ( UUID . fromString ( resultSet . getString ( "id" ) ) ) ; person . setName ( resultSet . getString ( "name" ) ) ; person . setGenderType ( GenderType . valueOf ( resultSet . getString ( "gender" ) ) ) ; person . setBirthDate ( new DateTime ( resultSet . getLong ( "birth_date" ) ) ) ; final UserCredentials userCredentials = new UserCredentials ( ) ; userCredentials . setId ( UUID . fromString ( resultSet . getString ( "user_credentials_id" ) ) ) ; userCredentials . setUserName ( resultSet . getString ( "username" ) ) ; userCredentials . setPassword ( Password . fromSecret ( resultSet . getString ( "password" ) ) ) ; userCredentials . setUserRole ( UserRole . valueOf ( resultSet . getString ( "user_role" ) ) ) ; final Collaborator collaborator = new Collaborator ( ) ; collaborator . setPerson ( person ) ; collaborator . setUserCredentials ( userCredentials ) ; collaborator . setStartDate ( new DateTime ( resultSet . getLong ( "start_date" ) ) ) ; collaborator . setReleaseDate ( new DateTime ( resultSet . getLong ( "release_date" ) ) ) ; collaborator . setObservation ( resultSet . getString ( "observation" ) ) ; return collaborator ; } } ) ; for ( Collaborator collaborator : collaborators ) { final List < Telephone > telephones = jdbcTemplate . query ( "select<seq2seq4repair_space>*<seq2seq4repair_space>from<seq2seq4repair_space>Telephone<seq2seq4repair_space>where<seq2seq4repair_space>person_id<seq2seq4repair_space>=<seq2seq4repair_space>?" , new Object [ ] { collaborator . getPerson ( ) . getId ( ) . toString ( ) } , new org . springframework . jdbc . core . RowMapper < Telephone > ( ) { @ Override public Telephone mapRow ( ResultSet resultSet , int i ) throws SQLException { final Telephone telephone = new Telephone ( ) ; telephone . setId ( UUID . fromString ( resultSet . getString ( "id" ) ) ) ; telephone . setAreaCode ( resultSet . getInt ( "area_code" ) ) ; telephone . setNumber ( resultSet . getInt ( "number" ) ) ; <START_BUG> telephone . setPhoneType ( PhoneType . valueOf ( resultSet . getString ( "phoneType" ) ) ) ; <END_BUG> return telephone ; } } ) ; collaborator . getPerson ( ) . setTelephones ( telephones ) ; } return collaborators ; } @ Transactional ( readOnly = true ) @ Override public Collaborator findById ( UUID id ) { } @ Transactional ( readOnly = true ) @ Override public boolean existsById ( UUID id ) { } @ Transactional @ Override public void removeById ( UUID id ) { } @ Transactional @ Override public void addCollaborator ( Collaborator newCollaborator ) { } @ Transactional @ Override public void updateCollaborator ( Collaborator newCollaborator ) { } private void doRemoveById ( String id ) { } }

Fix:
telephone . setPhoneType ( PhoneType . valueOf ( resultSet . getString ( "phone_type" ) ) ) ;