I need to convert the bytea entry for the request to bigint. How can I do that?
Additional Information:
I have a sleeping repository as shown below -
@Query(value = "update Sample_Table set other_id = ?1 where id = ?2", nativeQuery = true) void saveOrUpdateOtherId(Long other_id, Long id);
Hibernate somehow accepts the id (in where where) as bytea , and since "Sample_Table" has this id field as bigint and thus causes a type mismatch problem.
I tried using CAST to convert bytea to bigint , but it failed, and the msg: bytea error message could not be sent to bigint .
How to change bytea to bigint ?
Edit:
Sample_Table DAO:
@Table(name = "Sample_Table") public class Sample{ @Id @Column(name = "id", unique = true) @GeneratedValue private Long id; @Column(name = "other_id") private Long other_id; }
Field
id defined here as Long.
Edit-2 If someone gets such a problem, most likely they will pass a null value in the request.
source share