title: JpaRepository findAll returns empty List
body: <p><code>findAll()</code> method from <code>JpaRepository</code> returns empty value, but correct number of empty values</p>
  
  <p>I'm using h2 database and everything has worked fine until some unknown moment. Simple GET at <code>http://localhost:8080/users</code> returns {} x number of users previously added to the database. I tried implementing a method that would return id based on username and that works just fine.</p>
  
  <p>Here is my <code>User.java</code>:</p>
  
  <pre><code>@Entity
  @Table(name = "Users")
  public class User {
  
      @Id
      @GeneratedValue(strategy = GenerationType.IDENTITY)
      private Long id;
      @Column(name = "username")
      @NotBlank(message = "Username is mandatory")
      @Size(min = 1, max = 20, message = "Username must be less than 20 characters long")
      private String username;
      @Column(name = "balance")
      private Double balance = 0.0;
  
      Long getId() {
          return id;
      }
  
      void setId(Long id) {
          this.id = id;
      }
  
      String getUsername() {
          return username;
      }
  
      void setUsername(String username) {
          this.username = username;
      }
  
      Double getBalance() {
          return balance;
      }
  
      void setBalance(Double balance) {
          this.balance = balance;
      }
  }
  </code></pre>
  
  <p>Here is <code>UserService</code> which implements methods from <code>IUserService</code>:</p>
  
  <pre><code>@Service
  public class UserService implements IUserService {
  
      @Autowired
      private UserRepository repository;
  
      @Override
      public void createNewUser(User user) {
          repository.save(user);
      }
  
      @Override
      public List&lt;User&gt; findAll() {
          return repository.findAll();
      }
  
      @Override
      public Long findByUsername(String username) {
          return repository.findByUsername(username);
      }
  
      @Override
      public User findById(Long id) {
          return repository.findById(id).orElse(null);
      }
  
      @Override
      public boolean checkIfUsernameIsTaken(User user) {
          return repository.findByUsername(user.getUsername()) != null;
      }
  
      @Override
      public void deleteUser(Long id) {
          repository.deleteById(id);
      }
  
      @Override
      public void updateBalance(Long id, Double balance) {
          repository.updateBalance(id, balance);
      }
  }
  </code></pre>
  
  <p>I tried with and without <code>@Column</code> annotations and it doesn't seem to do anything.</p>
  
  <p>The output I get from Postman is [{}] if I added only one user via <code>createNewuser()</code>, [{},{}] if I added two users and so on. I don't understand what broke the <code>findAll()</code> method.</p>
  
  <p>P.S. <code>updateBalance()</code> doesn't work either, but that's for some other time.</p>
  
  <p>Edit: some ov you asked for <code>UserController</code>:</p>
  
  <pre><code>@RestController
  public class UserController {
  
      @Autowired
      IUserService userService;
  
      @GetMapping("/users")
      public List&lt;User&gt; findUsers() {
          return userService.findAll();
      }
  
      @GetMapping("/users/{id}")
      public User findUserById(@PathVariable Long id) {
          return userService.findById(id);
      }
  
      @PostMapping("/users")
      public ResponseEntity&lt;Object&gt; createUser(@RequestBody User user) {
  
          if (userService.checkIfUsernameIsTaken(user)) {
  
              Map&lt;String, Object&gt; response = new HashMap&lt;&gt;();
              response.put("status", HttpStatus.NOT_ACCEPTABLE);
              response.put("errors", "Username is already taken");
              response.put("timestamp", new Date());
  
              return new ResponseEntity&lt;&gt;(response, HttpStatus.BAD_REQUEST);
          } else {
              userService.createNewUser(user);
              User currentUser = userService.findById(userService.findByUsername(user.getUsername()));
              Map&lt;String, Object&gt; response = new HashMap&lt;&gt;();
              response.put("id", currentUser.getId());
              response.put("username", currentUser.getUsername());
              response.put("balance", currentUser.getBalance());
              return new ResponseEntity&lt;&gt;(response, HttpStatus.OK);
          }
      }
  
      @DeleteMapping("/users/{id}")
      public void deleteUser(@PathVariable Long id) {
          userService.deleteUser(id);
      }
  
      @PutMapping("/users/{id}/{balance}")
      public void updateBalance(@PathVariable Long id, @PathVariable Double balance) {
          userService.updateBalance(id, balance);
      }
  }
  </code></pre>
  
  <p>and <code>UserRepository</code>:</p>
  
  <pre><code>@Repository
  public interface UserRepository extends JpaRepository&lt;User, Long&gt; {
  
      @Query("SELECT id FROM User WHERE username = ?1")
      Long findByUsername(String username);
  
      @Transactional
      @Modifying
      @Query("UPDATE User SET balance = ?2 WHERE id = ?1")
      void updateBalance(Long id, Double balance);
  }
  </code></pre>
  
  <p>My problems first appeared (or so I think) after I implmented the update query, but I tried running a version where I know it worked on a different computer, but it didn't work.</p>