title: org.hibernate.MappingException: property mapping has wrong number of columns in ENUM entity
body: <p>I created database, which have a references with ENUM table and I have exception in entity of this enum.</p>
  
  <p>scripts example:</p>
  
  <pre><code>CREATE TABLE status (
    code VARCHAR(40),
    status ENUM('not started', 'in progress', 'finished')
  );
  
  insert into status (code, status)
  values (1, 'not started'),
         (2, 'in progress'),
         (3, 'finished');
  </code></pre>
  
  <hr>
  
  <pre><code>CREATE TABLE `explorer` (
    `id` bigint(20) NOT NULL AUTO_INCREMENT,
    `create_date` datetime DEFAULT NULL,
    `query` varchar(255) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
    `title` varchar(255) COLLATE utf8mb4_unicode_520_ci DEFAULT NULL,
    `status_id` int DEFAULT NULL,
    PRIMARY KEY (`id`),
    FOREIGN KEY (status_id) REFERENCES status(code)
  ) ENGINE=MyISAM AUTO_INCREMENT=45 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_520_ci;
  </code></pre>
  
  <hr>
  
  <p>So, after creating table I did create automatically entities for this tables:</p>
  
  <ul>
  <li><p>Explorer:</p>
  
  <pre><code>@Entity
  @Table(name = "explorer", schema = "parsebeandeveloper", catalog = "")
  public class ExplorerEntity {
  private long id;
  private Timestamp createDate;
  private String query;
  private String title;
  private Integer statusId;
  
  @Id
  @Column(name = "id")
  public long getId() {
      return id;
  }
  
  public void setId(long id) {
      this.id = id;
  }
  
  @Basic
  @Column(name = "create_date")
  public Timestamp getCreateDate() {
      return createDate;
  }
  
  public void setCreateDate(Timestamp createDate) {
      this.createDate = createDate;
  }
  
  @Basic
  @Column(name = "query")
  public String getQuery() {
      return query;
  }
  
  public void setQuery(String query) {
      this.query = query;
  }
  
  @Basic
  @Column(name = "title")
  public String getTitle() {
      return title;
  }
  
  public void setTitle(String title) {
      this.title = title;
  }
  
  @Basic
  @Column(name = "status_id")
  public Integer getStatusId() {
      return statusId;
  }
  
  public void setStatusId(Integer statusId) {
      this.statusId = statusId;
  }
  }
  </code></pre></li>
  </ul>
  
  <p>class, where I get exception:</p>
  
  <ul>
  <li><p>Status:</p>
  
  <pre><code>@Entity
  @Table(name = "status", schema = "parsebeandeveloper")
  public class StatusEntity {
  private Integer code;
  private Object status;
  
  @Basic
  @Column(name = "code")
  public Integer getCode() {
      return code;
  }
  
  public void setCode(Integer code) {
      this.code = code;
  }
  
  @Basic
  @Column(name = "status")
  public Object getStatus() {
      return status;
  }
  
  public void setStatus(Object status) {
      this.status = status;
  }
  </code></pre>
  
  <p>}</p></li>
  </ul>
  
  <p>That, what I get in console:</p>
  
  <blockquote>
    <p>org.springframework.beans.factory.BeanCreationException: </p>
    
    <p>Error creating bean with name 'entityManagerFactory' defined in class path 
    resource [org/springframework/boot/autoconfigure/orm/jpa
    /HibernateJpaConfiguration.class]: Invocation of init method failed; nested > exception is javax.persistence.PersistenceException: [PersistenceUnit: 
    default] Unable to build Hibernate SessionFactory; nested exception is 
    org.hibernate.MappingException: <strong>property mapping has wrong number of 
    columns: com.sb.bean.parser.explorer.model.domain2.StatusEntity.status type: > object</strong></p>
  </blockquote>
  
  <p>I have think, that I did make mistake </p>
  
  <ul>
  <li><p>in the creating table <code>explorer</code>, in string:</p>
  
  <pre><code>  FOREIGN KEY (status_id) REFERENCES status(code)
  </code></pre></li>
  <li><p>or in creating class <code>EntityStatus</code></p></li>
  </ul>
  
  <p><strong>How to correctly create <code>Status</code> entity or create references between tables in this case?</strong> </p>