java - 如何使用 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;
为什么会这样?我需要为此改变什么?
解决方案
推荐阅读
- r - 是否可以通过以括号格式指示变量名称来使用“汇总”功能?
- angular - 自定义组件未正确加载到 mat-tab(角度材料)中
- java - 是否有一个 json 简单函数可以从 jsonobject 获取所有键?
- graphql - Graphql 获取 2 个标签之间的所有提交
- nlp - RASA NLU-我想在单词之后提取任何内容(单词、数字或特殊字符)作为实体
- php - 用于匹配查询字符串中的模式的正则表达式
- html - C 程序从 HTML GET 输入提供奇怪的输出并在 HTML 页面底部打印
- excel - 插入行代码后为整行着色
- excel - Excel - 具有相同值的单元格周围的边框(条件格式)
- java - Spring `@RolesAllowed` 被忽略了吗?