spring引导和调用存储过程注释或entityManger?

问题描述 投票:0回答:1

有人可以告诉我调用存储过程的正确方法是什么?

1. I've seen annotations to call a procedure like : 
   @Procedure: In this case I have seen that they create the procedure in the entity,
   but I think it is not most optimal.
   @Query: I have been able to call my procedure with this option, but when I would like a
   parameter to be     null, I don't know how to do it since there is
   not much information. 
2. I've been using entityManager and I've been able to make a parameter null, but I don't know if it's 
   the best way to call a procedure with entityManager

另一件事,创建一个验证数据的程序好吗?还是没有必要,无论是实际情况还是仅在后端有效]

spring-boot stored-procedures java-8 jpa-2.1
1个回答
0
投票

@ NamedStoredProcedureQueries是调用存储过程的更好选择

© www.soinside.com 2019 - 2024. All rights reserved.