title: why is spring boot returning me a json with null for some values?
body: <p>I'm making a game for practice.</p>
  <p>I have a spring boot/Maven project connected to a MySQL database. I was able to setup an api that simply retrieves everything from my &quot;allriddles&quot; table. It worked before, but now the api returns a json where some values are null for some keys. The only thing i was playing with was the application.properties on the spring boot file. I was hopping between &quot;update&quot; and &quot;none&quot; for the spring.jpa.hibernate.ddl-auto.
  What could I have done wrong?</p>
  <p>application.properties</p>
  <pre><code>spring.jpa.hibernate.format_sql=true
  spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver 
  spring.datasource.url=jdbc:mysql://localhost:3306/riddlesgame
  spring.datasource.username=root
  spring.datasource.password=RiddlesGame886
  spring.jpa.hibernate.ddl-auto=none
  spring.jpa.show-sql=true
  spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL8Dialect
  spring.data.rest.base-path=/api/v1
  server.port=8088
  </code></pre>
  <p>this is the database table and expected columns</p>
  <p><a href="https://i.stack.imgur.com/j1RxH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/j1RxH.png" alt="database table and columns" /></a></p>
  <p>this is the returned json with erronous null values</p>
  <p><a href="https://i.stack.imgur.com/JkJs7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JkJs7.png" alt="returned json with erroneous null values " /></a></p>
  <p>here is the model</p>
  <pre><code>@Entity
  @Table(name = &quot;allriddles&quot;)
  public class Riddle {
  
  /*
   * ATTRIBUTES
   */
  @Id
  @GeneratedValue(strategy=GenerationType.AUTO)
  private int id;
  private String title;
  private int difficulty;
  private String prize;
  private String riddlerName;
  private int levels;
  private String riddleDescription;
  
  /*
   * CONSTRUCTORS
   */
  public Riddle() {}
  public Riddle( String title, int difficulty, String prize, String riddlerName, int levels,
          String description) {
      super();
      
      this.title = title;
      this.difficulty = difficulty;
      this.prize = prize;
      this.riddlerName = riddlerName;
      this.levels = levels;
      this.riddleDescription = description;
  }
  }
  </code></pre>
  <p>this is my controller that calls a service</p>
  <pre><code> @RestController
   public class GetRiddles {
  
  @Autowired
  RiddlesService rs; 
  
  
  @RequestMapping(&quot;/Riddles&quot;)
  public List&lt;Riddle&gt; getAllRiddles(){
      return rs.getAllRiddles();
  }
  </code></pre>
  <p>the service that calls crud</p>
  <pre><code>@Service
  public class RiddlesService {
  
  @Autowired
  RiddlesRepository riddlesRepository;
  
  public List&lt;Riddle&gt; getAllRiddles(){
      List&lt;Riddle&gt; riddles = new ArrayList&lt;&gt;();
      riddlesRepository.findAll()
      .forEach(riddles::add);
      
  
      return riddles;
  }
  </code></pre>
  <p>the crud interface</p>
  <pre><code>public interface RiddlesRepository extends CrudRepository&lt;Riddle, Integer&gt; {
  
  }
  </code></pre>
  <p>and finally the console output if thats of any help</p>
  <p><a href="https://i.stack.imgur.com/s8Mk1.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/s8Mk1.png" alt="trace" /></a></p>