
hibernate
关赫
多多关照
展开
-
a different object with the same identifier value was already associated with the session
这个错误产生原因很多人都知道,因为在hibernate中同一个session里面有了两个相同标识但是是不同实体,当这时运行saveOrUpdate(object)操作的时候就会报这个错误User currentUser = (User) ActionContext.getContext().getSession().get("currentUser");//从HttpSession原创 2015-12-21 12:59:12 · 476 阅读 · 0 评论 -
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server versi
在SSH整合过程中,自动建表时发生的错误,这个错误比较好解决在hibernate.cfg.cml文件中需要配mysql的方言,常用的mysql方言有以下两种(其他的自行百度): org.hibernate.dialect.MySQLInnoDBDialect org.hibernate.dialect.MySQLDialect 选择第二种进行Mys原创 2015-06-16 22:05:26 · 1623 阅读 · 0 评论 -
Can't create table './store/#sql-b2c_1a.frm' (errno: 150)解决方法
错误原因有四:1、外键的引用类型不一样,主键是int外键是char 2、找不到主表中 引用的列 3、主键和外键的字符编码不一致 4.还有要建立外键的话,要先建立索引。没有建立索引也会出错。我的错误原因是1,外键的引用类型不一样,但是改的时候却出现了错误:MYSQL-error on rename of '' to ''(error:150)解决办法就是直接删除相转载 2015-07-03 03:35:50 · 7548 阅读 · 1 评论