JDK 14 introduces record classes as a preview feature, with an expectation of getting revised and possibly taken out of preview mode in JDK 15. This matches our Spring Framework 5.3 timeframe nicely, so let's aim for full data binding support against record classes: refined constructor-based binding on one side and property-style access to record-style "getters" with plain method names on the other side. This also goes nicely with several other constructor-based data binding refinements that we plan to get into 5.3.

Comment From: odrotbohm

I've created a quick prototype exposing PropertyDescriptor instances for record components as read-only properties via Spring's BeanInfoFactory abstraction. That makes Spring Data's object mapping work with records out of the box.

I've also reached out to the JDK team asking for exposing record components via the BeanInfo API right from within the JDK to safe both Spring Framework and other libraries (Thymeleaf, Hibernate, Jackson, EL implementations) from having to ship explicit support for records.

Comment From: hbrands

@odrotbohm Do you have further information if (and when) the BeanInfo API in OpenJDK will be enhanced with record support as you suggested above?

Comment From: jhoeller

I've implemented custom support for record-style plain accessors in CachedIntrospectionResults directly, based on the convention that an accessor method is referring to an instance field of the same name. This works nicely with records in JDK 15 so far.