Tune method in Controller. [PersistenceUnit: default] Unable to build Hibernate SessionFactory

牧云@^-^@ 提交于 2019-12-10 00:12:41

问题


how to realize the idea? Send me information: {"idBanner":2, "fullnameClient":"Aria"}. If click don't contain in database, then click save and send email businesscenter. Else, send a message: "you responsed". Error maybe version dependences? (Entity) : Click bind Banner, Banner bind Businesscentr.


回答1:


Schema-validation: wrong column type encountered in column [id_bc] in table [banner]; found [int (Types#INTEGER)], but expecting [bigint (Types#BIGINT)]

This is the problem which is causing this

Stack trace it is mention that hibernate is validating your schema where it is finding wrong column type, this happen when hibernate.hbm2ddl.auto = validate ,

Now you can keep this property hibernate.hbm2ddl.auto = update , so that it will update the changes made in your entities,

or just change your database schema and make the type of this column as big integer, as in your entities you are using long.

Also, no need to recreate database when you are using hibernate.hbm2ddl.auto = update hibernate won't validate your schema in this case.

Thanks.




回答2:


Remade database, changed in hibernate.hbm2ddl.auto = create



来源:https://stackoverflow.com/questions/41944580/tune-method-in-controller-persistenceunit-default-unable-to-build-hibernate

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!