使用JPA调用存储过程时出现以下错误:
Invocation of init method failed; nested exception is org.hibernate.AnnotationException: No identifier specified for entity
I am trying to call stored proc using JPA but getting the following error
我的POJO如下所示。如何使用JPA
调用存储过程时解决以下错误import javax.persistence.*;
@Entity
@NamedStoredProcedureQueries({
@NamedStoredProcedureQuery(name = "SP_proc",
procedureName = "dbo.SP_proc",
parameters = {
@StoredProcedureParameter(mode = ParameterMode.IN, name = "@parm1", type = String.class),
@StoredProcedureParameter(mode = ParameterMode.IN, name = "@parm2", type = String.class),
@StoredProcedureParameter(mode = ParameterMode.IN, name = "@parm3", type = String.class),
@StoredProcedureParameter(mode = ParameterMode.IN, name = "@parm4", type = String.class),
@StoredProcedureParameter(mode = ParameterMode.IN, name = "@parm5", type = String.class),
@StoredProcedureParameter(mode = ParameterMode.IN, name = "@parm6", type = String.class),
@StoredProcedureParameter(mode = ParameterMode.OUT, name = "@result", type = Integer.class)
})
})
public class SomeRealEntity { }