The Javadoc of ValueAccess.getValues() states:
/**
* Access to an individual value.
*
* @apiNote It is important to remember that attributes are
* sorted alphabetically. So the values here will be in alphabetically
* order according to the names of the corresponding attribute
*/
For a Java record declaration like this:
record MyRecord(int c, String b, LocalDate a) {}
on Hibernate 6.1.7, ValueAccess.getValues() returns the LocalDate first, the String second, the integer last, i.e. alphabetically as defined in the Javadoc. On Hibernate 6.2, the same method returns the integer first, the String second and the LocalDate last, i.e. as declared in the constructor but not as specified in the Javadoc. This change of behavior is also evident when trying to access values by index. Steps to reproduce
|