自己也没怎么搭建过框架,更何况还是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. 【数据结构与算法】一致性Hash算法及Java实践

    追求极致才能突破极限 一.案例背景 1.1 系统简介 首先看一下系统架构,方便解释: 页面给用户展示的功能就是,可以查看任何一台机器的某些属性(以下简称系统信息). 消息流程是,页面发起请求查看指定机 ...

  2. [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 ...

  3. eclipse更改maven的本地路径和外部仓库地址

    背景 当前使用eclipse自带的maven碰到两个蛋疼的问题: maven在国内使用如果不进行FQ则会痛苦不堪如便秘. maven下载大量jar包导致某盘不够用,需要换大的分区. 因此为了解决这个问 ...

  4. MySQL(三)--函数与谓词

    前文已有涉及,这里作为总结重新整理一下. 一.函数 1.算术函数 NUMERIC 是大多数 DBMS 都支持的一种数据类型,通过 NUMBERIC ( 全体位数, 小数位数 ) 的形式来指定数值的大小 ...

  5. MyEclipse2014web工程项目直接复制不能访问报错处理方案

    在学习web servlet项目中,做一个项目时 , 完成到了某一阶段 实现了部分功能,有必要保存这一项目,当复制这个项目之后发现发布会报错或者不能访问. 其实复制项目主要是为了在以后的学习中如果能顺 ...

  6. EF查询百万级数据的性能测试--多表连接复杂查询

    相关文章:EF查询百万级数据的性能测试--单表查询 一.起因  上次做的是EF百万级数据的单表查询,总结了一下,在200w以下的数据量的情况(Sql Server 2012),EF是可以使用,但是由于 ...

  7. xtrabackup备份mysql数据库的使用方法

    xtrabackup是由percona提供的mysql备份工具,它是一款物理备份工具,通过连接数据库把数据库的数据备份出来.对于innodb存储引擎其支持全量备份和增量备份.对于myisam存储引擎只 ...

  8. Unreal Engine 4(虚幻UE4)GameplayAbilities 插件入门教程(三)技能标签(Ability Tags)

    本教程参考了https://wiki.unrealengine.com/GameplayAbilities_and_You,如果没有学习前两篇教程,请前往学习. GameplayAbilities插件 ...

  9. Luogu 1894 [USACO4.2]完美的牛栏The Perfect Stall / POJ 1274 The Perfect Stall(二分图最大匹配)

    Luogu 1894 [USACO4.2]完美的牛栏The Perfect Stall / POJ 1274 The Perfect Stall(二分图最大匹配) Description 农夫约翰上个 ...

  10. Luogu 3402 最长公共子序列(二分,最长递增子序列)

    Luogu 3402 最长公共子序列(二分,最长递增子序列) Description 经过长时间的摸索和练习,DJL终于学会了怎么求LCS.Johann感觉DJL孺子可教,就给他布置了一个课后作业: ...