Skip to content
Snippets Groups Projects

Fix issue with DAO injection in some APIs where it fails to start

Merged Martin Lowe requested to merge malowe/main/1.0.0-release into main
4 files
+ 19
9
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -17,6 +17,7 @@ import jakarta.enterprise.context.ApplicationScoped;
@@ -17,6 +17,7 @@ import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.context.Dependent;
import jakarta.enterprise.context.Dependent;
import jakarta.inject.Singleton;
import jakarta.inject.Singleton;
 
import org.eclipsefoundation.persistence.config.EclipsePersistenceRuntimeConfig;
import org.eclipsefoundation.persistence.dao.impl.DefaultHibernateDao;
import org.eclipsefoundation.persistence.dao.impl.DefaultHibernateDao;
import org.eclipsefoundation.persistence.dao.impl.PlaceholderPersistenceDao;
import org.eclipsefoundation.persistence.dao.impl.PlaceholderPersistenceDao;
import org.eclipsefoundation.persistence.dao.impl.SecondaryAwareHibernateDao;
import org.eclipsefoundation.persistence.dao.impl.SecondaryAwareHibernateDao;
@@ -44,8 +45,8 @@ class QuarkusPersistenceProcessor {
@@ -44,8 +45,8 @@ class QuarkusPersistenceProcessor {
}
}
/**
/**
* Register the required CDI beans into the application to be created at runtime. Currently this is only the Hibernate
* Register the required CDI beans into the application to be created at runtime. Currently this is only the Hibernate DAO, but this may
* DAO, but this may be extended in the future.
* be extended in the future.
*
*
* @param beanProducer binding point to add additional CDI beans
* @param beanProducer binding point to add additional CDI beans
* @param domainObjects JPA model used by hibernate to enhance entity model objects.
* @param domainObjects JPA model used by hibernate to enhance entity model objects.
@@ -85,6 +86,13 @@ class QuarkusPersistenceProcessor {
@@ -85,6 +86,13 @@ class QuarkusPersistenceProcessor {
.addBeanClass(DistributedCSRFProvider.class)
.addBeanClass(DistributedCSRFProvider.class)
.setDefaultScope(DotName.createSimple(Dependent.class.getName()))
.setDefaultScope(DotName.createSimple(Dependent.class.getName()))
.build());
.build());
 
beanProducer
 
.produce(AdditionalBeanBuildItem
 
.builder()
 
.setUnremovable()
 
.addBeanClass(EclipsePersistenceRuntimeConfig.class)
 
.setDefaultScope(DotName.createSimple(Dependent.class.getName()))
 
.build());
beanProducer
beanProducer
.produce(AdditionalBeanBuildItem
.produce(AdditionalBeanBuildItem
.builder()
.builder()
@@ -108,8 +116,8 @@ class QuarkusPersistenceProcessor {
@@ -108,8 +116,8 @@ class QuarkusPersistenceProcessor {
}
}
/**
/**
* Marks the 2 node entity base classes as ignorable in the JPA entity scan by Hibernate ORM. Otherwise these entities
* Marks the 2 node entity base classes as ignorable in the JPA entity scan by Hibernate ORM. Otherwise these entities get detected as
* get detected as JPA entities improperly and cause build issues.
* JPA entities improperly and cause build issues.
*
*
* @return class index containing the abstract base entity classes.
* @return class index containing the abstract base entity classes.
*/
*/
Loading