-
Hello, I would like to use Discriminator strategy in Quarkus. But I didn't find a way to configure the Hibernate CurrentTenantIdentifierResolver.
It seems that the FastBootEntityManagerFactoryBuilder does not configure the CurrentTenantIdentifierResolver in case we just use @TenantID annotation without other properties. Is there some documentation ? or is it something not yet handled ? Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 9 replies
-
/cc @Sanne (hibernate-orm), @gsmet (hibernate-orm), @yrodiere (hibernate-orm) |
Beta Was this translation helpful? Give feedback.
-
Hello, I've found a workaround using quarkus.hibernate-orm.unsupported-properties :
The new issue is that in this way my TenantIdentifierResolver that use @requestScope does not have access to the RoutingContext.
and it produces : java.lang.NullPointerException: Cannot invoke "io.vertx.ext.web.RoutingContext.get(String)" because "this.context" is null. Any other way to do it ? do you thing it's a missing feature that should be reported and planned ? |
Beta Was this translation helpful? Give feedback.
-
@gsmet, @yrodiere , @Sanne do you think it could be because of FastBootEntityManagerFactoryBuilder :
and options.isMultiTenancyEnabled() just handle DATABASE and SCHEMA strategy ? |
Beta Was this translation helpful? Give feedback.
The multitenancy strategy (which is what this property is about) is deprecated. The concept no longer exists in Hibernate ORM.
I think eventually we'll just get rid of it and move schema/database multi-tenancy to the datasource (#11861), and will have to detect whether multi-tenancy is needed in ORM based on the datasource and the presence of
@TenantId
.That being said, the solution I suggested works for
FastBootEntityManagerFactoryBuilder
, but you can't use it inio.quarkus.hibernate.orm.deployment.HibernateOrmProcessor#multitenancy
. You don't have the metadata arou…