首页 > 解决方案 > 如何使用 Spring Boot 将 JPA 实体映射到 MsSQL View

问题描述

我已经存在view("user_authenticate")于我的数据库中。我想用JPA Entity映射现有视图。下面的代码不起作用,它总是在我的数据库中创建一个新表,但它没有使用我现有的视图。

@Entity
@Table(name = "user_authenticate")
@Immutable
public class UserAuthLogin {

@Id
private int UserId;
private String userName;
private String userPassword;
private Date personnelNo;
private Date reportingToId;
private String email;

为什么会这样?我需要为此改变什么?

标签: javaspring-bootjpaview

解决方案


推荐阅读