how to check if record exists in DB table?

hey guys. can smb help me out? in my repo class i have this:
@Query(value = "select count(1) from my_tablewhere transaction_id= :transactionId",nativeQuery = true)
    boolean existsByTransactionId(@Param("transactionId") String transactionId);

but when i call this method, i get an error:
2024-07-24 11:14:58.459 ERROR 26832 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.ClassCastException: class java.math.BigInteger cannot be cast to class java.lang.Boolean (java.math.BigInteger and java.lang.Boolean are in module java.base of loader 'bootstrap')] with root cause

java.lang.ClassCastException: class java.math.BigInteger cannot be cast to class java.lang.Boolean

so i dont understand anymore. i just want to check if there are any records, i googled, tried it, but its obviously isnt working. what are the alternatives/fixes for this case? thanks in advance
Was this page helpful?