报错:No identifier specified for entity: main.java.com.sy.entity.User的解决办法
自己也没怎么搭建过框架,更何况还是spring mvc的,最近在带两个实习生,正好教他们怎么搭建一个spring mvc的框架,然而我在映射表的时候,提示报错了。
实体基类:
public class BaseEntity implements Serializable{
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
protected Long id;
@Column(updatable=false)
protected Date creatTime=new Date();
@Column(updatable=false)
protected String creatUser;
@Column(insertable=false)
protected Date updateTime=new Date();
@Column(insertable=false)
protected String updateUser;
//get,set方法
}
User类:
@Entity
@Table(name="sys_user")
public class User extends BaseEntity { private String loginName; private String userName; private String password; //get、set方法 }
代码看了感觉没问题啊,查阅国外的论坛之后得出一个结论,自己好菜啊!解决办法特别简单!!!在实体基类上加一个@MappedSuperclass
@MappedSuperclass
public class BaseEntity implements Serializable{ @Id
@GeneratedValue(strategy = GenerationType.AUTO)
protected Long id; @Column(updatable=false)
protected Date creatTime=new Date(); @Column(updatable=false)
protected String creatUser; @Column(insertable=false)
protected Date updateTime=new Date(); @Column(insertable=false)
protected String updateUser; //get,set方法 }
报错:No identifier specified for entity: main.java.com.sy.entity.User的解决办法的更多相关文章
- @(报错)could not find the main class, Program will exit(已解决)
原文 @(报错)could not find the main class, Program will exit(已解决) (很抱歉,如果你希望能更加清楚地看清图片或是图上的文字的话,你可以 ...
- npm install 报错 error Unexpected end of JSON input while parsing near '...sShrinkwrap":false,"d' 解决办法
npm install 报错 : error Unexpected end of JSON input while parsing near '...sShrinkwrap":false,& ...
- pip安装pycrypto报错:Microsoft Visual C++ 14.0 is required. 和 SSLError: HTTPSConnectionPool的解决办法
今天本打算把[Python3爬虫]网易云音乐爬虫 的代码敲一遍, 但是在安装pycrypto老是报错, 由于我计算是win10, 并且也有vs2017 python3环境下安装pycrypto的一些问 ...
- 关于项目报错Dynamic Web Module 3.0 requires Java 1.6 or newer 的解决方法
起因:今天使用maven创建web项目的时候发现项目上老是有个红X,错误如下图所示,虽然项目能正常运行起来,但是LZ的强迫症发作,不弄掉就觉得心里不舒服,于是上网查了攻略,几经周折最终大功告成,现在就 ...
- appium===报错Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.settings without first uninstalling.的解决办法
要解决的问题:appium在androidV7.0系统上运行时报错 Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.a ...
- Web 项目报错No suitable driver found for jdbc:mysql://localhost:3306/book 的一个解决办法
确认jar包加入到了build path中,然后注意版本是否与数据库相配,还要留意将jar包放入WEB-INF下的lib文件夹中
- 报错 POST http://192.168.79.165:8015/marketing/manager 400 (BAD REQUEST) 解决办法
我用jQuery ajax post方法 用flask url_for 传值到后端 $.ajax({ url:"{{url_for('marketing.manager')}}", ...
- 报错 Inferred type 'S' for type parameter 'S' is not within its bound; 解决办法
出现情况: Inferred type 'S' for type parameter 'S' is not within its bound; should extends xxxxxx 出现这种问题 ...
- appium===报错adb server version (31) doesn’t match this client (39); killing…的解决办法
当使用在cmd窗口调用adb shell命令的时候 提示如下: adb server version (31) doesn't match this client (39); killing...er ...
随机推荐
- mysqlclient和PyMySQL对比
环境:Python 3.5+, Django 1.9+ 最初用django时,搜索时发现PyMySQL的文章很多,然而在django的官方文档中python3版的mysql客户端驱动确没有提到PyMy ...
- css里面position:relative与position:absolute的区别
position:absolute这个是绝对定位:是相对于浏览器的定位.比如:position:absolute:left:20px;top:80px; 这个容器始终位于距离浏览器左20px,距离浏览 ...
- [leetcode-474-Ones and Zeroes]
In the computer world, use restricted resource you have to generate maximum benefit is what we alway ...
- [leetcode-583-Delete Operation for Two Strings]
Given two words word1 and word2, find the minimum number of steps required to make word1 and word2 t ...
- 程序员必须知道的六大ES6新特性
二 .字符串扩展 1.传统上,JavaScript只有indexOf方法,可以用来确定一个字符串是否包含在另一个字符串中.ES6又提供了三种新方法. includes():返回布尔值,表示是否找到了参 ...
- ASP.NET Core Web API 最小化项目
ASP.NET Core中默认的ASP.NET Core 模板中有Web API 模板可以创建Web API项目. 有时,只需要创建一个API,不需要关心Razor,本地化或XML序列化.通过删除无用 ...
- 《物联网框架ServerSuperIO教程》-22.Web端对传感器实时监测与控制。附:v3.6.8版本,支持WebSocket
1.ServerSuperIO v3.6.8更新内容 1.1 增加WebSocket服务端功能,支持自控模式.并发模式.单例模式,不支持轮询模式1.2 接收数据缓存与现有的IO实例分离.1.3 优化代 ...
- 阿里云服务器linux(cenos)下 jdk、tomcat的安装配置
一.JDK的安装与环境配置 1. 下载jdk http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-213315 ...
- 初步研究一下sourceTree
今天研究sourceTree,在此小结一下 1.下载链接:https://www.atlassian.com/software/sourcetree 2.安装,注册账户登录,连接到GitHub账号上, ...
- JS事件响应的学习总结
点击事件:ocnlick 鼠标经过事件:onmouseover 鼠标移开事件:onmouseout 获得焦点事件:onfocus 失去焦点事件:onblur 内容选中事件:onselect 文本框内容 ...