I'm generating the postgresql
table schema using hibernate
:
@Entity
public class MyEntity {
@Id
private long id;
private String name;
private int age;
@Column(name = "testdate")
private Date thedate;
}
As a result I get:
CREATE TABLE ...
The table fields are all created in alphabetic order, no matter how the field order in the @Entity
is.
When I add additional fields lateron, they are usually just appended as an extra column in the database, and not inserted in alphabetic order in between.
Question: how can I read all generated table names, in their order of insertion, from the database? And with their generated schema column names? Is that possible at all?
Sidenote: I'm maintaining the data through springs CrudRepository
only.