当前位置:网站首页>object serialization

object serialization

2022-07-05 05:18:00 Qingqing not bald

1. What is serialization and deserialization
Simply speaking , Will be Java Objects are converted into binary streams for transmission , Deserialization is to convert binary data stream into java Process of object information .
2. How to implement serialization
Just let the entity class implement Serializable Interface can

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "users",autoResultMap = true)
@ApiModel
public class User implements Serializable {
    @TableField(value = "username")
    @ApiModelProperty(value = " Student number ")
    private String userName;
    @TableId(value="age")
    @ApiModelProperty(value = " User age ")
    private Integer age;

By static Decorated properties cannot be serialized
3. Serialization mode
jdk Default serialization
 Insert picture description here

The storage form is 16 The character of the base
JacksonJsonRedisSerializer serialize
 Insert picture description here

原网站

版权声明
本文为[Qingqing not bald]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/186/202207050514334618.html