How to map query result

There is no replacement for the QueryResult in combination with repositories. Those repositories work strictly by the rules of the modeled domain classes.
For your use-case, you could for example do following:

public class DeviceNode {
// id etc.
  @Relationship("CUSTOMER")
  private List<DeviceNode> relatedNodes;
}

and a query like

MATCH (a:DeviceNode)-[r:CUSTOMER*]->(b:DeviceNode)
where b.deviceId={deviceId}
return a, collect(r), collect(b)

This will create a mapped chain of DeviceNodes which seems like an even better representation of the graph in the application.

If you strictly want to stick with a looks-like-QueryResult, more information can be found here: