org.springframework.core.convert.converter.GenericConverter.ConvertiblePair#org.springframework.data.mapping.model.SimpleTypeHolder源码实例Demo

下面列出了org.springframework.core.convert.converter.GenericConverter.ConvertiblePair#org.springframework.data.mapping.model.SimpleTypeHolder 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。

源代码1 项目: sdn-rx   文件: DefaultNeo4jPersistentProperty.java
/**
 * Creates a new {@link AnnotationBasedPersistentProperty}.
 *
 * @param property         must not be {@literal null}.
 * @param owner            must not be {@literal null}.
 * @param simpleTypeHolder type holder
 */
DefaultNeo4jPersistentProperty(Property property,
	PersistentEntity<?, Neo4jPersistentProperty> owner,
	Neo4jMappingContext mappingContext,
	SimpleTypeHolder simpleTypeHolder) {

	super(property, owner, simpleTypeHolder);

	this.graphPropertyName = Lazy.of(this::computeGraphPropertyName);
	this.isAssociation = Lazy.of(() -> {

		Class<?> targetType = getActualType();
		return !(simpleTypeHolder.isSimpleType(targetType) || mappingContext.hasCustomWriteTarget(targetType));
	});
	this.mappingContext = mappingContext;
}
 
@Substitute
protected Target_AbstractMappingContext()  {
	this.persistentPropertyPathFactory = new PersistentPropertyPathFactory<E, P>((AbstractMappingContext)(Object)this);

	EntityInstantiators instantiators = new EntityInstantiators();
	Target_BeanWrapperPropertyAccessorFactory accessorFactory = Target_BeanWrapperPropertyAccessorFactory.INSTANCE;

	this.persistentPropertyAccessorFactory = new InstantiationAwarePropertyAccessorFactory(accessorFactory,
			instantiators);

	NONE = Optional.empty();
	persistentEntities = new HashMap<>();
	evaluationContextProvider = EvaluationContextProvider.DEFAULT;
	initialEntitySet = new HashSet<>();
	strict = false;
	simpleTypeHolder = SimpleTypeHolder.DEFAULT;
	lock = new ReentrantReadWriteLock();
	read = lock.readLock();
	write = lock.writeLock();
}
 
/**
 * Creates a new {@link AnnotationBasedPersistentProperty}.
 * @param property must not be {@literal null}.
 * @param owner must not be {@literal null}.
 */
public MybatisPersistentPropertyImpl(Property property,
		PersistentEntity<?, MybatisPersistentProperty> owner,
		SimpleTypeHolder simpleTypeHolder) {

	super(property, owner, simpleTypeHolder);

	this.isAssociation = Lazy.of(() -> ASSOCIATION_ANNOTATIONS.stream()
			.anyMatch(this::isAnnotationPresent));
	this.usePropertyAccess = detectPropertyAccess();
	this.associationTargetType = detectAssociationTargetType();
	this.updateable = detectUpdatability();

	this.isIdProperty = Lazy.of(
			() -> ID_ANNOTATIONS.stream().anyMatch(it -> isAnnotationPresent(it)));
	this.isEntity = Lazy.of(getActualType().isAnnotationPresent(Entity.class));
}
 
public SimpleCratePersistentProperty(Field field, PropertyDescriptor propertyDescriptor, 
									 PersistentEntity<?, CratePersistentProperty> owner, SimpleTypeHolder simpleTypeHolder) {
	super(field, propertyDescriptor, owner, simpleTypeHolder);
	
	this.fieldNamingStrategy = INSTANCE;

	String fieldName = getFieldName();
	
	if(RESERVED_ID_FIELD_NAME.equals(fieldName)) {				
		throw new MappingException(format(RESERVED_ID, fieldName, owner.getType()));
	}
	
	if(RESERVED_VESRION_FIELD_NAME.equals(fieldName)) {				
		throw new MappingException(format(RESERVED_VERSION, fieldName, owner.getType()));
	}
	
	if(startsWithIgnoreCase(fieldName, "_")) {
		throw new MappingException(format(STARTS_WITH_UNDERSCORE, fieldName, owner.getType()));
	}
}
 
源代码5 项目: spring-data-crate   文件: CustomConversions.java
/**
 * Create a new instance with a given list of converters.
 * @param converters the list of custom converters.
 */
public CustomConversions(final List<?> converters) {
  notNull(converters);

  readingPairs = new LinkedHashSet<>();
  writingPairs = new LinkedHashSet<>();
  customSimpleTypes = new HashSet<>();
  customReadTargetTypes = new ConcurrentHashMap<>();

  this.converters = new ArrayList<>();
  this.converters.addAll(converters);
  this.converters.add(LocaleToStringConverter.INSTANCE);
  this.converters.add(DateToLongConverter.INSTANCE);
  this.converters.add(LongToDateConverter.INSTANCE);
  
  for (Object converter : this.converters) {
    registerConversion(converter);
  }

  simpleTypeHolder = new SimpleTypeHolder(customSimpleTypes, HOLDER);
}
 
public DefaultArangoPersistentProperty(final Property property,
	final PersistentEntity<?, ArangoPersistentProperty> owner, final SimpleTypeHolder simpleTypeHolder,
	final FieldNamingStrategy fieldNamingStrategy) {
	super(property, owner, simpleTypeHolder);
	this.fieldNamingStrategy = fieldNamingStrategy != null ? fieldNamingStrategy
			: PropertyNameFieldNamingStrategy.INSTANCE;
}
 
源代码7 项目: spring-data   文件: ArangoMappingContext.java
@Override
protected ArangoPersistentProperty createPersistentProperty(
	final Property property,
	final DefaultArangoPersistentEntity<?> owner,
	final SimpleTypeHolder simpleTypeHolder) {
	return new DefaultArangoPersistentProperty(property, owner, simpleTypeHolder, fieldNamingStrategy);
}
 
源代码8 项目: dubbox   文件: CustomConversions.java
/**
 * Create new instance registering given converters
 *
 * @param converters
 */
@SuppressWarnings({ "unchecked", "rawtypes" })
public CustomConversions(List converters) {
	this.converters = (converters != null ? new ArrayList<Object>(converters) : new ArrayList<Object>());
	this.readingPairs = new HashSet<ConvertiblePair>();
	this.writingPairs = new HashSet<ConvertiblePair>();
	this.customSimpleTypes = new HashSet<Class<?>>();

	this.simpleTypeHolder = new SimpleTypeHolder(customSimpleTypes, SolrSimpleTypes.HOLDER);

	this.converters.add(GeoConverters.StringToPointConverter.INSTANCE);
	this.converters.add(GeoConverters.Point3DToStringConverter.INSTANCE);
	this.converters.add(new SolrjConverters.UpdateToSolrInputDocumentConverter());

	// Register Joda-Time converters only if Joda-Time was found in the
	// classpath.
	if (VersionUtil.isJodaTimeAvailable()) {
		this.converters.add(DateTimeConverters.DateToJodaDateTimeConverter.INSTANCE);
		this.converters.add(DateTimeConverters.JodaDateTimeToDateConverter.INSTANCE);
		this.converters.add(DateTimeConverters.DateToLocalDateTimeConverter.INSTANCE);
		this.converters.add(DateTimeConverters.JodaLocalDateTimeToDateConverter.INSTANCE);
	}

	for (Object converter : this.converters) {
		registerConversion(converter);
	}
}
 
/**
 * Constructor.
 *
 * @param property the property to store
 * @param owner the entity to which this property belongs
 * @param simpleTypeHolder the type holder
 * @param fieldNamingStrategy the naming strategy used to get the column name of this
 * property
 */
DatastorePersistentPropertyImpl(Property property,
		PersistentEntity<?, DatastorePersistentProperty> owner,
		SimpleTypeHolder simpleTypeHolder, FieldNamingStrategy fieldNamingStrategy) {
	super(property, owner, simpleTypeHolder);
	this.fieldNamingStrategy = (fieldNamingStrategy != null)
			? fieldNamingStrategy
			: PropertyNameFieldNamingStrategy.INSTANCE;
	verify();
}
 
源代码10 项目: sdn-rx   文件: Neo4jMappingContext.java
@Override
protected Neo4jPersistentProperty createPersistentProperty(Property property,
	Neo4jPersistentEntity<?> owner, SimpleTypeHolder simpleTypeHolder) {

	return new DefaultNeo4jPersistentProperty(property, owner, this, simpleTypeHolder);
}
 
源代码11 项目: dubbox   文件: SimpleSolrPersistentProperty.java
public SimpleSolrPersistentProperty(Field field, PropertyDescriptor propertyDescriptor,
		PersistentEntity<?, SolrPersistentProperty> owner, SimpleTypeHolder simpleTypeHolder) {
	super(field, propertyDescriptor, owner, simpleTypeHolder);
}
 
源代码12 项目: dubbox   文件: SimpleSolrMappingContext.java
@Override
protected SolrPersistentProperty createPersistentProperty(Field field, PropertyDescriptor descriptor,
		SimpleSolrPersistentEntity<?> owner, SimpleTypeHolder simpleTypeHolder) {
	return new SimpleSolrPersistentProperty(field, descriptor, owner, simpleTypeHolder);
}
 
@Override
public CosmosPersistentProperty createPersistentProperty(Property property,
                                                         BasicCosmosPersistentEntity<?> owner,
                                                         SimpleTypeHolder simpleTypeHolder) {
    return new BasicCosmosPersistentProperty(property, owner, simpleTypeHolder);
}
 
public BasicCosmosPersistentProperty(Property property, CosmosPersistentEntity<?> owner,
                                     SimpleTypeHolder simpleTypeHolder) {
    super(property, owner, simpleTypeHolder);
}
 
源代码15 项目: spring-cloud-gcp   文件: DatastoreMappingContext.java
@Override
protected DatastorePersistentProperty createPersistentProperty(Property property,
		DatastorePersistentEntity<?> owner, SimpleTypeHolder simpleTypeHolder) {
	return new DatastorePersistentPropertyImpl(property, owner, simpleTypeHolder,
			this.fieldNamingStrategy);
}
 
源代码16 项目: spring-cloud-gcp   文件: SpannerMappingContext.java
@Override
protected SpannerPersistentProperty createPersistentProperty(Property property,
		SpannerPersistentEntity<?> owner, SimpleTypeHolder simpleTypeHolder) {
	return new SpannerPersistentPropertyImpl(property, owner, simpleTypeHolder,
			this.fieldNamingStrategy);
}
 
源代码17 项目: spring-cloud-gcp   文件: FirestoreMappingContext.java
@Override
protected FirestorePersistentProperty createPersistentProperty(Property property,
		FirestorePersistentEntity<?> owner, SimpleTypeHolder simpleTypeHolder) {
	return new FirestorePersistentPropertyImpl(property, owner, simpleTypeHolder);
}
 
源代码18 项目: spring-vault   文件: VaultMappingContext.java
@Override
protected VaultPersistentProperty createPersistentProperty(Property property, VaultPersistentEntity<?> owner,
		SimpleTypeHolder simpleTypeHolder) {
	return new VaultPersistentProperty(property, owner, simpleTypeHolder);
}
 
@Override
protected MybatisPersistentProperty createPersistentProperty(Property property,
		MybatisPersistentEntityImpl<?> owner, SimpleTypeHolder simpleTypeHolder) {
	return new MybatisPersistentPropertyImpl(property, owner, simpleTypeHolder);
}
 
protected MybatisPersistentProperty createPersistentProperty(Property property,
		MybatisPersistentEntityImpl<?> owner, SimpleTypeHolder simpleTypeHolder) {
	return new MybatisPersistentPropertyImpl(property, owner, simpleTypeHolder);
}
 
@Override
protected MyPersistentProperty createPersistentProperty(Property property, MyPersistentEntity<?> owner,
		SimpleTypeHolder simpleTypeHolder) {
	return new MyPersistentProperty(property, owner, simpleTypeHolder);
}
 
MyPersistentProperty(Property property, PersistentEntity<?, MyPersistentProperty> owner,
		SimpleTypeHolder simpleTypeHolder) {
	super(property, owner, simpleTypeHolder);
}
 
源代码23 项目: spring-data-crate   文件: CrateMappingContext.java
@Override
protected CratePersistentProperty createPersistentProperty(Field field, PropertyDescriptor descriptor,
																   SimpleCratePersistentEntity<?> owner, SimpleTypeHolder simpleTypeHolder) {
	return new SimpleCratePersistentProperty(field, descriptor, owner, simpleTypeHolder);
}
 
public KeyValuePersistentProperty(Property property, PersistentEntity<?, P> owner,
		SimpleTypeHolder simpleTypeHolder) {
	super(property, owner, simpleTypeHolder);
}
 
@Override
@SuppressWarnings("unchecked")
protected P createPersistentProperty(Property property, E owner, SimpleTypeHolder simpleTypeHolder) {
	return (P) new KeyValuePersistentProperty<>(property, owner, simpleTypeHolder);
}
 
@Override
protected DynamoDBPersistentProperty createPersistentProperty(Field field, PropertyDescriptor descriptor,
		DynamoDBPersistentEntityImpl<?> owner, SimpleTypeHolder simpleTypeHolder) {
	return new DynamoDBPersistentPropertyImpl(field, descriptor, owner, simpleTypeHolder);

}
 
/**
 * Creates a new {@link SpannerPersistentPropertyImpl}.
 *
 * @param property the property to store
 * @param owner the entity to which this property belongs
 * @param simpleTypeHolder the type holder
 * @param fieldNamingStrategy the naming strategy used to get the column name of this
 * property
 */
SpannerPersistentPropertyImpl(Property property,
		PersistentEntity<?, SpannerPersistentProperty> owner,
		SimpleTypeHolder simpleTypeHolder, FieldNamingStrategy fieldNamingStrategy) {
	super(property, owner, simpleTypeHolder);
	this.fieldNamingStrategy = (fieldNamingStrategy != null)
			? fieldNamingStrategy
			: PropertyNameFieldNamingStrategy.INSTANCE;
}
 
/**
 * Constructor.
 *
 * @param property the property to store
 * @param owner the entity to which this property belongs
 * @param simpleTypeHolder the type holder
 */
FirestorePersistentPropertyImpl(Property property,
		PersistentEntity<?, FirestorePersistentProperty> owner,
		SimpleTypeHolder simpleTypeHolder) {
	super(property, owner, simpleTypeHolder);
}
 
源代码29 项目: spring-vault   文件: VaultPersistentProperty.java
/**
 * Create a new {@link VaultPersistentProperty}.
 * @param property must not be {@literal null}.
 * @param owner must not be {@literal null}.
 * @param simpleTypeHolder must not be {@literal null}.
 */
public VaultPersistentProperty(Property property, PersistentEntity<?, VaultPersistentProperty> owner,
		SimpleTypeHolder simpleTypeHolder) {

	super(property, owner, simpleTypeHolder);
}
 
源代码30 项目: spring-data-crate   文件: CustomConversions.java
/**
 * Returns the simple type holder.
 *
 * @return the simple type holder.
 */
public SimpleTypeHolder getSimpleTypeHolder() {
  return simpleTypeHolder;
}