How to use Spring IdToEntityConverter to convert my object type during form binding?

It pains me to write the PropertyEditorSupport extension for every Entity object on my system.

I noticed that Spring 3.0 has an IdToEntityConverter, but the documentation for its use is really scarce.

Comment on the best general way to convert between id and entity.

+3
source share
1 answer

IdToEntityConverteris an inner class of Spring. It is not publicly accessible, therefore it is not displayed in javadoc, but it is registered by default in every context. The class comment says:

, .

, , , find[EntityName]([IdType]) .

, class X, X public static findX(id) - X.

+2

Source: https://habr.com/ru/post/1734200/


All Articles