procedure returns type的存储过程不能为空(向上插入sql server)

igetnqfo  于 2021-07-23  发布在  Java
关注(0)|答案(0)|浏览(175)

我的存储库像这样调用存储过程,
@存储库

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

你的名字是这样的,

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

低于异常值

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

但是当我从方法调用中删除return type map<string,integer>时,它可以正常工作,但是如何在@repository map中获得deleted,inserted,action值,以便我可以返回到controller。请帮忙。
谢谢

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题