使用springjpa将列表对象传递到存储过程

px9o7tmv  于 2021-07-24  发布在  Java
关注(0)|答案(0)|浏览(176)

问题:我可以像这样(单向)调用SpringJPA中的存储过程,

@Query(value = "CALL SP_NAME(:name);", nativeQuery = true)
List<Employee> findEmployees(@Param("name") String name);

或者用下面这样的名字

@Entity
@NamedStoredProcedureQuery(name = "Employee.findEmployees", 
  procedureName = "SP_NAME", parameters = {
    @StoredProcedureParameter(mode = ParameterMode.IN, name = "name", type = String.class),
    @StoredProcedureParameter(mode = ParameterMode.OUT, name = "other", type = Integer.class)})
public class Employee {
    // class definition
}

@Procedure(name = "Employee.findEmployees")
int findEmployees(@Param("name") String model);

现在我怎样才能通过考试呢 List<Employee> 到存储过程?我还可以在存储过程端对记录进行迭代。请帮帮我!

暂无答案!

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

相关问题