本文整理匯總了Java中org.springframework.data.jpa.repository.support.JpaEntityInformation類的典型用法代碼示例。如果您正苦於以下問題:Java JpaEntityInformation類的具體用法?Java JpaEntityInformation怎麽用?Java JpaEntityInformation使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
JpaEntityInformation類屬於org.springframework.data.jpa.repository.support包,在下文中一共展示了JpaEntityInformation類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getTargetRepository
import org.springframework.data.jpa.repository.support.JpaEntityInformation; //導入依賴的package包/類
@Override
@SuppressWarnings({"unchecked", "rawtypes"})
protected SimpleJpaRepository<?, ?> getTargetRepository(
final RepositoryMetadata metadata,
final EntityManager entityManager) {
final Class<?> repositoryInterface = metadata.getRepositoryInterface();
final JpaEntityInformation<?, Serializable> entityInformation = getEntityInformation(metadata.getDomainType());
if (isQueryDslSpecificExecutor(repositoryInterface)) {
throw new IllegalArgumentException("QueryDSL interface niet toegestaan");
}
return isMaxedRepository(repositoryInterface)
? new CustomSimpleMaxedJpaRepository(entityInformation, entityManager)
: isQuerycostRepository(repositoryInterface)
? new CustomSimpleQuerycostJpaRepository(entityInformation, entityManager, maxCostsQueryPlan)
: new CustomSimpleJpaRepository(entityInformation, entityManager);
}
示例2: getTargetRepository
import org.springframework.data.jpa.repository.support.JpaEntityInformation; //導入依賴的package包/類
protected SimpleJpaRepository<?, ?> getTargetRepository(RepositoryInformation information,
EntityManager entityManager) {
Class<?> domainType = information.getDomainType();
if (!hasAclStrategyAnnotation(domainType)) {
return super.getTargetRepository(information, entityManager);
}
JpaEntityInformation<?, Serializable> entityInformation = getEntityInformation(domainType);
// invokes
// com.github.lothar.security.acl.jpa.repository.AclJpaRepository.AclJpaRepository(JpaEntityInformation<T,
// ?>, EntityManager, JpaSpecProvider<T>)
SimpleJpaRepository<?, ?> repository = getTargetRepositoryViaReflection(information,
entityInformation, entityManager, jpaSpecProvider);
logger.debug("Created {}", repository);
return repository;
}
示例3: getTargetRepository
import org.springframework.data.jpa.repository.support.JpaEntityInformation; //導入依賴的package包/類
@Override
protected <T, ID extends Serializable> JpaRepository<?, ?> getTargetRepository(
RepositoryMetadata metadata, EntityManager entityManager) {
JpaEntityInformation<?, Serializable> entityInformation = getEntityInformation(metadata
.getDomainType());
return new GenericRepositoryImpl(entityInformation, entityManager); // custom
// implementation
}
示例4: getTargetRepository
import org.springframework.data.jpa.repository.support.JpaEntityInformation; //導入依賴的package包/類
@SuppressWarnings({ "rawtypes", "unchecked" })
@Override
protected <T, ID extends Serializable> SimpleJpaRepository<?, ?> getTargetRepository(
RepositoryInformation information, EntityManager entityManager) {
JpaEntityInformation<?, Serializable> entityInformation = getEntityInformation(information.getDomainType());
return new GenericRepositoryImpl(entityInformation, entityManager);
}
示例5: repositoriesAreAssignedToAppropriateStores
import org.springframework.data.jpa.repository.support.JpaEntityInformation; //導入依賴的package包/類
@Test
public void repositoriesAreAssignedToAppropriateStores() {
Repositories repositories = new Repositories(context);
assertThat(repositories.getEntityInformationFor(Customer.class), is(instanceOf(JpaEntityInformation.class)));
assertThat(repositories.getEntityInformationFor(Order.class), is(instanceOf(MongoEntityInformation.class)));
}
示例6: SimpleExtendedQueryDslJpaRepository
import org.springframework.data.jpa.repository.support.JpaEntityInformation; //導入依賴的package包/類
SimpleExtendedQueryDslJpaRepository(JpaEntityInformation<T, ID> entityInformation,
EntityManager entityManager) throws SQLException {
super(entityInformation, entityManager, SimpleEntityPathResolver.INSTANCE);
this.jpaQueryFactory = new JPAQueryFactory(HQLTemplates.DEFAULT, entityManager);
this.path = SimpleEntityPathResolver.INSTANCE.createPath(entityInformation.getJavaType());
SQLTemplates sqlTemplates = getSQLServerTemplates(entityManager.getEntityManagerFactory());
this.jpaSqlFactory = () -> new JPASQLQuery<>(entityManager, sqlTemplates);
this.entityManager = entityManager;
}
開發者ID:infobip,項目名稱:infobip-spring-data-jpa-querydsl,代碼行數:10,代碼來源:SimpleExtendedQueryDslJpaRepository.java
示例7: setup
import org.springframework.data.jpa.repository.support.JpaEntityInformation; //導入依賴的package包/類
@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);
}
示例8: CustomSimpleMaxedJpaRepository
import org.springframework.data.jpa.repository.support.JpaEntityInformation; //導入依賴的package包/類
/**
* Creates a new {@link CustomSimpleMaxedJpaRepository} to manage objects of the given {@link JpaEntityInformation}.
* @param entityInformation must not be {@literal null}.
* @param entityManager must not be {@literal null}.
* @param maximumRecords maximum aantal records
*/
public CustomSimpleMaxedJpaRepository(
final JpaEntityInformation<T, ?> entityInformation,
final EntityManager entityManager,
final int maximumRecords) {
super(entityInformation, entityManager);
em = entityManager;
this.maximumRecords = maximumRecords;
}
示例9: CustomSimpleQuerycostJpaRepository
import org.springframework.data.jpa.repository.support.JpaEntityInformation; //導入依賴的package包/類
/**
* Creates a new {@link CustomSimpleQuerycostJpaRepository} to manage objects of the given {@link JpaEntityInformation}.
* @param entityInformation must not be {@literal null}.
* @param entityManager must not be {@literal null}.
* @param maxCostsQueryPlan maximum cost of a query plan
*/
CustomSimpleQuerycostJpaRepository(
final JpaEntityInformation<T, ?> entityInformation,
final EntityManager entityManager,
final int maxCostsQueryPlan) {
super(entityInformation, entityManager);
this.em = entityManager;
this.maxCostsQueryPlan = maxCostsQueryPlan;
}
示例10: setApplicationContext
import org.springframework.data.jpa.repository.support.JpaEntityInformation; //導入依賴的package包/類
@Override
public void setApplicationContext(ApplicationContext context) throws BeansException {
Class<?>[] classes = GenericTypeResolver.resolveTypeArguments(this.getClass(), RepoBasedConverter.class);
Class<?> clazz = classes[0];
this.repositories = new Repositories(context);
this.entityInformation = (JpaEntityInformation<S, ID>) repositories.getEntityInformationFor(clazz);
this.genericJpaRepository = (GenericJpaRepository<S, ID>) repositories.getRepositoryFor(clazz);
this.useCache = genericJpaRepository instanceof CachingJpaRepository;
}
示例11: GenericJpaRepositoryImpl
import org.springframework.data.jpa.repository.support.JpaEntityInformation; //導入依賴的package包/類
public GenericJpaRepositoryImpl(JpaEntityInformation<T, ID> eif, EntityManager em) {
super(eif, em);
this.em = em;
this.eif = eif;
PropertyDescriptor descriptor = findFieldPropertyDescriptor(eif.getJavaType(), Status.class);
isStatusAble = descriptor != null;
if (isStatusAble) {
statusReadMethod = descriptor.getReadMethod();
statusWriteMethod = descriptor.getWriteMethod();
}
}
示例12: EntityGraphQuerydslRepository
import org.springframework.data.jpa.repository.support.JpaEntityInformation; //導入依賴的package包/類
public EntityGraphQuerydslRepository(
JpaEntityInformation<T, ?> entityInformation, EntityManager entityManager) {
super(entityInformation, entityManager);
this.querydslJpaRepositoryDelegate =
new EntityGraphAwareQuerydslJpaRepository<>(
(JpaEntityInformation<T, ID>) entityInformation, entityManager);
}
示例13: getTargetRepository
import org.springframework.data.jpa.repository.support.JpaEntityInformation; //導入依賴的package包/類
@SuppressWarnings({ "unchecked" })
protected Object getTargetRepository(RepositoryMetadata metadata) {
JpaEntityInformation<T, Serializable> entityInformation = (JpaEntityInformation<T, Serializable>) getEntityInformation(metadata
.getDomainType());
return new CalendarDTRepositoryImpl<T, ID>(entityInformation,
entityManager);
}
示例14: CentromereJpaRepository
import org.springframework.data.jpa.repository.support.JpaEntityInformation; //導入依賴的package包/類
public CentromereJpaRepository(JpaEntityInformation<T, ID> entityInformation,
EntityManager entityManager) {
super(entityInformation, entityManager);
this.metadata = entityInformation;
this.entityManager = entityManager;
this.queryBuilder = new JpaQueryBuilder<>(entityManager);
}
示例15: JpaRepository
import org.springframework.data.jpa.repository.support.JpaEntityInformation; //導入依賴的package包/類
private JpaRepository(JpaEntityInformation<T, ID> info, EntityManager em) {
//this.entityClass = info.getJavaType();
this.entityInformation = info;
this.entityManager = em;
this.template = new SimpleJpaRepository<T, ID>(info, em);
this.queryDslExecutor = new JpaQueryDslExecutor<T>(info.getJavaType(), em);
}