Check getOne(id) null or entity not found? : I'm try (must) use getOne for get data form DB, and when entity not found, I can not check with

    obj = repository.getOne(id);
    if(obj == null){//error
    ...
    }

I want to check if entity found or not, can you help me in this case ?

Thanks all!