我正在使用
存储过程
在JPA中(使用EclipseLink)。我在实体类中用
@Entity
@NamedStoredProcedureQuery(
name = "myproc",
procedureName = "SP_myproc",
parameters = {
@StoredProcedureParameter(mode = ParameterMode.IN, type = Integer.class, name = "testparam"),
},
resultClasses = Integer.class
)
public class MyEntity implements Serializable,Comparable<MyEntity> {
我使用了本教程:
https://www.thoughts-on-java.org/call-stored-procedures-jpa/
但我想为该实体定义不止一个过程。
我可以在另一个类中对另一个过程进行注释,但该过程属于这个过程——如果需要更多,我该怎么做
存储过程
比
实体类
?(事实并非如此,但我认为在与原始实体没有关系的实体中定义程序并不好……)
谢谢你的帮助,
艾森巴恩凡