I would like to pass an array of String or a class that has an property
that is an array of String or Bean into the SqlMap query statement
as a parameter class. How can I reprsent it ?

Suppose the class is

public class Criteria {
private String[] a;
private List b; // which contains list of StringBean[]

....................................
}

public class DummyBean {
private StringBean[] c;
}

public class StringBean {
private String d;
}

and the sqlmap definition is:

<statement id="getEhsInspectorsAND" parameterClass="criteria"
resultMap="getEhsInspectorsMapAND">

SELECT
EHS_ID as id,
EHS_DUMMY as dummy
FROM ehs_table
WHERE EHS_ID = #a[0]# AND EHS_DUMMY=#b[1].c.d#
ORDER BY id

</statement>

Can I write the SqlMap in this way ? or What should I do ?

If I just pass in the String[], what can I do ?

String[] f;

<statement id="getEhsInspectorsAND" parameterClass="java.lang.String[]"
resultMap="getEhsInspectorsMapAND">

SELECT
EHS_ID as id,
FROM ehs_table
WHERE EHS_ID = #value[0]#
ORDER BY id

</statement>


Thanks,


John Chien



begin:vcard
fn:John Chien
n:Chien;John
email;internet:[EMAIL PROTECTED]
tel;work:919-715-2510
version:2.1
end:vcard

Reply via email to