darrachequesne / spring-data-jpa-datatables

Spring Data JPA extension to work with the great jQuery plugin DataTables (https://datatables.net/)
Apache License 2.0
448 stars 172 forks source link

enable datatable repositories without using DatatablesJpaRepositoryBean #155

Closed KrunchMuffin closed 9 months ago

KrunchMuffin commented 9 months ago

One of our devs want to know "is it possible to enable datatable repositories without using DatatablesJpaRepositoryBean".

We also have envers and already have this set @EnableJpaRepositories(repositoryFactoryBeanClass = CustomEnversRevisionRepositoryFactoryBean.class)

darrachequesne commented 9 months ago

I don't think this is possible.

However, you should be able to restrict the scope of the factory with the basePackages option:

@Configuration
@EnableJpaRepositories(repositoryFactoryBeanClass = CustomEnversRevisionRepositoryFactoryBean.class, basePackages = "mypackage.envers")
public class EnversConfiguration {}

@Configuration
@EnableJpaRepositories(repositoryFactoryBeanClass = DataTablesRepositoryFactoryBean.class, basePackages = "mypackage.datatables")
public class DataTablesConfiguration {}