Trying to guess it it could be:
<list name="nameofyourfield" table="nameofyoursubtable"
lazy="false">
<key>
<column name="XWL_ID" />
</key>
<index column="XWL_NUMBER"/>
<element column="XWL_VALUE" type="string" />
</list>
XWL_ID -> field that represents the id of your objkect
2011/11/16 Ludovic Dubost <ludovic(a)xwiki.com>
A multi select DB list is stored in a sub table. It
seems you have used a
string to store the value but you can't.
Look at the hbm of XWiki on the way the DBStringListProperty is done
<joined-subclass name="com.xpn.xwiki.objects.DBStringListProperty"
table="xwikilists">
<key>
<column name="XWL_ID" />
<column name="XWL_NAME" />
</key>
<list name="list" table="xwikilistitems"
lazy="false">
<key>
<column name="XWL_ID" />
<column name="XWL_NAME" />
</key>
<index column="XWL_NUMBER"/>
<element column="XWL_VALUE" type="string" />
</list>
</joined-subclass>
Now I'm not sure exactly how to do it. I've never tried it. If you make it
work please tell us.
2011/11/16 Edo Beutler <ebeutler(a)synventis.com>
Hi
Today I tried to create a custom mapping for a class. One field of the
class is a DBList with the "Multiple Select" option activated. To save
the values to the DB I wanted to use a string field like I'm used to
with static lists and non multi select DB lists. Now I get the
following exception when trying to save a Document with an object
attached: "java.util.ArrayList cannot be cast to java.lang.String"
How could I custom map a DBList field if String ist not possible? or
is there even a simple Solution I missed?
A hint in the right direction would be appreciated
Edo
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs
--
Ludovic Dubost
Founder and CEO
Blog:
http://blog.ludovic.org/
XWiki:
http://www.xwiki.com
Skype: ldubost GTalk: ldubost
--
Ludovic Dubost
Founder and CEO
Blog:
http://blog.ludovic.org/
XWiki:
http://www.xwiki.com
Skype: ldubost GTalk: ldubost