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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:06:27+00:00 2026-06-05T16:06:27+00:00

Class 1 private void checkDuplicateCustomer(BulkCustomerVO bulkCustomerVO) { PagedDuplicateCustomerVO duplicateCustomerVO = new PagedDuplicateCustomerVO(); duplicateCustomerVO.setCustomer(bulkCustomerVO.getCustomerVO()); duplicateCustomerVO

  • 0

Class 1

private void checkDuplicateCustomer(BulkCustomerVO bulkCustomerVO) {
    PagedDuplicateCustomerVO duplicateCustomerVO = new PagedDuplicateCustomerVO();
    duplicateCustomerVO.setCustomer(bulkCustomerVO.getCustomerVO());
    duplicateCustomerVO = getCustomerBO().getDuplicateCustomerDetails(duplicateCustomerVO);
    if (!MyUtils.isNull(duplicateCustomerVO)) {
        if (duplicateCustomerVO.isValid()) {

             // some operation
            bulkCustomerVO.setErrorDetals(...........)

        }

    }
}

Class 2

public PagedDuplicateCustomerVO getDuplicateCustomerDetails(PagedDuplicateCustomerVO pagedDuplicateCustomer) {
    PagedDuplicateCustomerVO pagedDuplicateCustomerVO = pagedDuplicateCustomer;

        // some operation that changes customerVO reference in pagedDuplicateCustomer

    }
}

In the above scenario, BulkCustomerVO has CustomerVO instance. It is set to PagedDuplicateCustomerVO and passed as argument
to getDuplicateCustomerDetails() method where it is getting changed. Those changes affect my flow in checkDuplicateCustomer method.

What I want to do is create a separate customerVO instance from bulkCustomerVO.getCustomerVO() in checkDuplicateCustomer which is specific for the getDuplicateCustomerDetails so any changes in second class wont affect my flow in class 1.

What I can do it copy all the fields from bulkCustomerVO.getCustomerVO() to new CustomerVO, but VO is huge and I dont want to do that. It will be a unwanted code in my class.

so, How can I approach this scenario?

EDIT- I cannot use clone coz this will lead to a over head of changing my VO’s to implement cloneable

  • 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-05T16:06:30+00:00Added an answer on June 5, 2026 at 4:06 pm

    I have resolved this issue. Bu using clone utiles of SerializationUtils.

    duplicateCustomerVO.setCustomer((CustomerVO) SerializationUtils
                    .clone(bulkCustomerVO.getCustomerVO()));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

class B{ private: void DoSomething(); } class W{ private: class D: public B{ }
public class Ex7 { private int fld; private void meth(int val) { fld =
I'm using android.util.Log class Foo { private void boo() { // This is the
I have a class like this public class foo { private void getThread() {
I have an application that opens another class using intent : private void createRepository(){
I have simplified my code to this internal class Program { private static void
public class Form1 : System.Windows.Forms.Form { private void eachCornerPix (object sender, PaintEventArgs e, out
This is the class I want to implement the onClickListener in: private void updateUserListView(DatabaseHandler
I've got a method in my class only for testing purpose : private void
public class SelfCallingTest { private static int counter; public void SelfCallingMethod(int counter) { Console.WriteLine(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.