Search in sources :

Example 1 with UnitOfWorkAwareProxyFactory

use of io.dropwizard.hibernate.UnitOfWorkAwareProxyFactory in project cals-api by ca-cwds.

the class CalsApiApplication method applicationModule.

@Override
public Module applicationModule(Bootstrap<CalsApiConfiguration> bootstrap) {
    return new ApplicationModule<CalsApiConfiguration>(bootstrap) {

        @Override
        protected void configure() {
            super.configure();
            install(new DataAccessModule(bootstrap) {

                @Provides
                UnitOfWorkAwareProxyFactory provideUnitOfWorkAwareProxyFactory() {
                    return new UnitOfWorkAwareProxyFactory(getLisHibernateBundle(), getFasHibernateBundle(), getCmsHibernateBundle(), getCalsnsHibernateBundle(), getXaCmsHibernateBundle(), getXaCalsnsHibernateBundle());
                }
            });
            install(new SecurityModule(BaseApiApplication::getInjector).addAuthorizer(Authorize.PLACEMENT_HOME_CREATE, PlacementHomeCreateAuthorizer.class).addAuthorizer(Authorize.SUBSTITUTE_CARE_PROVIDER_CREATE, SubstituteCareProviderCreateAuthorizer.class).addAuthorizer(CLIENT_RESULT_READ, ClientResultReadAuthorizer.class).addStaticAuthorizer(FacilityReadStaticAuthorizer.class));
        }
    };
}
Also used : DataAccessModule(gov.ca.cwds.cals.inject.DataAccessModule) SubstituteCareProviderCreateAuthorizer(gov.ca.cwds.authorizer.SubstituteCareProviderCreateAuthorizer) UnitOfWorkAwareProxyFactory(io.dropwizard.hibernate.UnitOfWorkAwareProxyFactory) FacilityReadStaticAuthorizer(gov.ca.cwds.authorizer.FacilityReadStaticAuthorizer) Provides(com.google.inject.Provides) ApplicationModule(gov.ca.cwds.cals.inject.ApplicationModule) SecurityModule(gov.ca.cwds.security.module.SecurityModule)

Aggregations

Provides (com.google.inject.Provides)1 FacilityReadStaticAuthorizer (gov.ca.cwds.authorizer.FacilityReadStaticAuthorizer)1 SubstituteCareProviderCreateAuthorizer (gov.ca.cwds.authorizer.SubstituteCareProviderCreateAuthorizer)1 ApplicationModule (gov.ca.cwds.cals.inject.ApplicationModule)1 DataAccessModule (gov.ca.cwds.cals.inject.DataAccessModule)1 SecurityModule (gov.ca.cwds.security.module.SecurityModule)1 UnitOfWorkAwareProxyFactory (io.dropwizard.hibernate.UnitOfWorkAwareProxyFactory)1