Spring-data-jpa CrudRepository specify @Query parameter type

I use following class to call function from postgres db:

public interface MocRepository extends CrudRepository<Moc, Long> {

    @Query(value = "select adaptMocApproveUserList(:userIds, :mocId)", nativeQuery = true)
    String adaptMocApproveUserList(@Param("userIds") long[] userIds, @Param("mocId") Long mocId);


Hibernate converts long[] into bytea type in postgres.

How could I force it to convert long[] into bigint[] type of postgres?

I tried to call function using this docs: Stored procedures in spring-data-jpa but unfortunately because of this bug – I wasn’t able to do that.

My postgres function declaration:
create or replace function adaptMocApproveUserList(IN approveUserIds bigint[], IN mocId bigint)…

Exception which raised on call: org.postgresql.util.PSQLException: ERROR: function adaptmocapproveuserlist(bytea, bigint) does not exist