Spring Boot. how to Pass Optional<> to an Entity Class

前端 未结 7 1666
予麋鹿
予麋鹿 2021-02-13 16:06

i am currently making a website using spring and i stumble upon this basic scenario that i don\'t have any idea on how to solve this specific code: Entity = Optional;

         


        
相关标签:
7条回答
  • 2021-02-13 17:07

    The shortest way of doing this casting

    RoomEntity roomEntity = roomRepository.findById(roomId).get();
    
    0 讨论(0)
提交回复
热议问题