I am trying to walk a case class type hierarchy at runtime to find if certain fields exist or not -- basically I'm writing a simple query of fields in the type hierarchy. I would prefer not to use reflection given the runtime overhead, but I haven't been able to figure out how to get shapeless to do what I require.
At runtime I start with a dot-separate String query, say "maker.founded". Let's say this query is being executed over these case classes, with Wine as the root type:
case class Maker(address:String, founded:Int)
case class Wine(name:String, maker:Maker)
So the query "maker.founded" should find a field "maker" of type Maker in the Wine class and then a field "founded" of type Int in the Maker class.
However, its not clear to me how I recurse into the next level so that I can enumerate the keys of the queried field dynamically.