Exception in thread "main" org.hibernate.MappingNotFoundException:
错误信息Exceptioninthread"main"org.hibernate.MappingNotFoundException:resource:com/test/E...
错误信息
Exception in thread "main" org.hibernate.MappingNotFoundException: resource: com/test/Employe.hbm.xml not found
配置文件如下:
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.url">
jdbc:oracle:thin:@localhost:1521:orcl
</property>
<property name="hibernate.connection.username">scott</property>
<property name="hibernate.connection.password">4358673ym</property>
<property name="hibernate.connection.driver_class">
oracle.jdbc.driver.OracleDriver
</property>
<property name="show_sql">true</property>
<mapping resource="com/test/Employe.hbm.xml" />
</session-factory>
</hibernate-configuration>
持久类文件:与java类文件一个包
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-mapping package="com.text">
<class name="Employe" table="emloye">
<id name="id" colum="id" type="java.lang.int">
<generatoe>
<parm name="sequence">emp_seq</parm>
</generatoe>
</id>
<property name="name" type="java.lang.String" column="name" not-null="false"/>
<property name="email" type="java.lang.String" column="email" not-null="false"/>
<property name="hiredate" type="java.util.Date" column="hiredate" not-null="false"/>
</class>
</hibernate-mapping> 展开
Exception in thread "main" org.hibernate.MappingNotFoundException: resource: com/test/Employe.hbm.xml not found
配置文件如下:
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.url">
jdbc:oracle:thin:@localhost:1521:orcl
</property>
<property name="hibernate.connection.username">scott</property>
<property name="hibernate.connection.password">4358673ym</property>
<property name="hibernate.connection.driver_class">
oracle.jdbc.driver.OracleDriver
</property>
<property name="show_sql">true</property>
<mapping resource="com/test/Employe.hbm.xml" />
</session-factory>
</hibernate-configuration>
持久类文件:与java类文件一个包
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-mapping package="com.text">
<class name="Employe" table="emloye">
<id name="id" colum="id" type="java.lang.int">
<generatoe>
<parm name="sequence">emp_seq</parm>
</generatoe>
</id>
<property name="name" type="java.lang.String" column="name" not-null="false"/>
<property name="email" type="java.lang.String" column="email" not-null="false"/>
<property name="hiredate" type="java.util.Date" column="hiredate" not-null="false"/>
</class>
</hibernate-mapping> 展开
3个回答
展开全部
<generatoe>?不是<genertator>?
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<id name="id" colum="id" type="java.lang.int">
type="java.lang.int" 改成 java.lang.Integer 试试
type="java.lang.int" 改成 java.lang.Integer 试试
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询