错误码:

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaAutoConfiguration.class]: Invocation of init method failed; nested exception is javax.persistence.PersistenceException: [PersistenceUnit: default] Unable to build Hibernate SessionFactory

上述错误码nested exception is javax.persistence.PersistenceException可知是实体类实例化的时候报错,所以应该查看实体类是否有注解、字段书写的错误,我的是因为之前做关联,后面去掉了,但注解没有去掉导致,出错代码:

    @NotNull
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "user_id", nullable = false)
private long userId; 之前是: @NotNull
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "user_id", nullable = false)
private User user; 正确的是:
  @JoinColumn(name = "user_id", nullable = false)
  private long userId;

hibernate之persistence错误的更多相关文章

  1. 坑爹的Hibernate 映射文件错误提示org.xml.sax.SAXParseException

    今天整整一个上午都在和hibernate做斗争,早上一来,继续昨天的项目开发,发现spring项目不能启动,从错误中看是hibernate错误,多半是hibernate配置有错误,关键是错误提示中显示 ...

  2. hibernate出现 org.hibernate.PropertyNotFoundException: field [departmen] not found on cn.itcast.hibernate.domain.Employee1错误

    hibernate出现 org.hibernate.PropertyNotFoundException: field [departmen] not found on cn.itcast.hibern ...

  3. hibernate报ExceptionInInitializerError错误

    今天在练习hibernate的criteria接口查询时候报了错: java.lang.ExceptionInInitializerError at test.testThisPro.createCr ...

  4. hibernate运行常见错误

    错误一: Exception in thread "main" org.hibernate.MappingException: Could not determine type f ...

  5. org.hibernate.id.IdentifierGenerationException错误解决方法

    org.hibernate.id.IdentifierGenerationException: ids for this class must be manually assigned before ...

  6. Hibernate 之 Persistence

    分享自:  http://blog.csdn.net/jnqqls/article/details/8276059 在我们之前的文章已经了解到,Hibernate的汉语解释叫做冬眠,而这个冬眠我个人理 ...

  7. 解决离线Could not parse configuration:hibernate.cfg.xml错误

    离线使用hibernate tool 生成反向工程,在配置 配置文件完,生成配置文件后,会报出org.hibernate.HibernateException: Could not parse con ...

  8. 配置hibernate出现的错误一

    问题:2011-04-18 11:35:46,734 ERROR [org.hibernate.tool.hbm2ddl.SchemaUpdate] - could not complete sche ...

  9. 【Hibernate】版本错误 org/hibernate/Query : Unsupported major.minor version 52.0

    报错原因:jdk1.7不支持 hibernate的最新版本5.2.0,把hibernate的版本换成5.1.3或更早的版本. 补充:mysql-connector-java-6.0.x也不被hiber ...

随机推荐

  1. javascript表单验证

    表单HTML <form action="" method="post"> <fieldset class="login" ...

  2. React Native 开发之 (05) flexbox布局

    一  flexbox布局 1 flex布局 flexbox是ReactNative 应用开发中必不可少的内容,也是最常用的内容. 传统的页面布局是基于盒子模型,依赖定位属性,流动属性和显示属性来解决. ...

  3. python模块app登陆认证(M2Crypto数字证书加密)

    需求: 1.通过数字证书,非对称加密方式传送对称秘钥给服务端 2.用户名.密码使用对称秘钥加密,发送服务端验证 3.传送数据使用字节流方式 实现思路: 1.了解python的struct模块,用于字节 ...

  4. BZOJ树链剖分题目汇总

    1036,2157,2243,4034,4196;2325,2908,3083,3159,3531,3626,3999;可以不树剖:1146;2819,2843,4448,4530.

  5. SQL 操作语句

    SQL Server T-SQL高级查询 高级查询在数据库中用得是最频繁的,也是应用最广泛的. Ø 基本常用查询 --select select * from student; --all 查询所有 ...

  6. jQuery关于隐式迭代的个人理解~

    1.JQuery对象" 如: $('div').text("div展示的信息") 可以看成"是一个包含一个dom数组 和 包含所有Jquery方法的容器 2.每 ...

  7. Hibernate学习总结

    首先声明这是个坑爹的框架 属于ssh经典框架中的持久层框架,说白了就是管理数据库的. 下载地址:http://hibernate.org/orm/ 这里写了版本5.2,下载下来的基本不怎么会用,因为文 ...

  8. js无间隙滚动

    代码一: ; //设置文字滚动速度 dome2.innerHTML=dome1.innerHTML //复制dome1为dome2 function Marquee(){ ) //当滚动至dome1与 ...

  9. python 基本数据类型分析

    在python中,一切都是对象!对象由类创建而来,对象所拥有的功能都来自于类.在本节中,我们了解一下python基本数据类型对象具有哪些功能,我们平常是怎么使用的. 对于python,一切事物都是对象 ...

  10. Docker Dockerfile详解

    http://blog.csdn.net/wsscy2004/article/details/25878223 如何使用 Dockerfile用来创建一个自定义的image,包含了用户指定的软件依赖等 ...