you might be interested in seeing the EZPDO project (http://www.ezpdo.net) and especially this post (http://www.ezpdo.net/forum/viewtopic.php?id=20) which talks about exactly the problem you try to solve.
[Excerpt from the post]
The class hierarchy looks like this.
Graphic -+- Point
This is a simple example of the Composite design pattern. Each Graphic object can have
a parent Graphic object and a set of child Graphic objects. EZPDO can persist all the
composition relationships and you will find it is fairly easy to do with EZPDO.