![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
hibernate
maggiehexu
这个作者很懒,什么都没留下…
展开
-
hibernate:SQL 命令未正确结束,org.hibernate.exception.SQLGrammarException: could not insert
报错如下:ERROR 2010-02-23 12:29:06,640 [JDBCExceptionReporter.java,72] - ORA-00933: SQL 命令未正确结束ERROR 2010-02-23 12:29:06,671 [LoginAction.java,55] - org.hibernate.exception.SQLGrammarException: could原创 2010-02-23 14:07:00 · 2086 阅读 · 0 评论 -
hibernate:ORA-02289: 序列(号)不存在
报错如下:Hibernate: select hibernate_sequence.nextval from dualERROR 2010-02-23 13:56:53,125 [JDBCExceptionReporter.java,72] - ORA-02289: 序列(号)不存在ERROR 2010-02-23 13:56:53,125 [LoginAction.java,55] -原创 2010-02-23 14:19:00 · 4287 阅读 · 2 评论 -
hibernate 脱管状态
<br />我的数据库操作使用的是hibernate。<br /><br />在save 的时候是将主键设置为0,<br /><br />然后在数据库中插入时,利用触发器调用存储过程获得主键。<br /><br />目前数据库插入是没问题的,<br /><br />但是,利用<br /><br />Long id = (Long)this.getHibernateTemplate().save(entity);<br /> <br />是得不到主键的。<br /> <br />因为hibernateSess原创 2010-08-07 08:56:00 · 1180 阅读 · 0 评论 -
hibernate 对数据库视图映射 struts2 展现
这两天遇到了hibernate,需要对数据库进行的表视图进行映射。首先,在myeclipse里进入hibernate操作的界面。同映射表一样,在建立的链接上,在view下会看到相应的视图,同映射表一样,映射视图就好,映射完后,会发现生成2个类(一个类名同视图名,一个类名为视图名+Id),网上说,是因为视图没有主键的原因,这里用到了联合主键。在spring层和action里关联实体时,需要关联与视图名相同的那个类。在struts2中,访问某个字段值时,如下:其中,id为hibernate在与视图同名的类中建立原创 2010-06-21 10:34:00 · 739 阅读 · 0 评论 -
hibernate 3.2 save 保存失败
时间太晚了,先记录一下,以备日后整理。 今天尝试使用Derby,然后使用MyEclipse默认的hibernate 3.2 构建project, 在save的时候怎么也save不进去值,但是使用findAll等方法没有问题, so,说明Derby没有问题,数据库连接也没有问题. 经历网上的一番搜索,得知: hibernate默认是设置AutoCommit为false的,也就是执原创 2011-10-18 23:59:18 · 3259 阅读 · 1 评论 -
【解决Hiberate】 query specified join fetching, but the owner of the fetched association..
运行Hiberante查询报错: query specified join fetching, but the owner of the fetched association was not present in the select list [FromElement{explicit,not a collection join,fetch join,fetch non-lazy prope原创 2012-04-23 19:39:09 · 5852 阅读 · 0 评论 -
【解决Hibernate】key-many-to-one 关联的many一端有null
在用Hiberante时, 当一个model中使用联合主键,而联合主键中有其中一项还关联到另一张表, 这时用key-many-to-one, 但是,有时数据中,在做many-to-one时,找不到one的那一端,严格意义上讲,这种属于垃圾数据, 但是在实际应用中,又不可以删除。 在做many-to-one时,可以在配置文件中配置not-found="ignore", 但是k原创 2012-04-23 19:50:38 · 3671 阅读 · 0 评论 -
外连接的Mapping 配置文件设置
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">原创 2014-10-07 09:36:42 · 384 阅读 · 0 评论