title: Can't extract ResultSet, related to String as
body: <p>Error messages in spring: </p>
  
  <pre><code>: GenerationTarget encountered exception accepting command : Error executing DDL "create table category_class (category_name varchar(255) not null, primary key (category_name)) engine=MyISAM" via JDBC Statement
  
  
  
  : GenerationTarget encountered exception accepting command : Error executing DDL "alter table book_class add constraint FKqov24n7bmx5f0s8d74tdxbgbk foreign key (book_category) references category_class (category_name)" via JDBC Statement
  </code></pre>
  
  <p>Can't exact result set using Spring Boot with Hibernate.</p>
  
  <pre><code> Caused by: java.sql.SQLSyntaxErrorException: Table 'myDatabase.category_class' doesn't exist
  </code></pre>
  
  <p>All my other tables are displayed correctly, however my category class does have a string as PK, which may be the cause of the issue. 
  The Error occurs when I try to acess the mysql database with findAll through my categoryService and CategoryRepository which extends JPARepository.</p>
  
  <p>--Category.java--</p>
  
  <pre><code>package myPackage;
  import lombok.Data;
  import lombok.NoArgsConstructor;
  
  import javax.persistence.*;
  import java.util.List;
  
  @Data
  @NoArgsConstructor
  @Entity
  @Table(name="category_class")
  public class Category {
          @Id
          @Column(name = "categoryName")
          private String name;
  
          @OneToMany(mappedBy = "category")
          private List&lt;Book&gt; books;
  }
  </code></pre>
  
  <p>--application.properties--</p>
  
  <pre><code>spring.datasource.url= jdbc:mysql://localhost:3306/oblig2_v3
  spring.datasource.username=
  spring.datasource.password =
  spring.datasource.testWhileIdle=true
  spring.datasource.validationQuery=SELECT 1
  spring.jpa.generate-ddl=true
  spring.jpa.show-sql=false
  spring.jpa.hibernate.ddl-auto=create
  spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy
  spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
  server.port=8080
  </code></pre>
  
  <p>Does anyone know why my table is not getting created in MySQL?</p>
  
  <p>EDIT: Book class added &amp;&amp; cleanup.</p>
  
  <p>---Book.java---</p>
  
  <pre><code>import lombok.Data;
  import lombok.NoArgsConstructor;
  
  import javax.persistence.*;
  import java.util.List;
  
  @Data
  @NoArgsConstructor
  @Entity
  @Table(name="book_class")
  public class Book {
          @Id
          @GeneratedValue(strategy = GenerationType.AUTO)
          private long ISBN; //PK
          private String title;
          private String releaseYear;
          private int quantity;
  
          @ManyToOne
          @JoinColumn(name ="book_category")
          private Category category;
  
          @ManyToOne
          @JoinColumn(name ="author")
          private Author author;
  
          @ManyToMany(mappedBy = "books")
          private List&lt;Order&gt; orders;
  
  }
  </code></pre>