There is, but it would require regarding some points as endpoints and others as startpoints. I imagine that that's not ideal.
Or maybe.. here's something I haven't tried, but maybe you can tweak it to work. Map Point twice, using entity-name to distinguish them (entity-name="StartPoint"). I don't know what ramifications this would have (would you have to refer to points where you don't care if they're start or end as start?), but it's possible that this would allow you to have two separate sets of points in your path.
And of course, there's the DB-normalizing solution: remove startPointId and endPointId from the Path table, and create a new PathPoints table with three columns, PathID, PointID, PointType (start or end). This would probably be the one I'd go for, as the resulting queries would be much more efficient even than the unioned version of what you're currently aiming for. Added bonus: if you ever need to extend to have an EnRoute point type.. no problem!
_________________ Code tags are your friend. Know them and use them.
|