Greetings There is a need to transfer an array of bytes by json. But I can't do it. The project is written in Java using Spring-Hibenate-JPA.
The essence of News in which I declare the image_url field, Postgres base, the field in the database is of type BYTEA.
@Column(name = "image_url", nullable = false, length = 10000) private byte[] image_url; I add to the database array "b":
String url = "http://78.24.216.172:8080/images/" + nameImage + ".jpeg"; byte[] b = url.getBytes(); Then I just request all the entries in this way:
@Query("select distinct p from News p ORDER BY p.id DESC") List<News> findNewsNew(); But for some reason in image_url is not an array of bytes but just a string, how can I solve this problem?
