SDN v3.0.0 RELEASE Neo4j Community 2.0.1
I'm having a bit of an issue with regards to inheritance and collections.
Perhaps someone could assist with the matter. I basically have the
following structure.
public abstract class Graphic;
public class Shape1 extends Graphic;
public class Shape2 extends Graphic;
public class Shape3 extends Graphic;
public class Overlay {
Set<Graphic> graphics;
}
public interface GraphicsRepository extends GraphRepository<Graphic>{}
I can persist the graphics using the graphic repository and all the various
attributes are stored correctly based on the concrete classes. I can query
and get individual graphics with the correct attributes, and do various
things associate with the classes in the neo4j "portal" environment. But
when i do a retrieve on the overlay i only ever get the base class Graphic
as the class type within the collection and casting does not work. I could
be overlooking something or just not doing something correctly, but figured
i would post and see if there was anything that someone could suggest. I've
searched google and stack overflow and have only ever found similar issues
where it was the main class and never a internal collection of objects.
Also, when i remove abstract from the Graphic class i get the same results.
All items in the Overlay graphics set are of type Graphic losing any
special properties or methods associated with the class. And adding
@TypeAlias does not seem to help.
I've checked the labels in the graph and all nodes have the right labels
prepended with "_". All classes that extend other classes also have the
parent class labels as well. However when accessing the collection within
overlay, the type is always Graphic regardless of whether it's via an
iterator, for each loop etc..
Thanks
--
You received this message because you are subscribed to the Google Groups
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.