Bugs item #504332, was opened at 2002-01-16 11:44
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=402704&aid=504332&group_id=31602
Category: other
Group: cvs
Status: Open
Resolution: None
Priority: 5
Submitted By: Dave Smith (toastkid)
>Assigned to: Nobody/Anonymous (nobody)
Summary: Problem with m:n mapping and Castor
Initial Comment:
The castor:field tag assumes that the field type in
the mapping file is the return type of the method. This
is not the case when collections are used.
e.g. A User belongs to multiple Groups
/**
* @castor:field collection="vector"
* @castor:field-sql name="gid" many-table="usersgroups" many-key="uid"
*/
public Vector getGroups(){
return groups;
}
adds
<field name="groups"
type="java.util.Vector">
collection="vector"
<sql name="gid"
many-key="uid"
many-table="usersgroups"/>
</field>
to mapping.xml.
The type field should actually be the java classname of the
type stored in the Vector, not Vector.
e.g.
<field name="groups"
type="my.package.GroupBean">
collection="vector"
<sql name="gid"
many-key="uid"
many-table="usersgroups"/>
</field>
I would suggest extending castor:field to accept a type
e.g.
@castor:field collection="vector" type="my.package.GroupBean"
----------------------------------------------------------------------
You can respond by visiting:
http://sourceforge.net/tracker/?func=detail&atid=402704&aid=504332&group_id=31602
_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel