title: Spring boot create table from entity with wrong order shown in database
body: <p>I'm creating a new Spring boot project with MySQL and I don't know why the ordering in my database is showing up alphabetically. I want to know if it can follow by my class ordering like id, name, email, gender then age.</p>
  
  <p>This is my first time using this method to generate the database, usually I generate it from phpMyAdmin. </p>
  
  <p>Here is my end result in phpMyAdmin:</p>
  
  <pre><code>id, address, age, email, gender, name
  </code></pre>
  
  <p>I want it to follow the order from my entity class which is:</p>
  
  <pre><code>id, name, email, gender, age, address
  </code></pre>
  
  <p>This is my <code>application.properties</code>:</p>
  
  <pre><code>logging.level.root=WARN
  logging.level.org.springframework.web=DEBUG
  logging.level.org.hibernate=ERROR
  
  spring.datasource.url=jdbc:mysql://localhost:3306/db
  spring.datasource.username=user
  spring.datasource.password=x
  
  
  spring.jpa.show-sql=true
  spring.jpa.hibernate.ddl-auto=update
  spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
  </code></pre>
  
  <p>I also created <code>User.java</code>:</p>
  
  <pre class="lang-java prettyprint-override"><code>package hello.model;
  
  import javax.persistence.Entity;
  import javax.persistence.GeneratedValue;
  import javax.persistence.GenerationType;
  import javax.persistence.Id;
  
  @Entity // This tells Hibernate to make a table out of this class
  public class User {
      @Id
      @GeneratedValue(strategy=GenerationType.AUTO)
      private Integer id;
  
      private String name;
  
      private String email;
  
      private String gender;
  
      private String age;
  
      private String address;
  
      public String getGender() {
          return gender;
      }
  
      public void setGender(String gender) {
          this.gender = gender;
      }
  
      public String getAge() {
          return age;
      }
  
      public void setAge(String age) {
          this.age = age;
      }
  
      public String getAddress() {
          return address;
      }
  
      public void setAddress(String address) {
          this.address = address;
      }
  
  
  
      public Integer getId() {
          return id;
      }
  
      public void setId(Integer id) {
          this.id = id;
      }
  
      public String getName() {
          return name;
      }
  
      public void setName(String name) {
          this.name = name;
      }
  
      public String getEmail() {
          return email;
      }
  
      public void setEmail(String email) {
          this.email = email;
      }
  
  
  }
  </code></pre>
  
  <p>and <code>UserRepository.java</code>:</p>
  
  <pre><code>package hello.model;
  
  import org.springframework.data.repository.CrudRepository;
  
  import hello.model.User;
  
  // This will be AUTO IMPLEMENTED by Spring into a Bean called userRepository
  // CRUD refers Create, Read, Update, Delete
  
  public interface UserRepository extends CrudRepository&lt;User, Long&gt; {
  
  }
  </code></pre>