All,

I'm using 2.0.9 w/ a dynamic statement (passing in a Map), but it doesn't appear to be building the PreparedStatement completely.

<code>

    public void getUserInfo(UserInfo ui)
        throws SQLException
    {
        Map m = new HashMap();
        m.put("lastName", ui.getLastName() + "%");
        m.put("firstName", ui.getFirstName() + "%");
        m.put("dob", ui.getDob());
        m.put("patientId", ui.getPatientId());

        SqlMapClient sqlMap = getSqlMapClient();
        try
        {
            ui = (UserInfo) sqlMap.queryForObject("getUserInformation", m, ui);
        }
        catch(SQLException sqle)
        {}
        finally
        {
            m = null;
        }
    }

</code>

<sqlmap>

    <select id="getUserInformation" resultMap="UserInformation">
        SELECT ext_patient_id, insured_first_name, insured_last_name, member_ssn, carrier_num, pcs_group_id,
            insured_dob, eff_begin_date, eff_end_date, app_addr1, app_addr2, city, state_code, zip_code,
            order_received_dte, order_sent_dte, order_status, relation_code
        FROM labcard_eligibility
        WHERE relation_code = '00' and carrier_num ^= 'UNIVERSAL'
        <dynamic>
            <isNotEmpty prepend="AND" property="lastName">
                insured_last_name LIKE #lastName#
            </isNotEmpty>
            <isNotEmpty prepend="AND" property="firstName">
                insured_first_name LIKE #firstName#
            </isNotEmpty>
            <isNotEmpty prepend="AND" property="dob">
                insured_dob = #dob#
            </isNotEmpty>
            <isNotEmpty prepend="AND" property="patientID">
                (ext_patient_id = $patientId$ or member_ssn = $patientId$)
            </isNotEmpty>
        </dynamic>

    </select>
</sqlmap>

<log4j output>

DEBUG 05/20/2005:11:33:14 - Created connection 5872987.
DEBUG 05/20/2005:11:33:14 - {pstm-100001} PreparedStatement:    SELECT ext_patient_id, insured_first_name, insured_last_name, member_ssn, carrier_num, pcs_group_id,     insured_dob, eff_begin_date, eff_end_date, app_addr1, app_addr2, city, state_code, zip_code,     order_received_dte, order_sent_dte, order_status, relation_code    FROM labcard_eligibility   WHERE relation_code = '00' and carrier_num ^= 'UNIVERSAL'       AND     insured_last_name LIKE ?        AND     insured_first_name LIKE ?                 
DEBUG 05/20/2005:11:33:14 - {pstm-100001} Parameters: [REYNOLDS%, RICHARD%]
DEBUG 05/20/2005:11:33:14 - {pstm-100001} Types: [java.lang.String, java.lang.String]
DEBUG 05/20/2005:11:33:15 - Returned connection 5872987 to pool.

</log4j output>

>From the DEBUG trace, it looks like it's only substituting the lastName and firstName attributes.  I've stopped the code and inspected the Map, and the other data elements (dob and patientID) are in the Map.  Is this a bug in 2.0.9?  or have I screwed something up?

Thanks!

Jerry

Reply via email to