Skip to content

Instantly share code, notes, and snippets.

@gtudan
Created August 8, 2017 17:29
Show Gist options
  • Save gtudan/454bd83a2f300797b76e90a78b94982f to your computer and use it in GitHub Desktop.
Save gtudan/454bd83a2f300797b76e90a78b94982f to your computer and use it in GitHub Desktop.
<persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd"
version="2.1">
<persistence-unit name="multitenant" transaction-type="JTA">
<jta-data-source>java:jboss/datasources/multitenant</jta-data-source>
<class>de.cofinpro.multitenant.User</class>
<properties>
<!-- Provider specific multi tenancy config -->
<property name="hibernate.multiTenancy" value="SCHEMA"/>
<property name="hibernate.multi_tenant_connection_provider"
value="de.cofinpro.multitenant.hibernate.TenantConnectionProvider"/>
<property name="hibernate.tenant_identifier_resolver"
value="de.cofinpro.multitenant.hibernate.CurrentTenantResolver"/>
<property name="hibernate.show_sql" value="true"/>
<!-- schema generation is not supported in multi-tenant environments -->
<property name="javax.persistence.schema-generation.database.action" value="none"/>
</properties>
</persistence-unit>
</persistence>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment