I called CrudRepository#findById
two times inside the same method, it displayed in console one select statement.
why the second select statement doesn't displayed in the second method call.
here is the service code:
@Service
@RequiredArgsConstructor
public class AccountService {
private final AccountReporitory accountReporitory;
public void find() {
final Account account1 = accountReporitory.findById(1L).get();
final Account account2 = accountReporitory.findById(1L).get();
}
}
here is the repository code:
public interface AccountReporitory extends JpaRepository<Account, Long> {
}