发帖    主题    评论    推荐    标签    作者    订阅    查搜    注册   登陆   关注
 
面向对象 设计模式 领域驱动设计 企业架构 框架 开发教程 微服务 CQRS 扩展性 并发编程 事件溯源 分布式 SOA

为什么我在Hibernate中调用saveOrUpdate(),去新插入了一列

2003-08-13 08:50
赞助商链接

下面是我的mapping文件
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="com.asroad.persistence.Employee" table="Employee" dynamic-update="false">
<id name="id" type="java.lang.Long" column="id" unsaved-value="null">
<generator class="native"/>
</id>
<property name="operator" column="Operator" type="string" length="50"/>
<property name="password" column="Password" type="string" length="50" unique="true"/>
<property name="age" column="Age" type="integer" length="10"/>
<property name="phone" column="Phone" type="string" length="20"/>
<property name="address" column="Address" type="string" length="255"/>
<property name="sex" column="Sex" type="string" length="50"/>
<property name="position" column="Position" type="string" length="20"/>
<property name="salutation" column="Salutation" type="string" length="20"/>
<property name="filiale" column="filiale" type="string" length="50"/>
<property name="mobile" column="Mobile" type="string" length="20"/>
<property name="email" column="EMail" type="string" length="50" unique="true"/>
<property name="baccess" column="bACCESS" type="long" length="20"/>
<property name="empname" column="EmpName" type="string" length="50"/>
<property name="bsecurity" column="bSecurity" type="integer" length="10"/>
<property name="opid" column="OpID" type="string" length="50"/>
<property name="ispublic" column="IsPublic" type="byte" length="1"/>
<property name="editphone" column="EditPhone" type="byte" length="1"/>
<property name="conntcb" column="ConnTCB" type="integer" length="10"/>
<property name="phonemcb" column="PhoneMCB" type="integer" length="10"/>
<property name="porte" column="PortE" type="integer" length="10"/>
<property name="curdeptname" column="CurDeptName" type="string" length="50"/>
</class>
</hibernate-mapping>


以下是表
CREATE TABLE [dbo].[Employee] (
[id] [int] IDENTITY (1, 1) NOT NULL ,
[Operator] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NOT NULL ,
[Password] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[Phone] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
[Address] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
[Sex] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[Age] [int] NULL ,
[Position] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
[Salutation] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
[filiale] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[Mobile] [nvarchar] (20) COLLATE Chinese_PRC_CI_AS NULL ,
[EMail] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[bACCESS] [numeric](20, 0) NOT NULL ,
[EmpName] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[bSecurity] [int] NULL ,
[OpID] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[IsPublic] [bit] NULL ,
[EditPhone] [bit] NULL ,
[ConnTCB] [int] NULL ,
[PhoneMCB] [int] NULL ,
[PortE] [int] NULL ,
[CurDeptName] [varchar] (50) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO

2003-08-13 08:55

怎么搞的jive有BUG
<hibernate-mapping><br>
<class name="com.asroad.persistence.Employee" table="Employee"
dynamic-update="false"><br>
<id name="id" type="java.lang.Long" column="id"
unsaved-value="1"><br>
<generator class="identity"/><br>
</id><br>
<property name="operator" column="Operator" type="string"
length="50"/><br>
<property name="password" column="Password" type="string"
length="50" unique="true"/><br>
<property name="age" column="Age" type="integer"
length="10"/><br>
<property name="phone" column="Phone" type="string"
length="20"/><br>
<property name="address" column="Address" type="string"
length="255"/><br>
<property name="sex" column="Sex" type="string"
length="50"/><br>
<property name="position" column="Position" type="string"
length="20"/><br>
<property name="salutation" column="Salutation" type="string"
length="20"/><br>
<property name="filiale" column="filiale" type="string"
length="50"/><br>
<property name="mobile" column="Mobile" type="string"
length="20"/><br>
<property name="email" column="EMail" type="string"
length="50" unique="true"/><br>
<property name="baccess" column="bACCESS" type="long"
length="20"/><br>
<property name="empname" column="EmpName" type="string"
length="50"/><br>
<property name="bsecurity" column="bSecurity" type="integer"
length="10"/><br>
<property name="opid" column="OpID" type="string"
length="50"/><br>
<property name="ispublic" column="IsPublic" type="byte"
length="1"/><br>
<property name="editphone" column="EditPhone" type="byte"
length="1"/><br>
<property name="conntcb" column="ConnTCB" type="integer"
length="10"/><br>
<property name="phonemcb" column="PhoneMCB" type="integer"
length="10"/><br>
<property name="porte" column="PortE" type="integer"
length="10"/><br>
<property name="curdeptname" column="CurDeptName" type="string"
length="50"/><br>
</class><br>
</hibernate-mapping>

赞助商链接

赞助商链接

返回顶部

移动版 关于本站 使用帮助 联系反馈 最佳分辨率1366x768
OpenSource JIVEJDON Powered by JdonFramework Code © 2002-20 jdon.com