`

org.hibernate.AnnotationException: No identifier specified for entity

阅读更多
使用hibernate的e-r映射pojo类的时候遇到org.hibernate.AnnotationException: No identifier specified for entity异常。可是entity类的注释没有问题,唯一的不正常的地方是这张表比较特殊没有主键,好像在使用hibernate的映射表的时候entity类是必须要主键的,否则就会报出这个异常。
解决办法自然是add一个主键进去,添加主键的神器就在我的上一篇文章中,这里主要是对实体类的注释,应该做添加
    @Id
    @GeneratedValue(strategy=GenerationType.IDENTITY)
    @Column(name = "id", nullable = false)
    private int id;
分享到:
评论

相关推荐

    hibernate.properties

    # Hibernate, Relational Persistence for Idiomatic Java # # License: GNU Lesser General Public License (LGPL), version 2.1 or later. # See the lgpl.txt file in the root directory or <http://...

    解决error C2065: '_beginthreadex' :undeclared identifier

    报错误error C2065: '_beginthreadex' :undeclared identifier

    Keil C编译器常见警告与错误信息的解决方法 Keil C编译器常见警告与错误信息的解决方法

    5 ***WARNING 16:UNCALLED SEGMENT,IGNORED FOR OVERLAY PROCESS SEGMENT: ?PR?_DELAYX1MS?DELAY 说明 DelayX1ms( )函数未被其它函数调用 也会占用程序记忆体空间 解决方法 去掉 DelayX1ms( )函数 或利用条件编译#if...

    uCOS_III例子程序+Micrium.RTOS.1.0.0.pack

    d:\Keil_v5\ARM\PACK\Micrium\RTOS\1.0.0\Software\uCOS-II\Ports\ARM-Cortex-M3\Generic\RealView\os_cpu_c.c(258): error: #20: identifier "p_stk" is undefined 在os_cpu_c.c中增加变量OS_STK_DATA *p_stk_data...

    org.eclipse.swt.win32

    org.eclipse.swt.SWT.class org.eclipse.swt.SWTError.class org.eclipse.swt.SWTException.class org.eclipse.swt.accessibility.ACC.class org.eclipse.swt.accessibility.Accessible.class org.eclipse.swt....

    Unitils-jar包

    Unitils 测试框架目的是让单元测试变得更加容易和可维护。Unitils 构建在DbUnit 与 ...进行测试并提供与Spring 和Hibernate 相集成。Unitils 设计成以一种高度可配置和松散耦 合的方式来添加这些服务到单元测试中

    Hibernate注释大全收藏

    Hibernate注释大全收藏 声明实体Bean @Entity public class Flight implements Serializable { Long id; @Id public Long getId() { return id; } public void setId(Long id) { this.id = id; } } @Entity ...

    The Digital Object Identifier initiative: metadata implications

    The Digital Object Identifier initiative: metadata implications Context/status information The purpose of this document is to generate a DOI Foundation consensus paper on metadata, as a companion ...

    高性能消息传输机制Aeron.zip

    会话ID Session ID: A unique identifier for a Session.频道 Channel: A transmission media needs to have a means of identifying a flow of data and the addressing model of the media. For Aeron, this ...

    App上线提交详细过程

    5. Bundle Identifier (App ID Suffix) 6. 选择服务 二、 生成Provisioning Profiles 1. 生成development Provisioning Profiles,用于真机调试 1.1. 新增Provisioning Profiles 1.2. 选择Provisioning Profiles...

    jquery中ajax请求后台数据成功后既不执行success也不执行error的完美解决方法

    jquery中ajax请求后台数据成功后既不执行success也不执行error,此外系统报错:Uncaught SyntaxError: Unexpected identifier at Object.success,但后台能够返回数据,原代码如下: var source=[]; $.ajax({ ...

    PC-IDENTIFIER-09.01.00.00-01.17.00.15

    KB2558 Desigo CC 2.1 SR1, ABT-Pro, XWP: Lease time of S7DOS expired at 31.12.2015 https://support.industry.siemens.com/cs/us/en/view/109482349

    CoolTrayIcon 系统托盘控件

    CoolTrayIcon 系统托盘控件

    winnt.h文件(qt报错)

    qt vs编译报错error C2146: syntax error : missing ';' before identifier 'PVOID64',替换C:\Program Files (x86)\Windows Kits\8.1\Include\um中的winnt.h文件即可

    hibernate3.6 文档(pdf 格式)

    1.1. Part 1 - The first Hibernate Application ................................................................ 1 1.1.1. Setup .............................................................................

    HibernateAPI中文版.chm

    HIBERNATE - 符合Java习惯的关系数据库持久化 Hibernate参考文档 3.2 -------------------------------------------------------------------------------- 目录 前言 1. 翻译说明 2. 版权声明 1. Hibernate...

    apktool_AndResGuard:修复apktool打包出现No resource found...

    No resource identifier found for attribute... No resource found that matches the given name..... ....... 使用apktool-2.0.3也可以回编译,但是比如微信回编译后会增加到110M左右,很不友好。 而使用apktool-...

    Hibernate+中文文档

    16.1.2. 实体查询(Entity queries) 16.1.3. 处理关联和集合类(Handling associations and collections) 16.1.4. 返回多个实体(Returning multiple entities) 16.1.5. 返回非受管实体(Returning non-managed ...

    java.sql.SQLSyntaxErrorException:

    背景: 同事在上传文件时碰到这样一个数据库报错,上传文件大小为10M。 java.sql.SQLSyntaxErrorException: The size of BLOB/TEXT data inserted in one transaction is greater than 10% of redo log size….. ...

    hibernate3.2中文文档(chm格式)

    HIBERNATE - 符合Java习惯的关系数据库持久化 Hibernate参考文档 3.2 -------------------------------------------------------------------------------- 目录 前言 1. 翻译说明 2. 版权声明 1. Hibernate...

Global site tag (gtag.js) - Google Analytics