Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/batch-file/6.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 mongodb配置文件_Mongodb_Hibernate - Fatal编程技术网

Hibernate mongodb配置文件

Hibernate mongodb配置文件,mongodb,hibernate,Mongodb,Hibernate,首先,我认为你的配置是错误的。您使用的比例应该放在persistence.xml文件中。例子是 具有描述的必要属性包括 <hibernate-configuration> <session-factory> <!-- Database connection settings --> <property name="hibernate.ogm.datastore.provider">mongodb</

首先,我认为你的配置是错误的。您使用的比例应该放在persistence.xml文件中。例子是

具有描述的必要属性包括

<hibernate-configuration>

    <session-factory>

        <!-- Database connection settings -->
        <property name="hibernate.ogm.datastore.provider">mongodb</property>
        <property name="hibernate.ogm.datastore.host">127.0.0.1</property>
        <property name="hibernate.ogm.datastore.port">27017</property>
        <property name="hibernate.ogm.datastore.database">eatery</property>
        <property name="hibernate.ogm.datastore.create_database">true</property>


        <mapping class="com.ws.web.models.Reservation" />

    </session-factory>

</hibernate-configuration>
Exception in thread "main" org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set
    at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.determineDialect(DialectFactoryImpl.java:104)
    at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:71)
    at org.hibernate.engine.jdbc.internal.JdbcServicesImpl.configure(JdbcServicesImpl.java:209)
    at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.configureService(StandardServiceRegistryImpl.java:111)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:234)
    at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:206)
    at org.hibernate.cfg.Configuration.buildTypeRegistrations(Configuration.java:1887)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1845)
    at com.ws.web.models.Test.main(Test.java:17)