Closed GoogleCodeExporter closed 9 years ago
Sorry it took me so long to get to look at this, especially given this result...
You're not going to believe this, but it was a simple error.
Anyway, here it is.
You have this mapping:
@Result(property="rolesAdopted", javaType=List.class, many=@Many(select="getUserRolesByUserName"))
Which is supposed to call:
List<Role> getUserRolesByUserName(String userName);
However, look at your mapping. Ask: "What gets passed into the userName
parameter?"
There's nothing specified. MyBatis specifies this with the column parameter of
the Result annotation (same as in XML).
@Result(property="rolesAdopted", javaType=List.class, column="username" many=@Many(select="getUserRolesByUserName"))
It's not a bug in the @Many functionality so to speak, but perhaps just really
uninformative. I'll have to look into decide if there should have been a
better warning. (It seems like it on the surface, but it might be that it's
defaulting for the parameter).
Subject changed to match.
Original comment by clinton....@gmail.com
on 5 Sep 2010 at 2:27
Original comment by eduardo.macarron
on 5 Feb 2012 at 1:54
Original comment by eduardo.macarron
on 5 Feb 2012 at 1:55
Seems to be the same case as #4. Please test this with latest snapshot.
Original comment by eduardo.macarron
on 6 Feb 2012 at 11:19
Original issue reported on code.google.com by
jim.d.ba...@gmail.com
on 31 Aug 2010 at 5:49Attachments: