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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T06:49:34+00:00 2026-05-23T06:49:34+00:00

Problem description: I have a POJO object, which is mapped from database. Which having

  • 0

Problem description:

I have a POJO object, which is mapped from database. Which having attributes(column) with same name as in database table. But it required some changes and I will have to use DTOs. But problem is that DTO having attributes with different names as defined in database table,(because of this I am mapping database table to POJO and then POJO to DTO) so at the time of mapping I have to use field and field mapping(One field of POJO and one field of DTO object), and that will take 50 lines of code( database table having 50 columns). Is there any solution to map directly to my POJO with DTO? Or is there a way to map database table to POJO/DTO if database table and POJO/DTO having diffrent column names?

For example

public class EmployeePOJO {

    String EMP_ID;
    String EMP_NAME;
    String EMP_SALERY;
    String EMP_DOB;
    String EMP_CONTACT_NO;
    String EMP_ADDRESS;
    String EMP_BLOOD_GROUP;
    String ASSIGNED_PROJECT;
    String PROJECT_MANAGER;
    String ROLE;

    //Getters and setters
}



public class EmployeeDTO {

    //String EMP_ID;
    //String EMP_NAME;
    String salery;            //EMP_SALERY;
    //String EMP_DOB;
    String phoneNumber;       //EMP_CONTACT_NO;
    String address;           //EMP_ADDRESS;
    //String EMP_BLOOD_GROUP;
    String currentProject;    //ASSIGNED_PROJECT;
    String projectManager;    //PROJECT_MANAGER;
    String role;              //ROLE;

    //getters and setters
}
  • 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-23T06:49:35+00:00Added an answer on May 23, 2026 at 6:49 am

    http://sourceforge.net/projects/dozer/develop ? (not sure it maps your needs,but take a look)
    http://dozer.sourceforge.net/

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

Sidebar

Related Questions

Problem: I have an address field from an Access database which has been converted
Expanding this question on how I learnt to pass from problem description to code
Ok, so here's the full description of the problem I'm having: I am trying
Problem: Given a list of strings, find the substring which, if subtracted from the
Problem Description I have a string S. How can I find if the string
Here is my problem description. I have 2 Objects A and B.A has a
Uhm I'm not sure if anyone has encountered this problem a brief description is
Given the following xml fragment: <Problems> <Problem> <File>file1</File> <Description>desc1</Description> </Problem> <Problem> <File>file1</File> <Description>desc2</Description> </Problem>
Problem: I have two spreadsheets that each serve different purposes but contain one particular
Technology Description: Hibernate annotation- 3.4.0.GA java 1.5 table : users_roles_branches columns : user_id, role_id,

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.