I don't know how Spring implemented this in the past, but at least currently it's not correct that they are the same (just alias).
Spring JPA is layer on top of JPA. Therefore each of these operations is mapped to a Standard JPA operation:
findById(id) -> [on JPA] entityManager.find
Whilst,
getOne(id) -> [JPA] entityManager.getReference
So what's the difference on JPA then?
entityManager.find goes direactly to the DB, executes the query and gets the result in memory. Pretty straightforward.
entityManager.getReference is less used (because don't know it). It's sort of a lazy find.
That is, it doesn't go directly to the DB. It only goes when the data is used. Its main target is when you just want a reference to some entity, but you won't use the entity.
For instance:
class Customer {
Long id;
... many other fields
}
class Order {
Customer customer;
// ... other
}
You want to save a new Order:
var order = new Order();
// order.setCustomer(repo.findById(123L)); // Opt 1: goes directly to DB and load everything from this customer. But we don't need it all
order.setCustomer(repo.getOne(123L)); // Opt 2: Won't go to DB for the customer
orderRepo.saveOrUpdate(order);
You can check a whole article explaining the diff, and better about getReference here: https://vladmihalcea.com/entitymanager-find-getreference-jpa/