title: Spring Data Neo4j 5 node/relationship labels and inheritance
body: <p>I have the following Spring Data Neo4j 5 entity:</p>
  
  <pre><code>@NodeEntity
  public class Value extends Flaggable {
  
      @Index(unique = true)
      private Long id;
  
      private String name;
  
      private String description;
  
      @Index(unique = false)
      private Object value;
  
  }
  </code></pre>
  
  <p>Right now the <code>Value</code> nodes have the following labels:</p>
  
  <pre><code>MATCH(n:Value) RETURN labels(n) LIMITS 1
  
  ["BaseEntity", "Subscribable", "Flaggable", "Likeable", "Value"]
  </code></pre>
  
  <p>In some cases, according to my project requirements I need to extend the <code>Value</code> node with additional properties, like for example <code>weight</code> and <code>size</code>.</p>
  
  <p>I don't want to change the existing <code>Value</code> class and want to introduce a new - inherited one, for example:</p>
  
  <pre><code>@NodeEntity
  public class WeightedValue extends Value{
  
      private Long weight;
  
      private Long size;
  
  }
  </code></pre>
  
  <p>I have a question, will the following query <code>MATCH(n:Value) RETURN n</code> return also the instances of <code>WeightedValue</code> ?</p>
  
  <p>Will it be possible to search <code>WeightedValue</code> nodes(by <code>Value</code> label) by the following query?</p>
  
  <p><code>MATCH(n:Value) WHERE n.size &gt; 1000 RETURN n</code></p>
  
  <p>Will the approach above work for <code>@RelationshipEntity</code> and inheritance? So is it possible to use inheritance for <code>@RelationshipEntity</code> and how to keep the same label(for example <code>HAS_VALUE_ON</code>) for the base and inherited classes, for example:</p>
  
  <pre><code>@RelationshipEntity(type = "HAS_VALUE_ON")
  public class RelationshipValue {
  
      @Id
      @GeneratedValue
      private Long id;
  
      @StartNode
      private Decision decision;
  
      @EndNode
      private Characteristic characteristic;
  
  }
  
  @RelationshipEntity(type = "HAS_VALUE_ON")
  public class WeightedRelationshipValue extends RelationshipValue {
  
      private Long weight;
  
      private Long size; 
  
  }
  </code></pre>