Spring storedProcedure: org.springframework.dao.InvalidDataAccessApiUsageException

172 Views Asked by At

This is my stored procedure. But there is InvalidDataAccessApiUsageException Entity:

@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
@NamedStoredProcedureQuery(name = "app.pr_plastic_card_book",
        procedureName = "app.pr_plastic_card_book",
        parameters = {
               @StoredProcedureParameter(mode = ParameterMode.IN, name = "p_card_product_code", type = String.class),
               @StoredProcedureParameter(mode = ParameterMode.IN, name = "p_branch_code", type = String.class),
               @StoredProcedureParameter(mode = ParameterMode.IN, name = "p_rbs", type = String.class),
               @StoredProcedureParameter(mode = ParameterMode.IN, name = "p_description", type = String.class),
               @StoredProcedureParameter(mode = ParameterMode.IN, name = "p_related_ref", type = String.class),
               @StoredProcedureParameter(mode = ParameterMode.IN, name = "p_user", type = String.class),
               @StoredProcedureParameter(mode = ParameterMode.OUT, name = "p_transaction_id", type = String.class),
               @StoredProcedureParameter(mode = ParameterMode.OUT, name = "p_status", type = String.class),
               @StoredProcedureParameter(mode = ParameterMode.OUT, name = "p_status_desc", type = String.class)
})
public class SetBooking {
   @Id
   private String id;
   private String cardProductCode;
   private String branchCode;
   private String rbs;
   private String description;
   private String relatedRef;
   private String user;
   private String transactionId;
   private String status;
   private String statusDesc;
}

Repository:

@Repository       
public interface SetBookingRepo extends JpaRepository<SetBooking, String> {
    @Procedure(name = "app.pr_plastic_card_book")
    Map<String, String> getBookingTransaction(
            @Param("p_card_product_code") String cardProductCode,
            @Param("p_branch_code") String branchCode,
            @Param("p_rbs") String rbs,
            @Param("p_description") String description,
            @Param("p_related_ref") String relatedRef,
            @Param("p_user") String user
    );
}

Exception: org.springframework.dao.InvalidDataAccessApiUsageException: Type cannot be null

0

There are 0 best solutions below