I have an entity that contains another entity, as follows:
public class Order { @Id private int id; @NotNull private Date requestDate; @No
All you need to do in your case is:
@Configuration public class MvcConfig extends WebMvcConfigurerAdapter{ @Autowired private OrderTypeConvertor orderTypeConvertor; ... @Override public void addFormatters(FormatterRegistry registry) { registry.addConverter(orderTypeConvertor); } }