Java 类org.springframework.data.jpa.repository.support.JpaMetamodelEntityInformation 实例源码

项目:spring-repository-plus    文件:TestEntityRepositoryTest.java   
@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);
}
项目:spring-cloud-samples    文件:BaseRepositoryImpl.java   
public BaseRepositoryImpl(Class<T> entityClass, EntityManager entityManager) {
    super(entityClass, entityManager);
    this.entityClass = entityClass;
    this.entityManager = entityManager;
    entityInformation = new JpaMetamodelEntityInformation<T, ID>(entityClass, entityManager.getMetamodel());
}
项目:sdcct    文件:SdcctRepositoryFactoryBean.java   
@Override
public <T, U extends Serializable> EntityInformation<T, U> getEntityInformation(Class<T> domainClass) {
    return new JpaMetamodelEntityInformation<>(domainClass, SdcctRepositoryFactoryBean.this.metamodel);
}