最赞回答 / BMaple
可以参考一下这篇文章http://blog.csdn.net/wen7280/article/details/53858222如果用myeclipse,就不需下载插件了
2017-09-04
最赞回答 / 追梦82
hibernate.cfg.xml中<mapping resource="包名/Students.hbm.xml"/>这样就可以了;而且报名如果是com.xxx.xxxx的话,则应该写成<mapping resource="com/xxx/xxxx/Students.hbm.xml"/>
2017-08-26
最赞回答 / 暮色如虹
找到原因了,是由于Students.hbm.xml文件中,我的主键生成策略使用了native,换成assigned就可以了。但原理还是不懂。直接原因是,使用了Blob类型,主键自增不好使了。tag一下,变强之后,要记得解释这个问题。
2017-08-22
最新回答 / 暮色如虹
Blob image = Hibernate.getLobCreator(session).createBlob(input,input.available());你的Blob包用的是com.mysql.jdbc.Blob,应该用java.sql.Blob。把你的代码中import com.mysql.jdbc.Blob;替换成import java.sql.Blob;
2017-08-20
最新回答 / 风傲天
openSession()每次创建一个session对象,需要手动关闭,不关闭提交过多后连接池溢出.getCurrentSession()每次创建的是同一个session对象,自动关闭,
2017-08-17
最新回答 / lipppppG
百度解决了。改了hibernate.cfg.xml的配置<property name="connection.url">jdbc:mysql://localhost:3306/hibernate</property> <property name="hibernate.connection.username">root</property> <property name="hibernate.connection.p...
2017-08-16