No, each JPA implementation can arrange the columns in the generated DDL in the order that it sees fit, and in general the programmer has no control over this - for example: Hibernate uses alphabetically , but DataNucleus allows you to specify the position of the column due to non-standard annotation. Unfortunately, OpenJPA does not provide a mechanism for specifying the order of columns.
I had a similar problem a while ago, my client database recommendations introduced certain orders in columns, and my JPA provider issued a different order. Decision? we wrote textual processing of a Java program, which, taking into account the generated DDL as input, reordered the columns in the code so that it complied with the recommendations and produced a new file with the modified DDL as output; the program was launched from the Ant task. Not very, but from a practical point of view, it was the best solution we could put together.
source share