Community
Participate
Working Groups
Build Identifier: Multi-tenant entities cannot be queried across tenants for example for doing administration or statistics. Possible solutions: * There should be possible to set a query hint to allow the extra criteria not to be appended at runtime. * Allow null as tenant-id to disable the functionality Reproducible: Always Steps to Reproduce: 1. Mark an entity with @Multitenant and @TenantDiscriminator 2. Create a few entities with different tenants 3. Attempt to query for all of them, for example a count to know the total number of entities to show statistics. Only the count for the current tenant-id is shown.
I other people with the same problems: http://old.nabble.com/Re%3A-Suggestions-for-approaches-to-security-and-queries--p32068946.html Can you provide any hints on a work-around or where to start looking to create a patch? This issue is a real show-stopper for us, so I would be grateful for any help! Thanks
The way to do this currently is to define a new persistence unit with all the same model classes minus the @Multitenant metadata.
Converting to Enhancement. The enhancement is to provide a means to query without the tenant criteria without duplicating the persistence unit.
See: http://wiki.eclipse.org/EclipseLink/DesignDocs/Multi-Tenancy#Open.2FFuture_items
I want to use my Multi-Tenant solution without removing/changing annotation or XMl configuration for all entities. In short, even my entities are annotated with @Multi-Tenant and @TenantDiscriminator annotation, but at all even, I do not set PersistenceUnitProperties.MULTITENANT_PROPERTY_DEFAULT then It should just ignore to add TENANT_ID as an additional criteria instead of throwing below exception. javax.persistence.PersistenceException: Exception [EclipseLink-6174] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.QueryException Exception Description: No value was provided for the session property [eclipselink.tenant-id]. This exception is possible when using additional criteria or tenant discriminator columns without specifying the associated contextual property. These properties must be set through Entity Manager, Entity Manager Factory or persistence unit properties. If using native EclipseLink, these properties should be set directly on the session. For more information, please refer http://stackoverflow.com/questions/22562770/eclipselink-how-to-turn-off-multi-tenancy-even-if-i-annotate-entity-with-multi/22597988 Ketan Prajapati
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink