fix(annotations): use @JdbcTypeCode(JSON) for polygon JSONB column
Some checks failed
CI / Unit & Component Tests (push) Failing after 1s
CI / Backend Unit Tests (push) Failing after 1s
CI / Unit & Component Tests (pull_request) Failing after 1s
CI / Backend Unit Tests (pull_request) Failing after 2s

Replace @Convert(PolygonConverter) with Hibernate native @JdbcTypeCode(SqlTypes.JSON)
to fix JDBC type mismatch — PostgreSQL requires jsonb type, not varchar.

The PolygonConverter is retained as a standalone utility but no longer
used on the entity. Hibernate 6 natively handles List<List<Double>>
serialization to JSONB.

Refs #227

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-04-12 15:39:54 +02:00
parent a4651aa317
commit 931fbc28e5

View File

@@ -4,6 +4,8 @@ import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.persistence.*;
import lombok.*;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.JdbcTypeCode;
import org.hibernate.type.SqlTypes;
import java.time.LocalDateTime;
import java.util.List;
@@ -53,8 +55,8 @@ public class DocumentAnnotation {
@Column(name = "file_hash", length = 64)
private String fileHash;
@JdbcTypeCode(SqlTypes.JSON)
@Column(columnDefinition = "jsonb")
@Convert(converter = PolygonConverter.class)
private List<List<Double>> polygon;
@Column(name = "created_by")