@MappedSuperclass的用法
用在实体的继承过程中的父类上;

父类Cat

 1     package com.xj.model;  
 2       
 3     import javax.persistence.GeneratedValue;  
 4     import javax.persistence.Id;  
 5     import javax.persistence.MappedSuperclass;  
 6       
 7     @MappedSuperclass  
 8     public class Cat {  
 9         private Long id;  
10         private String name;  
11         @Id  
12         @GeneratedValue  
13         public Long getId() {  
14             return id;  
15         }  
16         public void setId(Long id) {  
17             this.id = id;  
18         }  
19         public String getName() {  
20             return name;  
21         }  
22         public void setName(String name) {  
23             this.name = name;  
24         }  
25     }  
View Code

相关文章:

  • 2022-12-23
  • 2021-08-05
  • 2022-12-23
  • 2022-12-23
  • 2021-11-11
  • 2022-12-23
  • 2021-11-17
猜你喜欢
  • 2022-12-23
  • 2021-04-06
  • 2022-01-08
  • 2021-11-26
  • 2021-12-19
  • 2021-11-26
  • 2022-12-23
相关资源
相似解决方案