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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:26:42+00:00 2026-05-31T15:26:42+00:00

i have a requirement in which i will retrieve all the records from the

  • 0

i have a requirement in which i will retrieve all the records from the DB in a sorted form. These records will be sorted by “EnteredIds” field in DB.I am getting these records perfectly. I am placing these records in Map. So certainly I will have my map like :

<field1, EnteredId1> 
<field4, EnteredId1> 
<field3, EnteredId1> 
<field2, EnteredId1> 
<field6, EnteredId2> 
<field1, EnteredId2> 
<field2, EnteredId2> 

where EnteredId is in sorted form (i.e 1,1,1,1,2,2,2,…).
Now I want another list which will have objects according to the EnteredIds Like

Object1 will contain 4 records having EnteredId = EnteredId1.
Object2 will contain 3 records having EnteredId = EnteredId2.

and so on..
I have tried it using Map but the logic seems to be very much time consuming and very less optimized.

Please help..
Thanks in advance..

  • 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-05-31T15:26:44+00:00Added an answer on May 31, 2026 at 3:26 pm

    Although I still don’t fully understand your question, I’ll try an attempt to answer it.

    I assume you have a map like this:

    field1->id1
    field2->id1
    field3->id1
    field4->id2
    ...
    

    I further assume you want to get it the other way round, i.e.

    id1 -> field1, field2, field3
    id2 -> field4
    ...
    

    This could be achieved by using a Map<Id,List<Field>> or better a MultiMap which Google Guava or Apache Commons Collections provide.

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

Sidebar

Related Questions

I have the requirement to build a asp.net sign up form which will allow
I have an requirement of store and retrieve data from isolated storage file.I will
I have a requirement which will form the diamond dread pattern. But I have
I have requirement like, suppose I have a 'property' table which has 'ListingKey' field
I have a requirement to create a windows form control which has to detect
I have a requirement to add a standard drop-down from which you can select
I have a requirement to put together an application which will generate a web
I have one requirement in which User will have options to select languages for
I have a requirement where i need to display 1000 images which will take
I have requirement like this, Have One NSIMageView and which will be changing frequently

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.