title: Spring Data Neo4j: Converter of object to string works, but object to long is not executed
body: <p>I have a really strange issue with converting from domain objects to those Neo4j can natively store as property value. As a test case I use Joda's DateTime. A object of that type can be converted to a String or Long quite easily.</p>
  
  <p>The conversion from DateTime to String works flawlessly with this code:</p>
  
  <pre><code>public class DateTimeToStringConverter implements Converter&lt;DateTime, String&gt; {
  
    @Override
    public String convert(DateTime source) {
      return source.toDateTimeISO().toString();
    }
  
  }
  </code></pre>
  
  <p>The property shows up in the node:</p>
  
  <pre><code>Node[1] {
    '__type__' = '...', 
    'entityEditedAt' = '2012-12-28T12:32:50.308+01:00', 
    'entityCreatedAt' = '2012-12-28T12:32:50.297+01:00',
    ...
  }
  </code></pre>
  
  <p>However if I like to save the DateTime as Long (useful to sort by time in Cypher), it does not work at all. Here is my converter:</p>
  
  <pre><code>public class DateTimeToLongConverter implements Converter&lt;DateTime, Long&gt; {
  
    @Override
    public Long convert(DateTime source) {
        return source.toDateTimeISO().getMillis();
    }
  
  }
  </code></pre>
  
  <p>The property is not saved on the node. Thus it is missing completely. No exception is thrown. It seems like the conversion code is not called at all. </p>
  
  <p>The converters are hooked to Spring Data using code based configuration:</p>
  
  <pre><code>@Bean
  public ConversionServiceFactoryBean conversionService() {
      Set converters = Sets.newHashSet();
  
      // These work!
      converters.add(new DateTimeToStringConverter());
      converters.add(new StringToDateTimeConverter());
  
      // These don't :-(
      //converters.add(new DateTimeToLongConverter());
      //converters.add(new LongToDateTimeConverter());
  
      ConversionServiceFactoryBean bean = new ConversionServiceFactoryBean();
      bean.setConverters(converters);
      return bean;
  }
  </code></pre>
  
  <p>Any clues? I'm quite lost here, as it should work in my opinion...</p>
  
  <p><strong>Edit</strong>
  I found following text in the <a href="http://static.springsource.org/spring-data/neo4j/docs/2.1.0.RELEASE/reference/html/#d5e825" rel="nofollow">Spring Data Neo4j documentation</a>:</p>
  
  <blockquote>
    <p>All fields convertible to a String using the Spring conversion services will be stored as a string.</p>
  </blockquote>
  
  <p>Does this mean, that only conversions to string are supported? This seems rather limiting.</p>