问答详情
源自:1-11 通过Hibernate API编写访问数据库的代码

关于hibernate Junit测试的错误

五月 08, 2016 12:13:36 下午 org.hibernate.Version logVersion INFO: HHH000412: Hibernate Core {5.1.0.Final} INFO: HHH000206: hibernate.properties not found INFO: HHH000021: Bytecode provider name : javassist 这怎么解决啊

提问者:慕粉3229487 2016-05-08 12:18

个回答

  • zhangdi0534
    2016-05-29 22:20:30

    把这个Students.hbm.xml 配置文件放到src目录下,不要放到那个default包下!!!

  • 慕粉_sun
    2016-05-24 15:27:42

    <mapping resource="Students.hbm.xml" />

  • 慕粉3229487
    2016-05-08 12:27:51

    <?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">
    <hibernate-configuration>
        <session-factory>
            <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver </property> 
            <property name="hibernate.connection.username">root </property> 
            <property name="hibernate.connection.password">root </property>   
            <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/imocc?useUnicode=true&characterEncoding=utf-8</property>
            <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect </property> 
            
            <property name="hibernate.show_sql">true </property>
            <property name="hibernate.format_sql">true </property>
            <property name="hibernate.hbm2ddl.auto">create </property>
            
            <mapping/ resource="Students.hbm.xml">
            
        </session-factory>
    </hibernate-configuration>