Announcement Announcement Module
Collapse
No announcement yet.
Neo4J: readAliasFrom throws exception on empty graph Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Neo4J: readAliasFrom throws exception on empty graph

    Code:
    org.springframework.data.neo4j.support.typerepresentation.AbstractIndexingTypeRepresentationStrategy
    
        @Override
        public Object readAliasFrom(S propertyContainer) {
            if (propertyContainer == null)
                throw new IllegalArgumentException("Relationship or Node is null");
            return propertyContainer.getProperty(TYPE_PROPERTY_NAME);
        }
    On an empty graph:
    while the query works in Console
    Code:
    start n=node(*) return n;
    ==> +-----------+
    ==> | n         |
    ==> +-----------+
    ==> | Node[0]{} |
    ==> +-----------+
    The same query executed thru Cypher with
    Code:
    @Query("start n=node(*) return n")
    doesn't catch the exception thrown by org.neo4j.rest.graphdb.entity.RestEntity.getProper ty while querying from the __type__ property that doesn't exist in an empty graph.

  • #2
    JeitEmgie,

    That seems like a valid issue - can I get you to write that up in a ticket over here: https://jira.springsource.org/browse/DATAGRAPH

    Thanks,

    Lasse

    Comment


    • #3
      Actually the method should return null, if there is no TYPE_PROPERTY_NAME property on a certain node or rel.

      Comment

      Working...
      X