Hi
Everyday I learn something new - I never new how to get the field from Qclass by its name and PathBuilder can do that. :-) Too bad it does not have a simple constructor based on the actual entity base path, because if you could create it directly from your "boreHole" instance you'd be safe.
The trouble is that string parameter to PathBuilder (that is "boreHole" is not the same like the implicit name of the QWaterBore.waterBore variable (variable from Querydsl perspective, I just call them generally "aliases"). Just print that boreHole instance and it will probably say:
"waterBore". In your query you mix instance named "waterBore" and another one named "boreHole". So you:
- either change first like to: QWaterBore boreHole = new QWaterBore("boreHole")
- or change that string to "boreHole" in the constructor to: boreHole.toString()
- or... both actually! that way you will name the boreHole instance as you want AND you'll safely use the same name in the constructor.
Although I'm not sure how safe is that toString in the future (Timo would know better).
Hope it helps, you helped me with PathBuilder, because until today it still puzzled me how to get Path from Qclass by the property name. One can change the generation, but then you have only that "map-like" interface and not fields and I'd love to have both. There seems to be no way how to get to this using metamodel either (or is there?) and this PathBuilder seems to be rather quite around path - that's why we used reflection on the QClass to get the Field instnace representing the column/attribute.
I don't understand the rest of the question with inner join, but I hope it's not relevant after my point.
Cheers
Virgo