Keep columns sequence align to sequence of entity fields

Description

I found that when we created the tables using Hibernate, the columns sequence of the created tables is not the same with the sequence of entity fields.
And I also found most of the related source codes are using LinkedHashMap or List to store the fields(or properties) in order, so I believe that Hibernate is aiming to keep the same sequence of the table columns as entity fields.
I traced the source codes and found that in the org.hibernate.cfg.PropertyContainer , TreeMap is used to store the fields. I replaced all the TreeMap with LinkedHashMap, without modifing any other codes, it works – table columns get the same order as fields defined in entity.

So, could you please take a look at this issue, fix this in future version ASAP.

Environment

None

Assignee

Vlad Mihalcea

Reporter

Ryan Wang

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

Yes, likely

Requires Release Note

Affirmative

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure