@JsonIgnore vs @Transient -difference?
1 answer
The clear difference between the two is that it is @Transient
used as part of JPA to ignore a field from persist if marked as @Transient
.
Where as @JsonIgnore
is only used to ignore the marked field from serialized, de-serialized to and from JSON.
This means that a field marked as @JsonIgnore
can persist in JPA persistence, where as a field marked as @Transient
it will not be saved and will not be serialized, de-serialized.
+10
source to share