Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
05-18-2021 10:52 AM
Is there a way to use findBy..
to retrieve a subset of a graph model based on a relationship property value?
Example: Given nodes A
, B
. A
is related to node B
by R
. R
has a r.type
property. The following model classes exist. A
and B
are @Node
classes and R
is a @RelationshipProperties
class.
Can I complete a List<A> findByType( String Type)
or does the parameter need to be found in the specified model class, A
.
Maybe the only way to accomplish this is using a custom query. Then map all the data to model or DTO classes.
05-19-2021 12:22 AM
Yes, this is possible. You would do this just like any other property based query.
class A {
List<R> relatedThings;
}
You would define a findByRelatedThingsType(String type)
finder method to query for the r.type
property in a Neo4jRepository<A,...>
.
All the sessions of the conference are now available online