當前位置: 首頁>>代碼示例>>Java>>正文


Java JpaEntityInformation類代碼示例

本文整理匯總了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);
}
 
開發者ID:MinBZK,項目名稱:OperatieBRP,代碼行數:19,代碼來源:CustomJpaRepositoryFactory.java

示例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;
}
 
開發者ID:lordlothar99,項目名稱:strategy-spring-security-acl,代碼行數:19,代碼來源:AclJpaRepositoryFactoryBean.java

示例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
}
 
開發者ID:pengqiuyuan,項目名稱:g2,代碼行數:10,代碼來源:DefaultRepositoryFactory.java

示例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);
}
 
開發者ID:onsoul,項目名稱:os,代碼行數:8,代碼來源:DefaultRepositoryFactory.java

示例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)));
}
 
開發者ID:Just-Fun,項目名稱:spring-data-examples,代碼行數:9,代碼來源:ApplicationConfigurationTest.java

示例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);
}
 
開發者ID:ZhongjunTian,項目名稱:spring-repository-plus,代碼行數:9,代碼來源:TestEntityRepositoryTest.java

示例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;
}
 
開發者ID:MinBZK,項目名稱:OperatieBRP,代碼行數:15,代碼來源:CustomSimpleMaxedJpaRepository.java

示例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;
}
 
開發者ID:MinBZK,項目名稱:OperatieBRP,代碼行數:15,代碼來源:CustomSimpleQuerycostJpaRepository.java

示例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;
}
 
開發者ID:slyak,項目名稱:spring-data-jpa-extra,代碼行數:10,代碼來源:RepoBasedConverter.java

示例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();
	}
}
 
開發者ID:slyak,項目名稱:spring-data-jpa-extra,代碼行數:12,代碼來源:GenericJpaRepositoryImpl.java

示例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);
}
 
開發者ID:Cosium,項目名稱:spring-data-jpa-entity-graph,代碼行數:8,代碼來源:EntityGraphQuerydslRepository.java

示例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);
}
 
開發者ID:TransparencyInternationalEU,項目名稱:lobbycal,代碼行數:8,代碼來源:CalendarDTRepositoryFactoryBean.java

示例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);
}
 
開發者ID:oncoblocks,項目名稱:centromere,代碼行數:8,代碼來源:CentromereJpaRepository.java

示例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);
}
 
開發者ID:u2ware,項目名稱:springfield,代碼行數:9,代碼來源:JpaRepository.java


注:本文中的org.springframework.data.jpa.repository.support.JpaEntityInformation類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。