This one time, at band camp, Mark Woon said:
MW>If I've a users table and a stocks table in my db, and I've got a User
MW>object with a public Collection getStockList(), what should the mapping
MW>look like? I'm using:
MW>
MW><mapping>
MW> <class name="User" identity="id">
MW> <map-to table="user" />
MW>
MW> <field name="id" type="string">
MW> <sql name="id" type="char" />
MW> </field>
MW>
MW> <field name="stockList" type="string" collection="collection">
MW> <sql name="stock" type="char" many-key="userId" many-table="stocks" />
MW> </field>
MW> </class>
MW></mapping>
MW>
MW>
MW>I would expect that this will create a collection of strings of stocks.
MW> Instead, I'm getting:
MW>
MW>org.exolab.castor.jdo.DatabaseNotFoundException: Nested error:
MW>java.lang.NullPointerException
Mark,
It's difficult to say what the real error might be without seeing
the full trace. Unfortunately, the DatabaseNotFoundException is
thrown for a few unrelated circumstances. (BTW, this is one of many,
many small things I've been meaning to fix for a while.) If you
could send the client code that is throwing the exception and also
the Castor logging output, it might be easier to narrow down.
However, with the above mapping, you've specified one side of a
many-to-many relationship. The many-table attribute is *only* used
for a many-to-many relationship and it denotes the bridge table.
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