title: How to correct sql statement to give correct result
body: <p>I'm running a local MySQL Server on port 3306 with a schema "sys" featuring a table "users" <a href="https://i.stack.imgur.com/JpFER.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JpFER.png" alt="Table in sys schema"></a></p>
  
  <p>Now I have a small spring boot application to query all entries from that table.
  Model for that table is:</p>
  
  <pre><code>package com.example.databaseneu.model;
  
  import javax.persistence.Entity;
  import javax.persistence.Id;
  
  @Entity
  public class Users {
  
  @Id
  // @Column(name = "id")
  private int id;
  // @Column(name = "name")
  private String name;
  // @Column(name = "salary")
  private int salary;
  // @Column(name = "team_name")
  private String team_name;
  
  public int getId() {
      return id;
  }
  
  public void setId(int id) {
      this.id = id;
  }
  
  public String getName() {
      return name;
  }
  
  public void setName(String name) {
      this.name = name;
  }
  
  public int getSalary() {
      return salary;
  }
  
  public void setSalary(int salary) {
      this.salary = salary;
  }
  
  public String getTeam_name() {
      return team_name;
  }
  
  public void setTeam_name(String team_name) {
      this.team_name = team_name;
  }}
  </code></pre>
  
  <p>The connection works, but the query doesnt seem to deliver the right result as I get the Whitelabel Error Page.
  Query to get all elements from the table (autogenerated by repository)</p>
  
  <pre><code>Hibernate: 
  select
      users0_.id as id1_0_,
      users0_.name as name2_0_,
      users0_.salary as salary3_0_,
      users0_.team_name as team_nam4_0_ 
  from
      users users0_
  </code></pre>
  
  <p>So I'm uncertain if i defined the Entity wrong or something else alltogether
  @Column Tag doesnt do the trick.</p>
  
  <p>---Edit---</p>
  
  <pre><code>package com.example.databaseneu.controller;
  
  import org.springframework.beans.factory.annotation.Autowired;
  import org.springframework.stereotype.Controller;
  import org.springframework.web.bind.annotation.GetMapping;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestParam;
  import org.springframework.web.bind.annotation.ResponseBody;
  
  import com.example.databaseneu.model.Users;
  import com.example.databaseneu.repository.UserRepository;
  
  @Controller // This means that this class is a Controller
  @RequestMapping(path = "/demo") // This means URL's start with /demo (after Application path)
  public class MainController {
  
  @Autowired
  private UserRepository userRepository;
  
  @GetMapping(path = "/add")
  public @ResponseBody String addNewUser(@RequestParam String name, @RequestParam int salary,
          @RequestParam String team_name) {
      Users n = new Users();
      n.setName(name);
      n.setSalary(salary);
      n.setTeam_name(team_name);
      userRepository.save(n);
      return "Saved";
  }
  
  @GetMapping(path = "/all")
  public Iterable&lt;Users&gt; getAllUsers() {
      return userRepository.findAll();
  }}
  </code></pre>
  
  <p>So id navigate to localhost:8080/demo/all</p>