All: I have a design question. Let me first describe the problem: I like to store, update, delete, and retrieve a graph where the nodes are colored differently - for e.g. red, blue, yellow, green, black, etc. etc. [A new color could be added in future] The graph will be constructed at runtime. My object node: Node: { p1,p2,p3, Edges[]} Blue_Node extends Node : { p4,p5,p6} Red_Node extends Node: {p7,p8,p9} :::::: And so on...
Where pi = property i and pi != pj for any i and j During the runtime, based on input data stream, I will construct and store: Edge[Node(a) -> Node(b),wi] where wi is a weight value on the Edge[Node(a)->Node(b)] Node(a) could be blue, red, yellow, green ...color Node(b) could be blue, red, yellow, green ...color And also there can co-exist an Edge[Node(a)->Node(b), wj] where wi != wj I am trying to model this data structure in term of 1:n mapping table. Is this possible model with the following way: <collection-descriptor name="allNodesInGroup" element-class-ref="com.acme.graph.Node" orderby="colorId" sort="DESC" > <inverse-foreignkey field-ref="nodeId"/> </collection-descriptor> and can I also use the fault or proxy object ? Or I have to deal this manually using : public void link(Object obj, boolean insert) public void unlink(Object obj) public boolean link(Object obj, String attributeName, boolean insert) public boolean unlink(Object obj, String attributeName) Thanks in advance for your help Regards Ajitesh