SDN : Different relationships from a sub-class

I have a Pet class with sub-classes Dog and Cat. Dog and Cat have different relationships to other classes. Is it possible to retrieve these different relationships from the repository class, PetRepository ? I've set it up like below (sample project at https://github.com/aldrinm/sdn-hierarchy),

@Node("Pet")
public abstract class Pet {
	@Id
	@GeneratedValue
	private Long id;

	private String name;

    //...getters, etc.
}

@Node("Cat")
public class Cat extends Pet {

	@Relationship(value = "SLEEP_SPOT", direction = Relationship.Direction.OUTGOING)
	private List<SleepSpot> sleepSpots;

    //...getters, etc.
}

@Node("Dog")
public class Dog extends Pet {

	@Relationship(value = "CHEW_TOY", direction = Relationship.Direction.OUTGOING)
	private List<ChewToy> chewToys;

    //...getters, etc.
}

and the repository,

public interface PetRepository extends Neo4jRepository<Pet, Long> {

	@Query("MATCH (a:Pet) RETURN a")
	List<Pet> findAllPets();
}

I would like findAllPets to hydrate the chewToys and sleepSpots automatically. Currently, it doesn't retrieve any nodes along these sub-class relationships.

What would be the best way to retrieve all the pet details including specific information from it's sub-classes ?

(sample code is https://github.com/aldrinm/sdn-hierarchy)

Thanks

In general this works, but the custom query, you have written, just returns the nodes themselves.
Try to call the built-in findAll() method on the repository.

Ah I see. That does work. Thanks. However, when I put it in another class (with its repository) then it does not. So If I add a new class Family,

@Node("Family")
public class Family {
	@Id
	@GeneratedValue
	private Long id;

	private String name;

	@Relationship(value = "PET", direction = Relationship.Direction.OUTGOING)
	private List<Pet> pets;

	//...getters, etc.
}

public interface FamilyRepository extends Neo4jRepository<Family, Long> {
}

then,

familyRepository.findById(...);

does not hydrate the chewTyos and sleepSpots

Looking through the cypher in the logs, it does seem to query these relationships. But it just doesn't populate it in the returned classes.

Your linked example is private :(
I created my own version from the provided code above: neo4j-issues-examples/discourse-63046 at master · meistermeier/neo4j-issues-examples · GitHub
And the test runs fine.
Did I miss something?

oh, sorry about that - its public now - GitHub - aldrinm/sdn-hierarchy .
I will also take a look at your version.