darrachequesne / spring-data-jpa-datatables

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

enable datatable repositories without using DatatablesJpaRepositoryBean #155

Closed KrunchMuffin closed 4 months ago

KrunchMuffin commented 4 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 4 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 {}