Génération entity/table sans ordre
Bonjour,
J'utilise Hibernate Annotations 3.4 et PostGreSQL 8.4.
je suis nouveau sur Hibernate et j'essaye de générer une table à partir d'une classe annotée.
fichier Doc.java
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
|
[...]
@Entity
public class Doc implements Serializable{
@Id
private String id;
private boolean disable;
private String descrip;
private String name;
[...] |
fichier hibernate.cfg.xml
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.driver_class">org.postgresql.Driver</property>
<property name="hibernate.connection.username">***********</property>
<property name="hibernate.connection.password">***********</property>
<property name="hibernate.connection.url">**************</property>
<property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<property name="hibernate.current_session_context_class">thread</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
<property name="hibernate.use_sql_comments">true</property>
<!-- this will show us all sql statements -->
<property name="hibernate.show_sql">true</property>
<mapping class="com.bureauveritas.verirules.model.Doc"/>
</session-factory>
</hibernate-configuration> |
Le probleme est qu'à la generation, il ne suit pas l'ordre des déclarations dans l'entity.
Ici, je devrais avoir comme colonnes dans la table doc :
->id, disable, descrip, name
mais j'ai à la place id, descrip, disable, name.
Ainsi, l'ordre n'est pas respecté.
Y-a t'il un moyen de forcer hibernate ou postgres à respecter l'ordre de l'entity mappé?
Alexandre