Spring Data Neo4j
  1. Spring Data Neo4j
  2. DATAGRAPH-315

Using Getters and Setters for persistence instead of field access

    Details

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

      Description

      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)

      { nameProperty.set(name); }

      public StringProperty nameProperty()

      { return nameProperty; }

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Michael Hunger
            Reporter:
            Karl Kröber
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: