Skip to content

Commit bc4019b

Browse files
committed
add a CAUTION about misuse of auto-apply converters to doc
1 parent 43b8328 commit bc4019b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

documentation/src/main/asciidoc/introduction/Entities.adoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,14 @@ On the other hand, if we _don't_ set `autoapply=true`, then we must explicitly a
778778
EnumSet<DayOfWeek> daysOfWeek;
779779
----
780780

781+
[CAUTION]
782+
====
783+
Converters are supposed to be used for type conversion.
784+
Some enterprising members of the community have noticed that they can be (mis)used to perform other tasks: trimming whitespace, normalizing case, assigning a default value in place of `null`, and so on.
785+
Hibernate _tolerates_ but does not encourage such (mis)use.
786+
In particular, we strongly recommend against defining an `autoApply` converter acting on a <<basic-type-list,basic type>>.
787+
====
788+
781789
All this is nice, but it probably won't surprise you that Hibernate goes beyond what is required by JPA.
782790

783791
[[compositional-basic-types]]

0 commit comments

Comments
 (0)