hibernate
这条路黑到底
越努力,越幸运!
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
An AnnotationConfiguration instance is required to use...等几个异常
1.异常: An AnnotationConfiguration instance is required to use 意思是,用了注解了,自然要用注解类生成SessionFactory private static Configuration configuration = new AnnotationConfiguration();当然了,如果你用Hibernate4以上的版本,就没有这种原创 2016-07-13 21:42:42 · 3369 阅读 · 0 评论 -
not-null property references a null or transient value: 等关于cinema项目bug
今天改一个项目,遇到好多bug。以下一一说主要bug。 1.not-null property references a null or transient value: entity.Film.name很明显,意思是不能有一个空的属性引用。 解决:检查数据库,允许为空,发现还是报错。 在xml文件中,去掉属性中not-null即可。2.Could not execute JDBC batc原创 2016-07-14 23:31:22 · 817 阅读 · 0 评论 -
Caused by: java.sql.SQLSyntaxErrorException: ORA-00942: 表或视图不存在,分页等关于hibernate测试的几个问题
今天的hibernate出现一个错误 1.异常。Caused by: java.sql.SQLSyntaxErrorException: ORA-00942: 表或视图不存在异常很明显。马上想到的是数据库连接是不是改了。我之前的用户名是htest,后面改成htest1。立刻改掉。<property name="connection.username">htest1</property>还是报错。原创 2016-07-16 09:15:53 · 21145 阅读 · 0 评论 -
org.hibernate.LazyInitializationException解决办法
ERROR org.apache.struts2.dispatcher.DefaultDispatcherErrorHandler - Exception occurred during processing request: [org.hibernate.LazyInitializationException: could not initialize proxy - no Session, co原创 2016-08-04 00:53:48 · 11367 阅读 · 0 评论 -
hibernate与struts2一起时的异常处理
今天项目刚将hibernate与struts2放一起。异常还不少。ERROR StatusLogger Log4j2 could not find a logging implementation. Please add log4j-core to the classpath. Using SimpleLogger to log to the console...log4j:WARN No app原创 2016-07-22 00:17:37 · 4838 阅读 · 0 评论 -
商品订购系统时出现的问题汇总 not-null property references a null or transient value 等
最近用hibernate和struts2写的一个小的项目,出现了很多问题。还算顺利。问题点回顾。 1.配置struts2,直接忘记在web.xml配置核心控制器。2.1.3之前是FiltDispatcher,之后是filter.StrutsPrepareAndExecuteFilter.忘记配了,直接不报错误。<filter> <filter-name>struts2</f原创 2016-08-06 00:08:37 · 7388 阅读 · 0 评论 -
hibernate+Struts2+jquery easyui 做分页处理时的一些问题
合在一起做的时候,问题就多了。 1. select count(*) as col_0_0_ from JBIT.GOODS goods0_看到上面的sql,马上就会想到,获取所有记录时,面对long型的转换,修改Dao中代码。Integer.parseInt(session.createQuery(" select count(*) from Good原创 2016-08-08 18:10:42 · 1229 阅读 · 0 评论 -
.NonUniqueObjectException: a different object with the same identifier等的解决
这几天写hibernate+struts2+easyui+Oracle小项目时遇到的异常。org.hibernate.NonUniqueObjectException: a different object with the same identifier value was already associated with the session: [entity.TbBooks#1]看英语,就表示原创 2016-08-12 00:36:04 · 875 阅读 · 0 评论 -
hibernate的一个分页的写法
直接上代码:// 按条件分页查询投票集合 public List<Subject> getSubjectList(String title, Integer pageNumber, Integer pageSize) { if(pageNumber==null){ pageNumber = 1; }原创 2016-08-12 23:28:39 · 474 阅读 · 0 评论
分享