自己也没怎么搭建过框架,更何况还是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的解决办法的更多相关文章

  1. @(报错)could not find the main class, Program will exit(已解决)

    原文 @(报错)could not find the main class, Program will exit(已解决)      (很抱歉,如果你希望能更加清楚地看清图片或是图上的文字的话,你可以 ...

  2. 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,& ...

  3. pip安装pycrypto报错:Microsoft Visual C++ 14.0 is required. 和 SSLError: HTTPSConnectionPool的解决办法

    今天本打算把[Python3爬虫]网易云音乐爬虫 的代码敲一遍, 但是在安装pycrypto老是报错, 由于我计算是win10, 并且也有vs2017 python3环境下安装pycrypto的一些问 ...

  4. 关于项目报错Dynamic Web Module 3.0 requires Java 1.6 or newer 的解决方法

    起因:今天使用maven创建web项目的时候发现项目上老是有个红X,错误如下图所示,虽然项目能正常运行起来,但是LZ的强迫症发作,不弄掉就觉得心里不舒服,于是上网查了攻略,几经周折最终大功告成,现在就 ...

  5. 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 ...

  6. Web 项目报错No suitable driver found for jdbc:mysql://localhost:3306/book 的一个解决办法

    确认jar包加入到了build path中,然后注意版本是否与数据库相配,还要留意将jar包放入WEB-INF下的lib文件夹中

  7. 报错 POST http://192.168.79.165:8015/marketing/manager 400 (BAD REQUEST) 解决办法

    我用jQuery ajax post方法 用flask url_for 传值到后端 $.ajax({ url:"{{url_for('marketing.manager')}}", ...

  8. 报错 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 出现这种问题 ...

  9. 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 ...

随机推荐

  1. 在jupyter notebook中同时安装python2和python3

    之前讨论过在anaconda下安装多个python版本,本期来讨论下,jupyter notebook中怎样同时安装python2.7 和python3.x. 由于我之前使用的jupyter note ...

  2. 【LeetCode】190. Reverse Bits

    题目: Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented ...

  3. c# ActiveMQ 类

    using System;using System.Collections.Generic;using System.Text; using Apache.NMS;using Apache.NMS.A ...

  4. 也谈TDD,以及三层架构、设计模式、ORM……:没有免费的午餐

    想在园子里写点东西已经很久了,但一直没有落笔,忙着做 一起帮 的开发直播,还有些软文做推广,还要做奶爸带孩子,还要……好吧,我承认,真正的原因是: 太特么的难写了! 但再难写也要写啊,要等到“能写好了 ...

  5. href 和 src 区别

    去网上百度了一下,感觉还是没有清楚的定义,所以自己稍稍的总结了一下: 1 html标签分为行类元素 和块元素 在加空元素(也可以叫做替换元素img input iframe):当元素为替换元素的时候, ...

  6. Tkinter开发第一个桌面程序HelloWorld

    在Python3中是tkinter,Python2中是Tkinter Tkinter是Python 官方承认的标准 GUI 方案(de-facto standard),因为是Python自带安装,决定 ...

  7. Python运维开发基础-概述-简介

    Python基础知识分为以下几块 1.Python概述 2.基础语法 3.数据结构 4.Python进阶 5.实训案例 一.Python概述 1.Python简介 2.Hello World 3.搭建 ...

  8. 修改tomcat编码方式

    打开server.xml <Connector URIEncoding="UTF-8" connectionTimeout="20000" port=&q ...

  9. 动态语言的灵活性是把双刃剑 -- 以Python语言为例

    本文有些零碎,总题来说,包括两个问题:(1)可变对象(最常见的是list dict)被意外修改的问题,(2)对参数(parameter)的检查问题.这两个问题,本质都是因为动态语言(动态类型语言)的特 ...

  10. fzu 2257 saya的小熊饼干

    https://vjudge.net/problem/FZU-2257 题意:略 思路: 看题解补的题.正难则反的思想求概率. 首先,由于各维数之间是独立的.所以以x为例.首先,计算可以取到(i,j) ...