本文整理匯總了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);
}
示例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);
}
}
示例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;
}
示例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
}
}
示例7: getEnableScanPermissions
import org.springframework.data.repository.core.RepositoryMetadata; //導入方法依賴的package包/類
protected EnableScanPermissions getEnableScanPermissions(RepositoryMetadata metadata) {
return new EnableScanAnnotationPermissions(metadata.getRepositoryInterface());
}