cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Attributes of inherit class are not present in stored procedure output with return type Stream<AbstractClass>

Outline:

I have a stored procedure with the return type Stream<AbstractClass>.
Depending on a boolean parameter input value the return class is either ExtendedFromAbstractClass1 or ExtendedFromAbstractClass2.

Observation:

Only the attributes contained in the AbstractClass are present in the output but none of the ExtendedFromAbstractClass1 or ExtendedFromAbstractClass2 attributes.

Question:

Is there a way that extended class attributes are also contained in the output?

Setup:

  • Neo4j version 3.4.1
  • Neo4j Java Driver 1.6.2 (July 2018)
3 REPLIES 3

Unfortunately the current implementation of the procedures API doesn't look at inherited attributes.

So for now you'd have to copy those into the concrete classed. Sorry for that.

This means that, currently, the only workaround is to implement two separate functions:

  • Stream<ExtendedFromAbstractClass1> first function
  • Stream<ExtendedFromAbstractClass2> second function

instead of being able to use the parameter?

You cannot have parameterized return types for the same procedure anyway.
It has to be a concrete class b/c the output fields are generated for that at load-time not runtime.