Results 1 to 3 of 3

Thread: Neo4J: readAliasFrom throws exception on empty graph

  1. #1
    Join Date
    Dec 2007
    Posts
    27

    Default 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. #2
    Join Date
    May 2012
    Posts
    107

    Default

    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

  3. #3
    Join Date
    Jan 2011
    Location
    Dresden, Germany
    Posts
    525

    Default

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •