@Before public void setup(){ JpaEntityInformation<TestEntity, Integer> information = new JpaMetamodelEntityInformation<>( TestEntity.class, em.getMetamodel()); repository = new SimpleJpaRepository<>(information, em); entities = SpecificationBuilder.selectDistinctFrom(repository).where(new Filter("string",EQUAL,"a")).findAll(); Assert.assertTrue(entities.size() >= 1); }
public BaseRepositoryImpl(Class<T> entityClass, EntityManager entityManager) { super(entityClass, entityManager); this.entityClass = entityClass; this.entityManager = entityManager; entityInformation = new JpaMetamodelEntityInformation<T, ID>(entityClass, entityManager.getMetamodel()); }
@Override public <T, U extends Serializable> EntityInformation<T, U> getEntityInformation(Class<T> domainClass) { return new JpaMetamodelEntityInformation<>(domainClass, SdcctRepositoryFactoryBean.this.metamodel); }