ORM是关系型数据库连接;ogm是No sql数据库连接,Mongo, redis等。
1,下载ogm zip包,解压到wildfly_home\modules\system\layers\base, ogm模块在org\hibernate\ogm下
2,下载orm zip,同样解压。新增版本是5.1
3,在文件\wildfly-10.0.0.Final\modules\system\layers\base\org\hibernate\ogm\5.1\module.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
时间: 2024-10-14 07:09:34