Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
hibernate在创建sessionFactory时需要很长时间_Hibernate - Fatal编程技术网

hibernate在创建sessionFactory时需要很长时间

hibernate在创建sessionFactory时需要很长时间,hibernate,Hibernate,我已经写了一个简单的程序来保存一个对象。在hibernate中运行同样的结果会花费很长时间尝试创建会话工厂。下面是输出 5 [main] INFO org.hibernate.cfg.annotations.Version - Hibernate Annotations 3.5.2-Final 53 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.5.2-Final 61 [main] INFO org.hibernate.cfg.

我已经写了一个简单的程序来保存一个对象。在hibernate中运行同样的结果会花费很长时间尝试创建会话工厂。下面是输出

5 [main] INFO org.hibernate.cfg.annotations.Version - Hibernate Annotations 3.5.2-Final
53 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.5.2-Final
61 [main] INFO org.hibernate.cfg.Environment - hibernate.properties not found
73 [main] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
88 [main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
380 [main] INFO org.hibernate.annotations.common.Version - Hibernate Commons Annotations 3.2.0.Final
396 [main] INFO org.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml
396 [main] INFO org.hibernate.cfg.Configuration - Configuration resource: /hibernate.cfg.xml
650 [main] INFO org.hibernate.cfg.Configuration - Configured SessionFactory: null
664 [main] INFO org.hibernate.cfg.search.HibernateSearchEventListenerRegister - Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
890 [main] INFO org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: com.manyToMany.model.Dog
1007 [main] INFO org.hibernate.cfg.annotations.EntityBinder - Bind entity com.manyToMany.model.Dog on table DOG
1171 [main] INFO org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: com.manyToMany.model.Person
1172 [main] INFO org.hibernate.cfg.annotations.EntityBinder - Bind entity com.manyToMany.model.Person on table PERSON
1452 [main] INFO org.hibernate.cfg.AnnotationConfiguration - Hibernate Validator not found: ignoring
1471 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!)
1471 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 1
1472 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - autocommit mode: false
1488 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/blog
1488 [main] INFO org.hibernate.connection.DriverManagerConnectionProvider - connection properties: {user=kempa, password=****}
我的hibernate-cfg.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">com.mysql.jdbc.Driver</property>
        <property name="hibernate.connection.password"></property>
        <property name="hibernate.connection.url">jdbc:mysql://localhost/blog</property>
        <property name="hibernate.connection.username">kempa</property>
        <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
        <property name="connection.pool_size">1</property>
        <property name="show_sql">true</property>
        <property name="hbm2ddl.auto">create</property>

        <mapping class="com.manyToMany.model.Dog" />
        <mapping class="com.manyToMany.model.Person" />

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

com.mysql.jdbc.Driver
jdbc:mysql://localhost/blog
坎帕
org.hibernate.dialogue.mysqldialogue
1.
真的
创造

可能是因为您在初始化“hbm2ddl.auto”期间重新创建表需要更多的时间。。。