This one time, at band camp, Bart Jenkins said:

BJ>  Are you suggesting that I NOT use an N:M mapping and treat the 3 tables
BJ>involved (Category, Product, Category_Prod) separately?

If this was my problem to tackle, I probably wouldn't handle the tables
separately. But I wouldn't prefer changing the data model because of
the persistance mechanism. Here's one idea for a solution to this problem:

    1a) Set up a default value for each column in the bridge table (the
        category_prod table) that Castor won't populate. This would cause
        the column to be populated with a default value if no value was
        specified upon insert. 

    1b) Make use of Castor's callback interface
        (org.exolab.castor.jdo.Persistent), specifically jdoAfterCreate()
        to change those default values to their correct values after the
        Category or the Product object is persisted.

If this solution doesn't suit your situation, maybe it will spawn more
ideas, no?

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

Reply via email to