欢迎来到Doc100.Net免费学习资源知识分享平台!
您的位置:首页 > 程序异常 >

使用hibernate操作,出现org.hibernate.invalidmappingexception: unable to read xml,该怎么解决

更新时间: 2014-01-05 01:58:03 责任编辑: Author_N1

 

使用Hibernate操作,出现org.hibernate.InvalidMappingException: Unable to read XML
hibernate.cfg.xml:
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
          "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
          "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
          
<!-- Generated by MyEclipse Hibernate Tools.                   -->
<hibernate-configuration>

<session-factory>
<property name="dialect">
org.hibernate.dialect.SQLServerDialect
</property>
<property name="connection.url">
jdbc:sqlserver://192.168.2.3:1433;databaseName=YXKQGIS
</property>
<property name="connection.username">et</property>
<property name="connection.password">et</property>
<property name="connection.driver_class">
com.microsoft.sqlserver.jdbc.SQLServerDriver
</property>
<property name="myeclipse.connection.profile">
Etrans_YXKQGIS
</property>
<mapping resource="et/pojo/CityComponent.hbm.xml" />
</session-factory>
</hibernate-configuration>


CityComponent.hbm.xml:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd ">
<!-- 
    Mapping file autogenerated by MyEclipse Persistence Tools
-->
<hibernate-mapping>
    <class name="et.pojo.CityComponent" table="YXKQGIS_CityComponent" schema="dbo" catalog="YXKQGIS">
        <id name="id" type="string">
            <column name="ID" length="20" />
            <generator class="assigned"></generator>
        </id>
        <property name="nameplate" type="string">
            <column name="Nameplate" length="50" not-null="true" />
        </property>
        <property name="model" type="string">
            <column name="Model" length="20" not-null="true" />
        </property>
        <property name="buildTime" type="timestamp">
            <column name="BuildTime" length="23" />
        </property>
        <property name="manageUnitName" type="string">
            <column name="ManageUnitName" length="50" />
        </property>
        <property name="manageUnitAddress" type="string">
            <column name="ManageUnitAddress" length="800" />
        </property>
        <property name="manageUnitLinkman" type="string">
            <column name="ManageUnitLinkman" length="50" />
        </property>
        <property name="manageUnitContactNumber" type="string">
            <column name="ManageUnitContactNumber" length="50" />
        </property>
        <property name="manageUnitContactAddress" type="string">
            <column name="ManageUnitContactAddress" length="500" />
        </property>
        <property name="principal" type="string">
            <column name="Principal" length="50" />
        </property>
        <property name="principalContactNumber" type="string">
            <column name="PrincipalContactNumber" length="50" />
        </property>
        <property name="principalContactAddress" type="string">
上一篇:上一篇
下一篇:下一篇

 

随机推荐程序问答结果

 

 

如对文章有任何疑问请提交到问题反馈,或者您对内容不满意,请您反馈给我们DOC100.NET论坛发贴求解。
DOC100.NET资源网,机器学习分类整理更新日期::2014-01-05 01:58:03
如需转载,请注明文章出处和来源网址:http://www.doc100.net/bugs/t/3778/
本文WWW.DOC100.NET DOC100.NET版权所有。