With regard to Java serialization, why are none of the message entities I've seen serialized?

Java enthusiasts ask a question related to Java serialization.
We all know that the main purpose of object serialization is to transfer objects over the network and to persist object files, but why do I look at the source code of many projects and the classes about message entities don"t implement the Serializable interface?

if you want to pass the entity of the application server to the database for storage, shouldn"t it be serialized and then transferred? It is not serialized like that, is it because the application server and the database are on the same computer, and there is no transmission, so it is not serialized?
my understanding is that although a big data User, is transmitted, it still splits various basic types, corresponding to the fields in the database, while the basic data types support serialization, or the underlying basic types have been serialized, so entity classes do not need to be serialized. I don"t know if what I understand is correct.
this may be a conceptual problem, and the actual work may not be affected, but please ask God for guidance.


if used for network transmission, serialize with json without the need to implement the Java serialization interface

Menu