Would the following cause a deserialization error?

Viewed 23

Let's say some service serializes a class "Class A" and stores it to a database. If another service deserializes the object saved to the DB, but I deserialize it into "Class B", would that cause an issue if Class A and Class B have the exact same shape?

So conceptually,

POJO 1 -> service 1 -> serialized and saved to DB as JSON using Jackson

DB <- service 2 reads from DB and deserializes JSON object using Jackson <- builds object as POJO 2

where POJO 1 and POJO 2 have the same shape, but are not literally the same class.

Would this cause an error?

0 Answers
Related