1. @Transient
@Transient indicates that the property is not a mapping to a field in a database table, and the ORM framework ignores the property;
If a property is not a field mapping for a database table, it must be marked as @transient, otherwise the ORM framework defaults to its annotation as @basic;
Indicates that the field is not in the database table
@Transient
public int getage () {
return;
}
Jackson Related:
2. @JsonIgnoreProperties
This annotation is a class annotation that, when JSON is serialized, ignores some properties in the Java Bean, and both serialization and deserialization are affected.
3. @JsonIgnore
This annotation is used on properties or methods (preferably on attributes), as in the @jsonignoreproperties above.
4. @JsonFormat
This annotation is used for attributes or methods (preferably on attributes), and it is convenient to convert the date type directly into the pattern we want, such as @jsonformat (pattern = "Yyyy-mm-dd hh-mm-ss")
5. @JsonSerialize
This annotation is used on attributes or Getter methods to embed our custom code when serializing, such as when serializing a double with a two-bit decimal point behind it.
6. @JsonDeserialize
This annotation is used on attributes or setter methods, and can be used to embed our custom code when deserializing, similar to the above @jsonserialize