This one time, at band camp, Emre Tuvay said:
ET> Here is the mapping for Profile:
ET> <!-- PROFILE --->
ET> <class name="dataaccess.Profile" identity="id">
ET> <description>Profile</description>
ET> <map-to table="PROFILE_T" xml="right" />
ET> <field name="id" type="string" >
ET> <sql name="id" type="varchar" />
ET> <bind-xml name="id" node="attribute" />
ET> </field>
ET> <field name="name" type="string" >
ET> <sql name="name" type="varchar" />
ET> <bind-xml name="name" node="element" />
ET> </field>
ET> <field name="description" type="string" >
ET> <sql name="description" type="varchar" />
ET> <bind-xml name="description" node="element" />
ET> </field>
ET>
ET> <!-- rights of the profile -->
ET> <field name="right" type="dataaccess.Right" collection="vector">
ET> <sql name="rightid" many-table="PROFILE_RIGHT_T"
many-key="profileid" />
ET> </field>
ET>
ET> <!-- how to do for profileRights , also xsd if possible -->
ET> </class>
ET>
ET> <!-- RIGHT -->
ET> <class name="dataaccess.Right" identity="id">
ET> <description>Right</description>
ET> <map-to table="RIGHT_T" xml="right" />
ET> <field name="id" type="string" >
ET> <sql name="id" type="varchar" />
ET> <bind-xml name="id" node="attribute"/>
ET> </field>
ET> <field name="toolName" type="string" >
ET> <sql name="toolName" type="varchar" />
ET> <bind-xml name="toolName" node="element"/>
ET> </field>
ET> </class>
ET>
ET> <!-- PROFILE RIGHT -->
ET> <class name="dataaccess.ProfileRight" identity="profileid rightid">
ET> <description>ProfileRight</description>
ET> <map-to table="PROFILE_RIGHT_T" xml="ProfileRight" />
ET> <field name="profileid" type="string" >
ET> <sql name="profileid" type="varchar"/>
ET> </field>
ET> <field name="rightid" type="string" >
ET> <sql name="rightid" type="varchar"/>
ET> </field>
ET> <field name="rightType" type="integer" >
ET> <sql name="rightType" type="integer" />
ET> <bind-xml name="rightType" node="element" />
ET> </field>
ET> <field name="minimum" type="integer" >
ET> <sql name="minimum" type="integer" />
ET> <bind-xml name="minimum" node="element" />
ET> </field>
ET> <field name="maximum" type="integer" >
ET> <sql name="maximum" type="integer" />
ET> <bind-xml name="maximum" node="element" />
ET> </field>
ET>
ET> <!--- ?? What to add here , what to add xsd if possible -->
ET> </class>
ET>
ET>
ET>
ET>
ET>Yes, I had already used in "Profile" to access "Right"s of profile, and it
ET>worked well (many-table = "PROFILE_RIGHT_T")
ET>
ET>Since "profile-right" has additional
ET>fields (i.e. RightType, Minimum, Maximum) requiring ProfileRight obj which
ET>maps to "PROFILE_RIGHT_T" table.
ET>Maybe my classification of "PROFILE_RIGHT_T" as an intersection table is not
ET>accurate enough. But I need associate profile object - profileRight
ET>objects , if possible in mapping.xml. How can I do this?
Emre,
Please see the JDO examples in src/examples/jdo and
src/examples/myapp. There is an example many-to-many relationship in
there. Studying this example usually helps people to understand what
needs to be done.
Bruce
--
perl -e 'print unpack("u30","<0G)U8V4\@4VYY9&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev