我将Sping Boot Starter Parent从2.7升级到了3.0.2。
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.0.2</version>
</parent>
此代码在实体对象上使用了一些存储过程注解,但已找不到这些注解:
import javax.persistence.NamedStoredProcedureQueries;
import javax.persistence.NamedStoredProcedureQuery;
import javax.persistence.ParameterMode;
import javax.persistence.StoredProcedureParameter;
...
@Entity
@Table(name = "some_table")
@NamedStoredProcedureQueries({
@NamedStoredProcedureQuery(name = "updateproctime", procedureName = "SP1", parameters = {
@StoredProcedureParameter(mode = ParameterMode.IN, type = String.class, name = "p_form_name"),
@StoredProcedureParameter(mode = ParameterMode.IN, type = String.class, name = "p_office_code"),
@StoredProcedureParameter(mode = ParameterMode.IN, type = String.class, name = "p_form_type"),
@StoredProcedureParameter(mode = ParameterMode.IN, type = Date.class, name = "p_processing_date"),
@StoredProcedureParameter(mode = ParameterMode.IN, type = Date.class, name = "p_effctve_dt")
})})
public class SomeEntity implements Serializable {
//...
}
有什么建议吗?
1条答案
按热度按时间pqwbnv8z1#
Sping Boot 3发行版转而使用Jakarta持久性API而不是
javax.persistence.api
https://mvnrepository.com/artifact/jakarta.persistence/jakarta.persistence-api
添加该依赖项并将
import javax.persistence.*;
更改为import jakarta.persistence.*;