我的配置文件是这样写的:
hibernate.cfg.xml:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2" >
<session-factory name="NHibernate.Test"> <!--properties-->
<property name="nhibernate">type="System.Configuration.NameValueSectionHandler, System, Version=1.0.3300.0,Culture=neutral, PublicKeyToken=b77a5c561934e089"</property>
<property name="log4net">log4net.Config.Log4NetConfigurationSectionHandler,log4net</property> <property name="hibernate.connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="hibernate.connection.driver_class">NHibernate.Driver.OracleClientDriver</property>
<property name="hibernate.connection.connection_string">Data Source=BIC;User Id=RFT;Password=RFT;Persist Security Info=true</property>
<property name="hibernate.dialect">NHibernate.Dialect.Oracle9Dialect</property> <!--mapping files-->
<mapping assembly="NhibernateSample1"/>
</session-factory>
</hibernate-configuration>User.hbm.xml:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="NhibernateSample1.User,NhibernateSample1" table="UserTable" lazy="false">
<id name="Id" column="Id" unsaved-value="0">
<generator class="assigned" />
</id>
<property name="User_Name" column="User_Name" type="string" length="20" not-null="true" unique="true"></property>
<property name="Pwd" column="Pwd" type="string" length="20" not-null="true"></property>
</class>
</hibernate-mapping>可是进行更新后出现如下错误:
Dialect does not support identity key generation哪位高手知道的请指点我下吧.....
hibernate.cfg.xml:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2" >
<session-factory name="NHibernate.Test"> <!--properties-->
<property name="nhibernate">type="System.Configuration.NameValueSectionHandler, System, Version=1.0.3300.0,Culture=neutral, PublicKeyToken=b77a5c561934e089"</property>
<property name="log4net">log4net.Config.Log4NetConfigurationSectionHandler,log4net</property> <property name="hibernate.connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="hibernate.connection.driver_class">NHibernate.Driver.OracleClientDriver</property>
<property name="hibernate.connection.connection_string">Data Source=BIC;User Id=RFT;Password=RFT;Persist Security Info=true</property>
<property name="hibernate.dialect">NHibernate.Dialect.Oracle9Dialect</property> <!--mapping files-->
<mapping assembly="NhibernateSample1"/>
</session-factory>
</hibernate-configuration>User.hbm.xml:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="NhibernateSample1.User,NhibernateSample1" table="UserTable" lazy="false">
<id name="Id" column="Id" unsaved-value="0">
<generator class="assigned" />
</id>
<property name="User_Name" column="User_Name" type="string" length="20" not-null="true" unique="true"></property>
<property name="Pwd" column="Pwd" type="string" length="20" not-null="true"></property>
</class>
</hibernate-mapping>可是进行更新后出现如下错误:
Dialect does not support identity key generation哪位高手知道的请指点我下吧.....
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货