Skip to content
Advertisement

Why does Javers store the ID of my audited entities wrapped in quotes?

I audit changes to a com.example.TaskSupplier entity with Javers by annotating the corresponding Spring Data repository

JavaScript

The primary key of this entity is a UUID, so I can retrieve an instance with

JavaScript

However, the entry in Javers’ jv_global_id table for this instance wraps the ID in quotes, so in order to retrieve the corresponding row from this table, I have to execute

JavaScript

Is this intentional or a bug? I was confused when the query above without the quotes was failing to retrieve anything. I’m using Postgres, Javers 5.14.0, and Spring Boot 2.4.2

Advertisement

Answer

This is intentional, it’s a JSON type and not a String type. Local Id can be any type in Java, also a Value Object, so it’s serialized to JSON.

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement