当前位置: 首页>>代码示例>>Java>>正文


Java EntityInformation类代码示例

本文整理汇总了Java中org.springframework.data.repository.core.EntityInformation的典型用法代码示例。如果您正苦于以下问题:Java EntityInformation类的具体用法?Java EntityInformation怎么用?Java EntityInformation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


EntityInformation类属于org.springframework.data.repository.core包,在下文中一共展示了EntityInformation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: convert

import org.springframework.data.repository.core.EntityInformation; //导入依赖的package包/类
@Override
        public Object convert(Object source, TypeDescriptor sourceType, TypeDescriptor targetType) {

            if (source == null || !StringUtils.hasText(source.toString())) {
                return null;
            }

//            if (sourceType.equals(targetType)) {
            if (isTypesEqual(sourceType, targetType)) {
                return source;
            }

            Class<?> domainType = sourceType.getType();

            EntityInformation<Object, ?> entityInformation = repositories.getEntityInformationFor(domainType);

            return conversionService.convert(entityInformation.getId(source), targetType.getType());
        }
 
开发者ID:imCodePartnerAB,项目名称:iVIS,代码行数:19,代码来源:IdToDomainClassConverter.java

示例2: BaseJdbcRepository

import org.springframework.data.repository.core.EntityInformation; //导入依赖的package包/类
public BaseJdbcRepository(EntityInformation<T, ID> entityInformation, RowMapper<T> rowMapper,
                          RowUnmapper<T> rowUnmapper, TableDescription table) {
    Assert.notNull(rowMapper);
    Assert.notNull(table);

    this.entityInfo = entityInformation != null ? entityInformation : createEntityInformation();
    this.rowUnmapper = rowUnmapper != null ? rowUnmapper : new UnsupportedRowUnmapper<T>();
    this.rowMapper = rowMapper;
    this.table = table;
}
 
开发者ID:rubasace,项目名称:spring-data-jdbc,代码行数:11,代码来源:BaseJdbcRepository.java

示例3: createEntityInformation

import org.springframework.data.repository.core.EntityInformation; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private EntityInformation<T, ID> createEntityInformation() {

    Class<T> entityType = (Class<T>) GenericTypeResolver.resolveTypeArguments(getClass(),
                                                                              JdbcRepository.class)[0];

    return createEntityInformation(entityType);
}
 
开发者ID:rubasace,项目名称:spring-data-jdbc,代码行数:9,代码来源:BaseJdbcRepository.java

示例4: chooseStrategy

import org.springframework.data.repository.core.EntityInformation; //导入依赖的package包/类
public static <T, ID extends Serializable> AbstractRepositoryStrategy chooseStrategy(EntityInformation<T, ID> entityInformation) {
    switch (EntityUtils.getEntityType(entityInformation)) {
        case AUTO_INCREMENTAL:
            return new AutoIncrementRepositoryStrategy(entityInformation);
        case MANUALLY_ASSIGNED:
            return new ManuallyAssignedRepositoryStrategy(entityInformation);
        case READ_ONLY:
            return new ReadOnlyRepositoryStrategy(entityInformation);
        default:
            throw new IllegalArgumentException("Don't know what strategy to instantiate");
    }

}
 
开发者ID:rubasace,项目名称:spring-data-jdbc,代码行数:14,代码来源:RepositoryStrategyFactory.java

示例5: getEntityInformation

import org.springframework.data.repository.core.EntityInformation; //导入依赖的package包/类
@Override
public <T, ID extends Serializable> EntityInformation<T, ID> getEntityInformation(Class<T> domainClass) {
    TarantoolPersistentEntity<T> entity = ((TarantoolPersistentEntity<T>) keyValueOperations
            .getMappingContext()
            .getPersistentEntity(domainClass));
    EntityInformation<T, ID> entityInformation = (EntityInformation<T, ID>) new MappingTarantoolEntityInformation<T>(entity);
    return entityInformation;
}
 
开发者ID:saladinkzn,项目名称:spring-data-tarantool,代码行数:9,代码来源:TarantoolRepositoryFactory.java

示例6: getEntityInformation

import org.springframework.data.repository.core.EntityInformation; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public <T, ID extends Serializable> EntityInformation<T, ID> getEntityInformation(Class<T> domainClass) {
	
	MongoPersistentEntity<T> persistentEntity = (MongoPersistentEntity<T>) mappingContext.getPersistentEntity(domainClass);
	return new MappingMongoEntityInformation<>(persistentEntity, config);
}
 
开发者ID:wesley-ramos,项目名称:spring-multitenancy,代码行数:8,代码来源:MongoRepositoryFactory.java

示例7: SimpleGcloudDatastoreRepository

import org.springframework.data.repository.core.EntityInformation; //导入依赖的package包/类
public SimpleGcloudDatastoreRepository(EntityInformation<T, ID> entityInformation,
		DatastoreOptions datastoreOptions) {

	Assert.notNull(entityInformation, "EntityInformation must not be null!");

	this.entityInformation = entityInformation;
	this.kind = entityInformation.getJavaType().getSimpleName();
	this.datastoreOptions = datastoreOptions;
}
 
开发者ID:tkob,项目名称:spring-data-gclouddatastore,代码行数:10,代码来源:SimpleGcloudDatastoreRepository.java

示例8: getTargetRepository

import org.springframework.data.repository.core.EntityInformation; //导入依赖的package包/类
@Override
protected Object getTargetRepository(RepositoryInformation information) {
	EntityInformation<?, Serializable> entityInformation = getEntityInformation(
			information.getDomainType());
	return getTargetRepositoryViaReflection(information, entityInformation,
			this.datastoreOptions);
}
 
开发者ID:tkob,项目名称:spring-data-gclouddatastore,代码行数:8,代码来源:GcloudDatastoreRepositoryFactory.java

示例9: SimpleObjectifyRepository

import org.springframework.data.repository.core.EntityInformation; //导入依赖的package包/类
public SimpleObjectifyRepository(EntityInformation<T, ID> metadata) {
    this.metadata = metadata;
    
    Class<ID> idType = metadata.getIdType();
    if ((idType != String.class) && (idType != Long.class)){
        throw new RuntimeException("Id Type must be String or Long");
    }
}
 
开发者ID:nhuttrung,项目名称:spring-data-objectify,代码行数:9,代码来源:SimpleObjectifyRepository.java

示例10: getEntityInformation

import org.springframework.data.repository.core.EntityInformation; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public <T, ID> EntityInformation<T, ID> getEntityInformation(Class<T> domainClass) {

	VaultPersistentEntity<T> entity = (VaultPersistentEntity<T>) operations
			.getMappingContext().getPersistentEntity(domainClass);

	return new MappingVaultEntityInformation<>(entity);
}
 
开发者ID:spring-projects,项目名称:spring-vault,代码行数:10,代码来源:VaultRepositoryFactory.java

示例11: getEntityInformation

import org.springframework.data.repository.core.EntityInformation; //导入依赖的package包/类
/** {@inheritDoc} */
@Override public <T, ID extends Serializable> EntityInformation<T, ID> getEntityInformation(Class<T> domainClass) {
    return new AbstractEntityInformation<T, ID>(domainClass) {
        @Override public ID getId(T entity) {
            return null;
        }

        @Override public Class<ID> getIdType() {
            return null;
        }
    };
}
 
开发者ID:apache,项目名称:ignite,代码行数:13,代码来源:IgniteRepositoryFactory.java

示例12: SimpleKeyValueRepository

import org.springframework.data.repository.core.EntityInformation; //导入依赖的package包/类
/**
 * Creates a new {@link SimpleKeyValueRepository} for the given {@link EntityInformation} and
 * {@link KeyValueOperations}.
 *
 * @param metadata must not be {@literal null}.
 * @param operations must not be {@literal null}.
 */
public SimpleKeyValueRepository(EntityInformation<T, ID> metadata, KeyValueOperations operations) {

	Assert.notNull(metadata, "EntityInformation must not be null!");
	Assert.notNull(operations, "KeyValueOperations must not be null!");

	this.entityInformation = metadata;
	this.operations = operations;
}
 
开发者ID:spring-projects,项目名称:spring-data-keyvalue,代码行数:16,代码来源:SimpleKeyValueRepository.java

示例13: QuerydslKeyValueRepository

import org.springframework.data.repository.core.EntityInformation; //导入依赖的package包/类
/**
 * Creates a new {@link QuerydslKeyValueRepository} for the given {@link EntityInformation},
 * {@link KeyValueOperations} and {@link EntityPathResolver}.
 *
 * @param entityInformation must not be {@literal null}.
 * @param operations must not be {@literal null}.
 * @param resolver must not be {@literal null}.
 */
public QuerydslKeyValueRepository(EntityInformation<T, ID> entityInformation, KeyValueOperations operations,
		EntityPathResolver resolver) {

	super(entityInformation, operations);

	Assert.notNull(resolver, "EntityPathResolver must not be null!");

	EntityPath<T> path = resolver.createPath(entityInformation.getJavaType());
	this.builder = new PathBuilder<>(path.getType(), path.getMetadata());
}
 
开发者ID:spring-projects,项目名称:spring-data-keyvalue,代码行数:19,代码来源:QuerydslKeyValueRepository.java

示例14: getEntityInformation

import org.springframework.data.repository.core.EntityInformation; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public <T, ID> EntityInformation<T, ID> getEntityInformation(Class<T> domainClass) {

	PersistentEntity<T, ?> entity = (PersistentEntity<T, ?>) context.getRequiredPersistentEntity(domainClass);

	return new PersistentEntityInformation<>(entity);
}
 
开发者ID:spring-projects,项目名称:spring-data-keyvalue,代码行数:9,代码来源:KeyValueRepositoryFactory.java

示例15: getEntityInfo

import org.springframework.data.repository.core.EntityInformation; //导入依赖的package包/类
protected EntityInformation<T, ID> getEntityInfo() {
    return entityInfo;
}
 
开发者ID:rubasace,项目名称:spring-data-jdbc,代码行数:4,代码来源:BaseJdbcRepository.java


注:本文中的org.springframework.data.repository.core.EntityInformation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。