snap-admin icon indicating copy to clipboard operation
snap-admin copied to clipboard

Type `Map` is not supported

Open fabienfleureau opened this issue 1 year ago • 2 comments

Describe the bug There is an error for entity that contains field of type Map.

Is the bug at startup before you perform any action? Not applicable

@Entity code

    @Type(value = io.hypersistence.utils.hibernate.type.json.JsonType::class)
    @Column(name = "cost_details", updatable = false, nullable = false, columnDefinition = "jsonb")
    val map: Map<AnyEnumTypeOrString, String>,

fabienfleureau avatar Oct 20 '23 15:10 fabienfleureau

This one is a bit more complicated than a standard field because we don't currently support the @Type annotation. I will look into this as well but it's going to take a bit more time :)

aileftech avatar Oct 21 '23 13:10 aileftech

I've looked into this because I ended up using json fields in one of my projects.

The current behaviour is that these columns are not shown when looking at the table. If you SELECT * from the SQL console though, they appear in their JSON representation as text.

Since the @Type annotation can be used not just with Map but with any object, I can't introduce a specific support for Map. So I'll look into supporting this as if they are just "text" fields with the JSON value.

aileftech avatar Dec 12 '23 08:12 aileftech