I had a repository like so:
@Repository
interface Repository {
@Query("insert into t values (cube(:array))")
void save(float[] array)
}
which gives there error Unable to find server array type for provided name REAL.
I even tried to manually build a query string of the form: insert into t values (cube(array[0.1,0.3,0.2,...]::float4[]))
and also insert into t values (cube('{0.1,0.3,0.2,...}'::float4[]))
but I get the same error.
I added the float4[]
cast as in this question the user seems to solve the error by using a float4
array instead of real
array.
I also tried to use the Connection.createArrayOf("float4", ...)
but when I try to auto-wire the Connection
I get this error on startup:
required a bean of type 'java.sql.Connection' that could not be found.