Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. Error:(38, 25) java: cannot find symbol
  2. symbol: method orElseThrow(()->new Re[...]+ id))
  3. location: class com.idemia.oauth.entity.Domain
  4.  
  5. public DomainDTO findById(Integer id) throws ResourceNotFoundException {
  6.  
  7.  
  8.  
  9. Domain domain =
  10. domainRepository.findDomainById(id)
  11. .orElseThrow(() -> new ResourceNotFoundException(" On finding domain does not exist on :: " + id)); // ** getting error in lamda expression **** //
  12. return domainMapper.toDomainDTO(domain);
  13. }
  14.  
  15. Domain domain =
  16. Optional.ofNullable(domainRepository.findDomainById(id))
  17. // ^-----------------^
  18. .orElseThrow(() -> new ResourceNotFoundException(" On finding domain does not exist on :: " + id));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement