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


Java RepositoryMetadata.getRepositoryInterface方法代碼示例

本文整理匯總了Java中org.springframework.data.repository.core.RepositoryMetadata.getRepositoryInterface方法的典型用法代碼示例。如果您正苦於以下問題:Java RepositoryMetadata.getRepositoryInterface方法的具體用法?Java RepositoryMetadata.getRepositoryInterface怎麽用?Java RepositoryMetadata.getRepositoryInterface使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.springframework.data.repository.core.RepositoryMetadata的用法示例。


在下文中一共展示了RepositoryMetadata.getRepositoryInterface方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getTargetRepository

import org.springframework.data.repository.core.RepositoryMetadata; //導入方法依賴的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: getExtensionFragments

import org.springframework.data.repository.core.RepositoryMetadata; //導入方法依賴的package包/類
public RepositoryFragments getExtensionFragments(RepositoryMetadata metadata) {
    Class<?> repositoryInterface = metadata.getRepositoryInterface();
    List<RepositoryFragment<?>> result = new ArrayList<>();

    Class<?> extensionInterface = getRepositoryExtensionInterface();

    for (Class<?> extendedInterface : repositoryInterface.getInterfaces()) {
        if (extensionInterface.isAssignableFrom(extendedInterface)) {
            result.add(createExtensionFragment(extendedInterface));
        }
    }

    if (result.isEmpty()) {
        return RepositoryFragments.empty();
    } else {
        return RepositoryFragments.from(result);
    }
}
 
開發者ID:snowdrop,項目名稱:spring-data-snowdrop,代碼行數:19,代碼來源:ExtendingRepositoryFactorySupport.java

示例3: getRepositoryBaseClass

import org.springframework.data.repository.core.RepositoryMetadata; //導入方法依賴的package包/類
protected Class<?> getRepositoryBaseClass(RepositoryMetadata metadata) {
  Class<?> repositoryInterface = metadata.getRepositoryInterface();
  if (QDataTablesRepository.class.isAssignableFrom(repositoryInterface)) {
    return QDataTablesRepositoryImpl.class;
  } else {
    return super.getRepositoryBaseClass(metadata);
  }

}
 
開發者ID:darrachequesne,項目名稱:spring-data-jpa-datatables,代碼行數:10,代碼來源:QDataTablesRepositoryFactoryBean.java

示例4: getRepositoryBaseClass

import org.springframework.data.repository.core.RepositoryMetadata; //導入方法依賴的package包/類
@Override
protected Class<?> getRepositoryBaseClass(RepositoryMetadata metadata) {
  Class<?> repositoryInterface = metadata.getRepositoryInterface();
  if (DataTablesRepository.class.isAssignableFrom(repositoryInterface)) {
    return DataTablesRepositoryImpl.class;
  } else {
    return super.getRepositoryBaseClass(metadata);
  }
}
 
開發者ID:darrachequesne,項目名稱:spring-data-jpa-datatables,代碼行數:10,代碼來源:DataTablesRepositoryFactoryBean.java

示例5: getRepostoryGenericInterfaces

import org.springframework.data.repository.core.RepositoryMetadata; //導入方法依賴的package包/類
private Type[] getRepostoryGenericInterfaces(final RepositoryMetadata metadata) {
    final Type[] repositoryGenericInterfaces = metadata.getRepositoryInterface().getGenericInterfaces();
    if (repositoryGenericInterfaces.length < 1) {
        throw new RuntimeException("Don't recognize " + metadata.getRepositoryInterface() + " as a Repository (does it extend " + Repository.class.getName() + "?)");
    }
    return repositoryGenericInterfaces;
}
 
開發者ID:jelford,項目名稱:richobjects,代碼行數:8,代碼來源:RichObjectRepositoryFactory.java

示例6: getTargetRepository

import org.springframework.data.repository.core.RepositoryMetadata; //導入方法依賴的package包/類
@Override
@SuppressWarnings({ "unchecked", "rawtypes" })
protected <T, ID extends Serializable> SimpleJpaRepository<?, ?> getTargetRepository(
        final RepositoryMetadata metadata, final EntityManager entityManager) {

    Class<?> repositoryInterface = metadata.getRepositoryInterface();

    JpaEntityInformation<?, Serializable> entityInformation = getEntityInformation(metadata.getDomainType());

    if (isQueryDslExecutor(repositoryInterface)) {
        return new QueryDslJpaRepository(entityInformation, entityManager);
    } else {
        return new GenericRepositoryImpl(entityInformation, entityManager, namedQueryUtil); // custom
    }
}
 
開發者ID:antoniomaria,項目名稱:gazpachoquest,代碼行數:16,代碼來源:DefaultRepositoryFactory.java

示例7: getEnableScanPermissions

import org.springframework.data.repository.core.RepositoryMetadata; //導入方法依賴的package包/類
protected EnableScanPermissions getEnableScanPermissions(RepositoryMetadata metadata) {
	return new EnableScanAnnotationPermissions(metadata.getRepositoryInterface());
}
 
開發者ID:michaellavelle,項目名稱:spring-data-dynamodb,代碼行數:4,代碼來源:DynamoDBRepositoryFactory.java


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