08-07
12
Batch update returned unexpected row count from update: 0 actual row count: 0 expected: 1
作者:Java伴侣 日期:2008-07-12
今天在做自身关联的时候遇到的问题:
Batch update returned unexpected row count from update: 0 actual row count: 0 expected: 1解决方案
阻力前提 :当有张表同一个字段管理2张表是,今天用one-to-moeny试了一下,
开始配置one-to-many时,是不能同时写入数据;
后来《Batch update returned unexpected row count from update: 0 actual row count: 0 expected: 1》不能同时跟新;找了资料大概理解里面的原理,但不是完全明白哦!还需要继续look@@;
xml中set配置:
<set name="offerd" lazy="false" inverse="false" outer-join="false" cascade="all"> <key column="offerID" /> <one-to-many class="OfferDetail"/> </set>
Batch update returned unexpected row count from update: 0 actual row count: 0 expected: 1解决方案
阻力前提 :当有张表同一个字段管理2张表是,今天用one-to-moeny试了一下,
开始配置one-to-many时,是不能同时写入数据;
后来《Batch update returned unexpected row count from update: 0 actual row count: 0 expected: 1》不能同时跟新;找了资料大概理解里面的原理,但不是完全明白哦!还需要继续look@@;
xml中set配置:
<set name="offerd" lazy="false" inverse="false" outer-join="false" cascade="all"> <key column="offerID" /> <one-to-many class="OfferDetail"/> </set>
Tags: Batch up&#100;ate manay-to-one
憋屈了半天,怎么建表还建不上了呢?比如Hibernate输出到控制台的:
create table blur_catalog (id integer not null, name varchar(255), keyWords varchar(255), imgPath varchar(255), catalog_id integer, description varchar(255), sort integer, savePath varchar(255), htmlLink tinyint, defaultName varchar(255), catalogType varchar(255), channelSkin varchar(255), listSkin varchar(255), articleSkin varchar(255), primary key (id))
怎么看都没错,费解,再看hbm.xml配置:
复制内容到剪贴板 程序代码
create table blur_catalog (id integer not null, name varchar(255), keyWords varchar(255), imgPath varchar(255), catalog_id integer, description varchar(255), sort integer, savePath varchar(255), htmlLink tinyint, defaultName varchar(255), catalogType varchar(255), channelSkin varchar(255), listSkin varchar(255), articleSkin varchar(255), primary key (id))
怎么看都没错,费解,再看hbm.xml配置:
复制内容到剪贴板 程序代码
<!-- self -->
<many-to-one name="parentCatalog" column="catalog_id"
class="com.blur.myHibernate.po.article.Catalog">
</many-to-one>
<many-to-one name="parentCatalog" column="catalog_id"
class="com.blur.myHibernate.po.article.Catalog">
</many-to-one>
Tags: 无聊