title: JPA Tools/EclipseLink - Generate table from entities - column order
body: <p>I'm trying to generate ddl from existing annotated entities using "JPA tools --> Generate Tables from Entities..." in Eclipse Kepler. When I run the task, I get a file with sql scripts to run. The problem is that the order of the columns in the table creation statement fails to comply with the order of the attributes in the class definition.</p>
  
  <p>Example:</p>
  
  <pre><code> @Entity
   @Table(name = "news", catalog = "myDatabase")
   public class News implements java.io.Serializable {
  
     private long id;
     private String newsTitle;
     private String newsTitle2;
     private String newsText;
     private Date created;
  
     @Id
     @GeneratedValue
     @Column(name = "news_id", unique = true, nullable = false)
     public long getId() {
         return this.id;
     }
  
     public void setId(long id) {
        this.id = id;
     }
  
     @Column(name = "news_title")
     public String getNewsTitle() {
         return this.newsTitle;
     }
  
     public void setNewsTitle(String newsTitle) {
         this.newsTitle = newsTitle;
     }
  
     @Column(name = "news_title2")
     public String getNewsTitle2() {
         return this.newsTitle2;
     }
  
     public void setNewsTitle2(String newsTitle2) {
         this.newsTitle2 = newsTitle2;
     }
  
     @Lob
     @Column(name = "news_text")
     public String getNewsText() {
         return this.newsText;
     }
  
     public void setNewsText(String newsText) {
         this.newsText = newsText;
     }
  
     @Temporal(TemporalType.TIMESTAMP)
     @Column(name = "created")
     public Date getCreated() {
         return this.created;
     }
  
     public void setCreated(Date created) {
         this.created = created;
     }
  }
  </code></pre>
  
  <p>Script:</p>
  
  <pre class="lang-sql prettyprint-override"><code>CREATE TABLE myDatabase.news (
    news_id BIGINT NOT NULL UNIQUE, created DATETIME, news_text LONGTEXT, 
    news_title VARCHAR(255), news_title2 VARCHAR(255), PRIMARY KEY (news_id))
  </code></pre>
  
  <p>How can I get the scripts with the order of the columns aligned with the java class?</p>
  
  <p>Thank you very much</p>
  
  <p>Stefano</p>