Mapping a list of embeddable with a JSON type

Hi,
I dont find any obvious answers to my question so far, so I post an example of what I want to do.

Hibernate 6.4.4

@Entity
class Test {
    @Column(name = "ARC_DOCS")
    @JdbcTypeCode(SqlTypes.JSON)
    private List<ArcDoc> arcDocs;
}

@Embeddable
class ArcDoc  {
    private String archiveNumber;
    private String archiveStatus;
    private ZonedDateTime archivedAt;
    private String details;
}

And got the following error :
org.hibernate.AnnotationException: Property ‘Test.arcDocs’ is mapped as basic aggregate component array, but this is not yet supported.

Not supported or am I wrong with the code ?
Regards

You have to remove @Embeddable from ArcDoc.

Thanx, it works like a charm

Quick question, can we query through the list ?
Example : Test.ardocs.archivedAt > ?
Regards

You can, but not yet with plain HQL. For that, you will have to make use of native JSON functions that your database offers. Consult the manual of your database vendor for details.

The problem remains if in another entity i want to had the @Embedded field of this type. What to do in this case? Thanks in advance.

Please create a new topic and add more details to your question i.e. the entity model, query and exception stack trace.

Created - https://discourse.hibernate.org/t/mapping-a-collection-of-embeddable-with-a-json-type/9438