没有为实体JPA指定标识符

时间:2017-06-23 07:03:52

标签: java spring jpa spring-data

使用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 {  }

0 个答案:

没有答案