Hi
My persistence.xml is as shown below. When the project is deployed in the Wildfly version 8.2.0 the entities defined in the OGM datasource (puttputtmongoDS-JTA) are created in the ORM datasource (puttputtDS). I am not sharing entities between the datasources. I have also attached a sample entities in my project.
Appreciate any help to resolve this.
=====================Persistence.xml===================================
<?xml version="1.0" encoding="utf-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/ ... ce_1_0.xsd"
version="1.0">
<persistence-unit name="puttputtDS">
<jta-data-source>java:jboss/datasources/PuttputtDS</jta-data-source>
<class>dbteam.com.jsf.starter.model.Member</class>
<class>dbteam.com.jsf.starter.model.Country</class>
<properties>
<!-- Properties for Hibernate -->
<property name="hibernate.hbm2ddl.auto" value="create-drop" />
<!-- <property name="hibernate.hbm2ddl.auto" value="create" /> -->
<!--<property name="hibernate.hbm2ddl.auto" value="update" /> -->
<!-- <property name="hibernate.hbm2ddl.auto" value="validate" /> -->
<!-- <property name="hibernate.show_sql" value="true" /> -->
</properties>
</persistence-unit>
<persistence-unit name="puttputtmongoDS-JTA" transaction-type="JTA">
<provider>org.hibernate.ogm.jpa.HibernateOgmPersistence</provider>
<class>dbteam.com.jsf.starter.model.LineItem</class>
<class>dbteam.com.jsf.starter.model.Product</class>
<class>dbteam.com.jsf.starter.model.Quote</class>
<class>dbteam.com.jsf.starter.model.Image</class>
<class>dbteam.com.jsf.starter.model.Merchant</class>
<class>dbteam.com.jsf.starter.model.Promotions</class>
<properties>
<property name="hibernate.ogm.datastore.provider" value="mongodb" />
<property name="hibernate.ogm.datastore.database" value="hibernate-ogm-dbteam" />
<!--<property name="hibernate.ogm.datastore.create_database" value="true" /> -->
<property name="hibernate.ogm.datastore.host" value="entaap504u"/>
<property name="hibernate.ogm.datastore.port" value="27018"/>
</properties>
</persistence-unit>
</persistence>
=====================================Entity Class============
package dbteam.com.jsf.starter.model;
import java.math.BigDecimal;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.xml.bind.annotation.XmlRootElement;
@Entity
@XmlRootElement
public class Product {
@Id
private String id;
private String sku;
private String description;
private BigDecimal listPrice;
private Integer quantity;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getSku() {
return sku;
}
public void setSku(String sku) {
this.sku = sku;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public BigDecimal getListPrice() {
return listPrice;
}
public void setListPrice(BigDecimal listPrice) {
this.listPrice = listPrice;
}
public Integer getQuantity() {
return quantity;
}
public void setQuantity(Integer quantity) {
this.quantity = quantity;
}
}