Skip to content

Is there any way i can consume responses (multiple) of OUT clause of @Procedure #2161

@satscreate

Description

@satscreate

My repository calling stored procedure like this,

@repository

@Procedure(procedureName = "sp_name")
Map<String, Integer> callingSP();

sp_name is look like this

CREATE PROCEDURE [dbo].[sp_name] AS BEGIN
SET NOCOUNT ON;
MERGE dbo.table1 AS Target
USING (
    SELECT *
    FROM
      dbo.table2
  )
  AS Source
ON
  (
    Target.id = Source.id
  )
WHEN MATCHED
  THEN
  UPDATE
  ...
  WHEN NOT MATCHED BY TARGET THEN
  INSERT
    ....
    OUTPUT DELETED.ID as DELETED , $action AS [Action] , INSERTED.ID as INSERTED
  ;
END;
GO

Am trying to see if I could return a map of key and values pair of results from sql server stored procedure but am facing below error,

Type cannot be null; nested exception is java.lang.IllegalArgumentException: Type cannot be null"

Is it possible to return such a Map entries from CrudRepository by calling database procedure name using just @procedure annotation?

Note: am not using any names procedure queries btw and calling generic procedure with no input expecting
OUTPUT DELETED.ID as DELETED , $action AS [Action] , INSERTED.ID as INSERTED parameter results.

Questions:

  1. Does @procedure support multiple output parameter?
  2. Does @procedure support object return type?
  3. If this is not something achievable with @procedure annotation why not this as a feature request?
  4. I do not want to specify any NamedStoredProcedure as my database stored procedure is playing with multiple table and return some OUTPUT clause results or @table as an object. from application side only calling the SP and getting the results using @procedure annotation is the requirement.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions