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 8891381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T22:43:43+00:00 2026-06-14T22:43:43+00:00

I am trying to map create a result map that will populate vehicleVO. I

  • 0

I am trying to map create a result map that will populate vehicleVO. I want to map few columns to vehicleDocuments HashMap. I am having the data to be populated also present in the same table.

public class VehicleVO implements Serializable {
    public String vehicleId;
    public String vehicleNumber;
    public String model;
    public Map<String, Date> vehicleDocuments;
    public TransportVO transport;
    public String distanceTraveled;

}

I am trying to use the following xml for mapping. But it don’t seem to work. I a gettign this error

“The content of element type “resultMap” must match
“(constructor?,id*,result*,association*,collection*,discriminator?)”.

<resultMap id="BaseResultMap" type="com.svms.service.vo.VehicleVO">
        <id column="vehicle_id" jdbcType="BIGINT" property="vehicleId" />
        <result column="vehicle_no" jdbcType="VARCHAR" property="vehicleNumber" />
        <result column="Model" jdbcType="VARCHAR" property="model" />
        <association property="vehicleDocuments" javaType="java.util.HashMap">
            <result column="FC" jdbcType="DATE" property="FC_TD" />
            <result column="TAX" jdbcType="DATE" property="TAX_TD" />
            <result column="Insureance" jdbcType="DATE" property="INSURANCE_TD" />
            <result column="Form47" jdbcType="DATE" property="FORM47_TD" />
            <result column="NC" jdbcType="DATE" property="NC_TD" />
        </association>
        <result column="total_distance" jdbcType="INTEGER" property="distanceTraveled" />
        <result column="transport_id" jdbcType="BIGINT" property="transportId" />
</resultMap>

If my understanding is correct, Trying to map to an hashMap can also be considered as association mapping. But this is a one to one mapping only. I also tried using the <collection> tag for mapping. Still I get the same error.

  • 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-14T22:43:44+00:00Added an answer on June 14, 2026 at 10:43 pm

    You’ll need to implement a ResultHandler to build a Hashmap unfortunately.

    Also, the DTD error you mention is because the result elements must be before the association elements.

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

Sidebar

Related Questions

I'm trying to create an xsd schema that will validate a map with an
I am trying to create a wpf control that will display a map image
I'm trying to create a mutable Map with a default that creates a new
I'm trying to create a custom javascript class that inherits from google.maps.Map (V3 API).
I'm trying (as a self-learning exercise) to create a Clojure macro that will generate
I'm trying to create a form using textarea and a submit button that will
I'm trying to create a map of function names and function pointers using __stdcall.
I'm trying to create a map, where the key is an int , and
I am trying to create an interactive map where users can click on different
I'm trying to create an inverted index in a map from a map .At

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.