What's the order of PersistentProperty instances are iterated over for a Spring Data PersistentEntity?

27 views Asked by At

What is the access order of PersistentPropertys when iterating over them? Is it the same as in the definition of PersistentEntity, or is it random? I couldn't find any information about this in the Javadoc of Spring Data.

1

There are 1 answers

0
Oliver Drotbohm On BEST ANSWER

Fundamentally, the ultimate source of the properties created is Java's Class.getDeclaredFields() which doesn't guarantee any particular order. The high-level property creation algorithm can be found in AbstractMappingContext (ReflectionUtils.doWithFields(…) making the connection).

I've filed and fixed a ticket in Spring Data Commons to clarify this in the Javadoc.