This one time, at band camp, Marco Mistroni said:
MM> I have been thinking on how to use castor JDO for my problem. I
MM>have
MM>Been asking same question before, and got answer, but the problem has
MM>changed slightly.
MM>
MM>I m working on existing database where following tables are present
MM>
MM>Menu Group
MM>ID Name
MM>
MM>
MM>Nested_Menu
MM>PARENT_MENU CHILD_MENU
MM>
MM>Menu Items
MM>MENU_ITEM_ID MENU_ITEM_NAME MENU_GROUP
MM>
MM>
MM>THE meaning is the following. I have a set of menu groups (nodes) and
MM>set of
MM>Menu items (leafs).
MM>
MM>The Nested menu table lists relationships between menu group, coz one
MM>menu group can be part of another menu group.
MM>
MM>A Menu Group can have either as a children a Menu Groups or Menu Items
MM>
MM>I have little trouble in figuring out how to write classes to map my
MM>tables
MM>To objects.
MM>
MM>I thought of writing following class
MM>
MM>Public class Menu {
MM> setId()
MM> setName()
MM> setMenuItems()
MM> setChildMenus()
MM> getId()
MM> getName()
MM> getChildMenus()
MM> getMenuItems()
MM>}
MM>
MM>public class MenuItem {
MM> setId()
MM> setName()
MM> getId()
MM> getName()
MM>}
MM>
MM>But I don't know how to write the proper mapping.xml for menu class,
MM>since
MM>For retrieving child menus I have to look at nested_menu table...
MM>
MM>Anyone can help?
Marco,
What you describe is a self-referential relationship. Currently, Castor
JDO does not support self-referential relationships via its mapping
descriptor. But there is a way to work around this using a code only
solution. Please see the following Bugzilla report for a solution on
how to work around this:
http://bugzilla.exolab.org/show_bug.cgi?id=928
Bruce
--
perl -e 'print unpack("u30","<0G)[EMAIL PROTECTED]&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'
The Castor Project
http://www.castor.org/
Apache Geronimo
http://incubator.apache.org/projects/geronimo.html
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev