Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright 2011 the original author or authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
import  org.springframework.beans.factory.annotation.Configurable;
import  org.springframework.core.convert.ConversionService;

Michael Hunger
    private final Neo4jTemplate template;
        this. = template;
    private ConversionService getConversionService() {
        return .getConversionService();
    public boolean accept(final Neo4jPersistentProperty property) {
        final ConversionService conversionService = getConversionService();
        return property.isSerializablePropertyField(conversionService);
    public FieldAccessor forField(final Neo4jPersistentProperty property) {
        return new ConvertingNodePropertyFieldAccessor(property);
        private final PropertyConverter propertyConverter;
        public ConvertingNodePropertyFieldAccessor(Neo4jPersistentProperty propertyNeo4jTemplate template) {
             = new PropertyConverter(template.getConversionService(),property);
        public Object setValue(final Object entityfinal Object newValMappingPolicy mappingPolicy) {
            Object value = .isObjectOrSupportedType(newValthis.) ? newVal : .serializePropertyValue(newVal);
            return newVal;
        public Object doGetValue(final Object entity) {
            Object ret = super.doGetValue(entity);
            if (.isObjectOrSupportedType(retthis.)) {
                return ret;
            return .deserializePropertyValue(ret);
        protected Object convertSimplePropertyValue(Object value) {
            return value;
New to GrepCode? Check out our FAQ X