Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
DataMapper 1.3
-
None
-
Microsoft Windows Server 2003, DotNetFramework 1.1
Description
The pdf documentation, Chapter 3, 3.5.13. Composite Keys or Multiple Complex Parameters Properties, says:
"However, there is an alternate syntax that allows multiple columns to be passed to the related mapped statement. This comes in handy for situations where a composite key relationship exists, or even if you simply want to use a parameter of some name other than #value#. The alternate syntax for the column attribute is simply
{param1=column1, param2=column2, ..., paramN=columnN}."
Instead I found there will be ALWAYS the error: "columnN}" while getting the value from the query; i have downloaded the source and I have identified the point where the error is made: the split of the column does not consider the fact the the } and { are part of the string.
It will work only if we don't use the
{ and } when defining the column property in the sqlmap definition (but in this way, the specification for the column property is not followed). It olny works by not following the specifications .
— column="idlabel=desc_fk,idlanguage=id_language" ----
Source code in "MappedStatement.cs", project "IbatisNet.DataMapper" where I have identified the error:
private void SetObjectProperty(RequestScope request, ResultMap resultMap, ResultProperty mapping, ref object target, IDataReader reader) ,
...............................
if (paramString.IndexOf(',')>0 || paramString.IndexOf('=')>0) // composite parameters key
{
IDictionary keyMap = new Hashtable();
keys = keyMap;
// define which character is seperating fields
char[] splitter =
;
string[] paramTab = paramString.Split(splitter);
if (paramTab.Length % 2 != 0)
IEnumerator enumerator = paramTab.GetEnumerator();
while (!wasNull && enumerator.MoveNext())
}
..................................
Since i am not participating at the project, I cannot modify the source.
Regards.
Cristian Manea
www.atypiqsoftware.ro