Skip to content
Snippets Groups Projects

Update the deployment to register the filter service as unremovable

1 file
+ 5
16
Compare changes
  • Side-by-side
  • Inline
@@ -8,6 +8,7 @@ import org.eclipsefoundation.persistence.dao.impl.DefaultHibernateDao;
import org.eclipsefoundation.persistence.dao.impl.PlaceholderPersistenceDao;
import org.eclipsefoundation.persistence.dto.BareNode;
import org.eclipsefoundation.persistence.dto.NodeBase;
import org.eclipsefoundation.persistence.service.impl.DefaultFilterService;
import io.quarkus.arc.deployment.AdditionalBeanBuildItem;
import io.quarkus.deployment.annotations.BuildProducer;
@@ -32,6 +33,10 @@ class QuarkusPersistenceProcessor {
void registerBeans(BuildProducer<AdditionalBeanBuildItem> beanProducer, JpaEntitiesBuildItem domainObjects,
List<NonJpaModelBuildItem> nonJpaModelBuildItems) {
// check if hibernate has been registered as an extension
beanProducer.produce(AdditionalBeanBuildItem.builder().setUnremovable()
.addBeanClass(ParameterizedSQLStatementBuilderConfiguration.class).build());
beanProducer.produce(AdditionalBeanBuildItem.builder().setUnremovable()
.addBeanClass(DefaultFilterService.class).build());
if (hasEntities(domainObjects, nonJpaModelBuildItems)) {
// register the Hibernate DAO
beanProducer.produce(
@@ -60,20 +65,4 @@ class QuarkusPersistenceProcessor {
return !jpaEntities.getEntityClassNames().isEmpty() || !nonJpaModels.isEmpty();
}
/**
* Register the required CDI beans into the application to be created at
* runtime. Currently this is only the Hibernate DAO, but this may be extended
* in the future.
*
* @param beanProducer binding point to add additional CDI beans
*/
@BuildStep
void registerBeans(BuildProducer<AdditionalBeanBuildItem> beanProducer) {
// register the configuration builder as unremovable. As this framework is meant
// to be implemented externally and not used internally, this harness would be
// removed in most cases
beanProducer.produce(AdditionalBeanBuildItem.builder().setUnremovable()
.addBeanClass(ParameterizedSQLStatementBuilderConfiguration.class).build());
}
}
Loading