当前位置:网站首页>对象的序列化
对象的序列化
2022-07-05 05:14:00 【qingqing不秃头】
1.什么是序列化和反序列化
简单来说,就是将Java对象转换成二进制流进行传输,反序列化则是将二进制数据流转换成java对象信息的过程.
2.如何实现序列化
只需让实体类去实现Serializable接口即可
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "users",autoResultMap = true)
@ApiModel
public class User implements Serializable {
@TableField(value = "username")
@ApiModelProperty(value = "学号")
private String userName;
@TableId(value="age")
@ApiModelProperty(value = "用户年龄")
private Integer age;
被static修饰的属性不能被序列化
3.序列化方式
jdk默认序列化
存储形式是16进制的字符
JacksonJsonRedisSerializer序列化
边栏推荐
猜你喜欢

2021-10-29

Heap sort summary

C4D simple cloth (version above R21)

AutoCAD - full screen display

Redis 排查大 key 的4种方法,优化必备

Page countdown

Leetcode word search (backtracking method)

Unity check whether the two objects have obstacles by ray

用 Jmeter 工具做个小型压力测试

Embedded database development programming (VI) -- C API
随机推荐
When will Wei Lai, who has been watched by public opinion, start to "build high-rise buildings" again?
Unity connects to the database
Bubble sort summary
PostgreSQL surpasses mysql, and the salary of "the best programming language in the world" is low
China as resin Market Research and investment forecast report (2022 Edition)
使用Room数据库报警告: Schema export directory is not provided to the annotation processor so we cannot expor
Stm32cubemx (8): RTC and RTC wake-up interrupt
Lua determines whether the current time is the time of the day
Es module and commonjs learning notes -- ESM and CJS used in nodejs
Learning notes of "hands on learning in depth"
Research on the value of background repeat of background tiling
LeetCode之单词搜索(回溯法求解)
Unity card flipping effect
质量体系建设之路的分分合合
GameObject class and transform class of unity
Unity sends messages and blocks indecent words
Judge the position of the monster in the role under unity3d
JVM call not used once in ten years
Ue4/ue5 illusory engine, material chapter, texture, compression and memory compression and memory
远程升级怕截胡?详解FOTA安全升级