Got error in array function "array_contains()"

Hi
I wanna use the array_contains() function to search a value in my array field in entity
the type of filed is Float
but I got this error
Parameter 0 of function ‘array_contains()’ requires an array type, but argument is of type ‘float
Any idea about this error?
what type of array should be use?

Hi, what version of Hibernate are you using? Official support for array functions including array_contains(), was introduced in Hibernate 6.4. Could you also share the mapping of the entity containing the Float[] field please?

I use 6.4
And for mapping I use hypersistence utils and FloatArrayType
This is my code for this field


    @Type(FloatArrayType.class)
    @Column(
        name = "sample_array",
        columnDefinition = "float4[]"
    )
    private Float[] sampleArray;

There’s no need to use a custom @Type since Hibernate now natively supports arrays. Please remove that annotation (and maybe even the columnDefinition) and let us know if that works.

Yeah it work but problem is here I wanna wrapper class not primitive data

Just remove the @Type annotation and Hibernate ORM will work fine. There is no need to use Hypersistence for arrays with ORM 6.1+