Java Hibernate with Postgresql: Passing String as Text to a @Query procedure call - native query

Viewed 71

I'm using org.springframework.data.jpa.repository to call a Postgresql stored procedure named "create_account_b":

@Modifying @Query(value = "CALL create_account_b(:aname, :companydomain)", nativeQuery = true) void create_account(String aname, String companydomain);

"create_account_b" include 2 fields from type "text":

CALL public.create_account(
    <aname text>, 
    <companydomain text>);

When I call the JPA function it fails because it convert String to "Character Varying (255)" and I need it to convert it to "text".

Any ideas?

0 Answers
Related