关于hibernater找不到表

来源:互联网 发布:阿里云 网站负责人 编辑:程序博客网 时间:2024/06/10 23:21

今天在将数据List 插入表中,发现报错,但是说没有table

我看看xml 配置是update

后来实在找不到错误,于是将那个文件放在oracle上面跑

但是,后来发现是<mapping>其他对文件的印象,我现在只留一个单个文件就可以跑

百度上我找了找,他说是方言,希望为你们带来解决方法

这是我的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">
    
<hibernate-configuration>
    <session-factory>
        <property name="hibernate.connection.driver_class">org.gjt.mm.mysql.Driver</property>
        <property name="hibernate.connection.password">root</property>
        <property name="hibernate.connection.url">jdbc:mysql://localhost/ssh</property>
        <property name="hibernate.connection.username">root</property>
        
        <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
        
         <property name="hibernate.c3p0.max_size">20</property>
        <property name="hibernate.c3p0.min_size">1</property>
        <property name="hibernate.c3p0.timeout">5000</property>        
        <property name="hibernate.c3p0.max_statements">100</property>
        <property name="hibernate.c3p0.idle_test_period">3000</property>
        <property name="hibernate.c3p0.acquire_increment">2</property>
        <property name="hibernate.c3p0.validate">true</property>
        
        <property name="hibernate.show_sql">true</property>
        <property name="hibernate.format_sql">true</property>
        <property name="hibernate.hbm2ddl.auto">update</property>    
        
        
        
        <mapping class="com.test.model.Person_Set_Map"/>

    </session-factory>
    
</hibernate-configuration>

---------------------------------------------------------------

这是之之前的xml,





        <?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-configuration>
    <session-factory>
        <property name="hibernate.connection.driver_class">org.gjt.mm.mysql.Driver</property>
        <property name="hibernate.connection.password">root</property>
        <property name="hibernate.connection.url">jdbc:mysql://localhost/ssh</property>
        <property name="hibernate.connection.username">root</property>
        
        <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
        
        
        <property name="hibernate.c3p0.max_size">20</property>
        <property name="hibernate.c3p0.min_size">1</property>
        <property name="hibernate.c3p0.timeout">5000</property>        
        <property name="hibernate.c3p0.max_statements">100</property>
        <property name="hibernate.c3p0.idle_test_period">3000</property>
        <property name="hibernate.c3p0.acquire_increment">2</property>
        <property name="hibernate.c3p0.validate">true</property>
     
        
        <property name="hibernate.show_sql">true</property>
        <property name="hibernate.format_sql">true</property>
        <property name="hibernate.hbm2ddl.auto">update</property>   <!-- 是否自动创建表格          update更新    create创造  -->
    
        
        <mapping class="com.test.model.User"/>
        <mapping class="com.test.model.News"/>
        <mapping class="com.test.model.TestGenerAated"/>
        <mapping class="com.test.model.EnumeratedTest"/>
        <mapping class="com.test.model.Person"/>        
        <mapping class="com.test.model.DateTest"/>   
        <mapping class="com.test.model.TableGenerator"/>
        <mapping class="com.test.model.UUIDTest"/>      
        <mapping class="com.test.model.Person_Set_Map"/>
    </session-factory>
</hibernate-configuration>



-----------------------------------------------


<mapping class="com.test.model.Person"/>   
这个mapping的错误,可能是名字重复,

0 0
原创粉丝点击