This one time, at band camp, Barley said:
B>I can't find an example of this scenario, though I
B>imagine it is possible. Say you have a "exam"
B>object/table with these properties/columns:
B>exam_id
B>exam_name
B>
B>....and a "question" object/table with these
B>properties/columns:
B>question_id
B>question_text
B>
B>....and I want to link them in a many-to-many
B>relationship using a third linking table, since exams
B>have multiple questions, and questions may be used on
B>multiple exams. So, I would also want to store the
B>provided answer to the question as an instance variable
B>of the Question object but in the exam_questions
B>linking table, like so:
B>question_id
B>exam_id
B>answer_text
B>
B>So, if answer_text is a property of the Question
B>object, how can I tell Castor to save it in the linking
B>table as illustrated? I'd appreciate any small example,
B>whether based on this or something else, or a point in
B>the right direction if this is discussed elsewhere.
B>(Apologies if this question has been asked). Thanks in
B>advance,
Gregg,
Persisting additional fields in the bridge table is not supported
by Castor. Bridge tables should only be used to link objects that
are part of a many-to-many relationships via the object ids.
In fact, the idea of doing such a thing breaks the object model.
The answer should be a top level object in the object model, i.e.
Answer should be an object that has its own table to which the
Question object holds a reference.
Bruce
--
perl -e 'print unpack("u30","<0G)[EMAIL PROTECTED]&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