How convert bytea to smallint in postgres native query

105 Views Asked by At

i try to use native query and i get above error: column "code" is of type smallint but expression is of type bytea, does anyone know how to fix it? i tried to use CAST to numeric but it doesn't work.

    entityManager.createQuery(
                    "INSERT INTO car("http_code) " +
                            "VALUES(":httpCode)")
            .setParameter("code", entity.getCode)
            .executeUpdate();
0

There are 0 best solutions below