Uploaded image for project: 'Spring Data Neo4j'
  1. Spring Data Neo4j
  2. DATAGRAPH-315

Using Getters and Setters for persistence instead of field access


    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.1
    • Fix Version/s: None
    • Component/s: CORE
    • Labels:


      Spring-data-neo4j seems to persist its objects via reflection-based direct field access. This is fine when you use standard data types such as String. However, when using JavaFX properties this fails. It is custom to provide normal bean-style getter/setter access to the property values as well as property-getters for data binding in Java FX UI. I've provided a code sample below to illustrate this.

      Since spring-data-neo4j uses direct field access, it can't persist those StringProperty, as they are not NodeEntities themselves. However, it would be feasible to use the getter and setter types for persistence instead. This is done, for example, in Hibernate, where it is possible to define the Access-Type (either FIELD or PROPERTY).

      I think this would greatly improve spring-data-neo4j's usefulness in complicated wrapper-infested scenarios

      private final StringProperty nameProperty = new SimpleStringProperty();

      public String getName() {
      return nameProperty.get();

      public void setName(String name) {

      public StringProperty nameProperty() {
      return nameProperty;


        There are no comments yet on this issue.


          • Assignee:
            mhunger Michael Hunger
            drenquinox Karl Kröber
            Last updater:
            Trevor Marshall
          • Votes:
            2 Vote for this issue
            3 Start watching this issue


            • Created: