Hibernate java при создании таблицы колонки добавляются в алфавитном порядке

При создании таблицы в БД колонки добавляются в алфавитном порядке.

Сам класс Page.

@Entity
@Getter
@Setter
public class Page {

@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private int id;

@Type(type = "text")
private String path;
private int code;

@Type(type = "text")
private String content;

public Page(String path, int code, String content) {
    this.path = path;
    this.code = code;
    this.content = content;
}

public Page() {
}

}

Файл конфигурации hibernate

<!DOCTYPE hibernate-configuration PUBLIC
    "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
    "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
  <hibernate-configuration>
<session-factory>
    <property name="connection.driver_class">com.mysql.cj.jdbc.Driver</property>
    <property name="connection.url">jdbc:mysql://localhost:3306/test? 
     useSSL=false</property>
    <property name="connection.username">root</property>
    <property name="connection.password">1236</property>
    <property name="connection.pool_size">10</property>
    <property name="dialect">org.hibernate.dialect.MySQL5Dialect</property>
    <property name="show_sql">true</property>
    <property name="current_session_context_class">thread</property>
    <property name="hbm2ddl.auto">create</property>

    <mapping class="Page"/>
</session-factory>

В результате формируется такой запрос Hibernate: insert into Page (code, content, path, id) values (?, ?, ?, ?)

Что необходимо изменить или добавить чтобы формировался запрос в таком виде? Hibernate: insert into Page (id, path, code, content) values (?, ?, ?, ?)


Ответы (0 шт):