Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8094887
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:56:21+00:00 2026-06-05T20:56:21+00:00

I am using mybatis to retrieve data from DB, the data returned is containing

  • 0

I am using mybatis to retrieve data from DB, the data returned is containing duplicate entries.

Required result : Column Name , Value

Expected result is : column1 value A
But returned result is : COLUMN1 value A , column1 value A.

Hope able to clarify my doubt.

Can anybody tell me why it is happening?

<select id="getContentMap" resultType="map" parameterType="map">
            select planId,location_qualifier  from disclaimer_disclosure_content where 
            <choose>
                <when test="plan_id != null">
                    plan_id = #{plan_id}
                </when>
                <when test="product_id != null">
                    product_id = #{product_id}
                </when>
                <otherwise>
                    issuer_id = #{issuer_id}
                </otherwise>
            </choose>
             and effective_date >= #{effective_date} 
             and location_qualifier LIKE  CONCAT('%' , #{location_qualifier} , '%') 
        </select>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T20:56:23+00:00Added an answer on June 5, 2026 at 8:56 pm

    The issue you are seeing is a bug in MyBatis 3 up until release 3.0.6: http://code.google.com/p/mybatis/issues/detail?id=303.

    After that release you get the answer I outlined in my other answer (which was done with MyBatis 3.1.1).

    You have four options:

    1. Just ignore it and only grab the uppercase or lowercase entries
    2. Upgrade to at least 3.0.6
    3. Stop using map as resultType and move to a POJO domain object
    4. Use the workaround below:

    workaround for MyBatis < 3.0.6

    Use full uppercase column aliases and they will only show up once (as uppercase) in your map:

    <select id="getContentMap" resultType="map" parameterType="map">
      select plan_id as PLAN_ID, location_qualifier as LOCATION_QUALIFIER from disclaimer_disclosure_content
      where
      <!-- SNIP: is the same as you had -->
    </select>
    

    This results in the output:

    {PLAN_ID=2, LOCATION_QUALIFIER=Bar}
    

    (or something similar depending on exactly how your select looks).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

What is the correct way to define collection implementation using MyBatis. Consider example below.
I am using Oracle/MyBatis and trying to debug a stored procedure with an enormous
Using Java,I have to fetch multiple sets of values from an XML file to
Using Yii, I want to delete all the rows that are not from today.
I am using MyBatis with Spring Integration as described here . I am further
Decided to move one of my project from iBatis to MyBatis and ran into
I need to get the list of columns in a table using mybatis/ibatis in
I want to build an application using Hibernate and MyBatis integrate with Spring. In
Using mercurial, I've run into an odd problem where a line from one committer
Using Android TelephonyManager an application can obtain the state of data activity over the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.