zoukankan      html  css  js  c++  java
  • wildfly 10上使用最新的 Hibernate ORM OGM

    ORM是关系型数据库连接;ogm是No sql数据库连接,Mongo, redis等。

    1,下载ogm zip包,解压到wildfly_homemodulessystemlayersase, ogm模块在orghibernateogm下

    2,下载orm zip,同样解压。新增版本是5.1

    3,在文件wildfly-10.0.0.Finalmodulessystemlayersaseorghibernateogm5.1module.xml

    注释掉 <module name="org.hibernate.search.orm" slot="5.6.1.Final-orm51" optional="true" />

    要不总报找不到slot错误。

    ——————————————————————————————————

    ORM:

    http://docs.jboss.org/hibernate/orm/current/topical/html_single/wildfly/Wildfly.html

    persistence.xml

    <persistence-unit name="primary">
            <jta-data-source>java:jboss/datasources/MySqlDS</jta-data-source>
            <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>
            <class>com.italktv.colnv.stat.entity.Seat</class>
            <class>com.italktv.colnv.stat.entity.SeatType</class>
        
            <properties>
            <property name="jboss.as.jpa.providerModule" value="org.hibernate:5.1"/>
                <property name="hibernate.hbm2ddl.auto" value="update" />
                <!-- <property name= "hibernate.hbm2ddl.auto" value ="validate" /> create-drop -->
                <property name="hibernate.jdbc.fetch_size" value="500" />
                <property name="hibernate.jdbc.batch_size" value="500" />
                <property name="hibernate.show_sql" value="false" />
                <property name="hibernate.format_sql" value="true"></property>
                
            </properties>
        </persistence-unit>

    ————————————————————————————————————————

    4.5. How to package Hibernate OGM applications for WildFly 10

    https://docs.jboss.org/hibernate/stable/ogm/reference/en-US/html_single/?v=5.1#_configuring_hibernate_search

          <persistence-unit name="mongo-ogm" transaction-type="JTA">
          <provider>org.hibernate.ogm.jpa.HibernateOgmPersistence</provider>
        <class>xxx</class>
     
        <exclude-unlisted-classes>true</exclude-unlisted-classes>
        <properties>
        
          <property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform"/>
          <!--  <property name="hibernate.ogm.datastore.provider" value="mongodb" />-->
          <property name="hibernate.ogm.datastore.database" value="mongo_db"/>
          <property name="hibernate.ogm.datastore.host" value="xxxx.xx.xx.xx"/>
          <property name="hibernate.ogm.datastore.provider" value="MONGODB"/>
          <!-- 
                <property name="hibernate.ogm.datastore.username" value="db_user" />
                <property name="hibernate.ogm.datastore.password" value="top_secret!" />
                -->
        </properties>
      </persistence-unit>

    ——————————————————————————————————————————————

    https://www.cnblogs.com/coder-fang/p/6428454.html

  • 相关阅读:
    inux下tcpdump命令的使用
    git的命令行输出正确地显示中文文件名
    mysql权限修改记录
    Linux日常之以当前时间命名文件
    Linux 设置定时任务crontab命令
    (转)NodeJS
    (转)NodeJS收发GET和POST请求
    nodejs入门最简单例子
    「网易官方」极客战记(codecombat)攻略-游戏开发2-瓶颈-chokepoint
    「网易官方」极客战记(codecombat)攻略-游戏开发2-中心队形-center-formation
  • 原文地址:https://www.cnblogs.com/bigben0123/p/8004301.html
Copyright © 2011-2022 走看看