Examples of SimpleTypeHolder


Examples of org.springframework.data.mapping.model.SimpleTypeHolder

   * reset the context to use the default {@link SimpleTypeHolder}.
   *
   * @param simpleTypes
   */
  public void setSimpleTypeHolder(SimpleTypeHolder simpleTypes) {
    this.simpleTypeHolder = simpleTypes == null ? new SimpleTypeHolder() : simpleTypes;
  }
View Full Code Here

Examples of org.springframework.data.mapping.model.SimpleTypeHolder

    for (Object converter : this.converters) {
      registerConversion(converter);
    }

    simpleTypeHolder = new SimpleTypeHolder();
  }
View Full Code Here

Examples of org.springframework.data.mapping.model.SimpleTypeHolder

   * @param field the field to retrieve the properties from.
   * @return the actual BasicCouchbasePersistentProperty instance.
   */
  private CouchbasePersistentProperty getPropertyFor(Field field) {
    return new BasicCouchbasePersistentProperty(field, null, entity,
      new SimpleTypeHolder(), PropertyNameFieldNamingStrategy.INSTANCE);
  }
View Full Code Here

Examples of org.springframework.data.mapping.model.SimpleTypeHolder

    payload = initialPayload;

    Set<Class<?>> additionalTypes = new HashSet<Class<?>>();
    additionalTypes.add(CouchbaseDocument.class);
    additionalTypes.add(CouchbaseList.class);
    simpleTypeHolder = new SimpleTypeHolder(additionalTypes, true);
  }
View Full Code Here

Examples of org.springframework.data.mapping.model.SimpleTypeHolder

    payload = new HashMap<String, Object>();

    Set<Class<?>> additionalTypes = new HashSet<Class<?>>();
    additionalTypes.add(CouchbaseDocument.class);
    additionalTypes.add(CouchbaseList.class);
    simpleTypeHolder = new SimpleTypeHolder(additionalTypes, true);
  }
View Full Code Here

Examples of org.springframework.data.mapping.model.SimpleTypeHolder

    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(StringToPointConverter.INSTANCE);
    this.converters.add(Point3DToStringConverter.INSTANCE);
    this.converters.add(new SolrjConverters.UpdateToSolrInputDocumentConverter());
View Full Code Here

Examples of org.springframework.data.mapping.model.SimpleTypeHolder

    // given
    TypeInformation typeInformation = ClassTypeInformation.from(EntityWithWrongVersionType.class);
    SimpleElasticsearchPersistentProperty persistentProperty = new SimpleElasticsearchPersistentProperty(
        EntityWithWrongVersionType.class.getDeclaredField("version"), new PropertyDescriptor("version",
        EntityWithWrongVersionType.class), new SimpleElasticsearchPersistentEntity<EntityWithWrongVersionType>(
        typeInformation), new SimpleTypeHolder()
    );

    // when
    new SimpleElasticsearchPersistentEntity(typeInformation).addPersistentProperty(persistentProperty);
  }
View Full Code Here

Examples of org.springframework.data.mapping.model.SimpleTypeHolder

    TypeInformation typeInformation = ClassTypeInformation.from(EntityWithMultipleVersionField.class);
    SimpleElasticsearchPersistentProperty persistentProperty1 = new SimpleElasticsearchPersistentProperty(
        EntityWithMultipleVersionField.class.getDeclaredField("version1"), new PropertyDescriptor("version1",
        EntityWithMultipleVersionField.class),
        new SimpleElasticsearchPersistentEntity<EntityWithMultipleVersionField>(typeInformation),
        new SimpleTypeHolder()
    );

    SimpleElasticsearchPersistentProperty persistentProperty2 = new SimpleElasticsearchPersistentProperty(
        EntityWithMultipleVersionField.class.getDeclaredField("version2"), new PropertyDescriptor("version2",
        EntityWithMultipleVersionField.class),
        new SimpleElasticsearchPersistentEntity<EntityWithMultipleVersionField>(typeInformation),
        new SimpleTypeHolder()
    );

    SimpleElasticsearchPersistentEntity simpleElasticsearchPersistentEntity = new SimpleElasticsearchPersistentEntity(
        typeInformation);
    simpleElasticsearchPersistentEntity.addPersistentProperty(persistentProperty1);
View Full Code Here

Examples of org.springframework.data.mapping.model.SimpleTypeHolder

    }

    Collections.reverse(toRegister);

    this.converters = Collections.unmodifiableList(toRegister);
    this.simpleTypeHolder = new SimpleTypeHolder(customSimpleTypes, MongoSimpleTypes.HOLDER);
  }
View Full Code Here

Examples of org.springframework.data.mapping.model.SimpleTypeHolder

  @Test
  public void usesCustomFieldNamingStrategyByDefault() throws Exception {

    Field field = ReflectionUtils.findField(Person.class, "lastname");

    MongoPersistentProperty property = new BasicMongoPersistentProperty(field, null, entity, new SimpleTypeHolder(),
        UppercaseFieldNamingStrategy.INSTANCE);
    assertThat(property.getFieldName(), is("LASTNAME"));

    field = ReflectionUtils.findField(Person.class, "firstname");

    property = new BasicMongoPersistentProperty(field, null, entity, new SimpleTypeHolder(),
        UppercaseFieldNamingStrategy.INSTANCE);
    assertThat(property.getFieldName(), is("foo"));
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.