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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T07:48:28+00:00 2026-06-10T07:48:28+00:00

I want to compare objects from db4o and JSON.I should delete the object in

  • 0

I want to compare objects from db4o and JSON.I should delete the object in db4o if this doesn’t exist in JSON.

I’ve a problem with the if:

if(tratdb4o.getMedication()==tratJson.getMedication()

I Log the two String variables and both are identical but doesn’t enter into the If for change the value of igual.

Somebody knows why?

for (int i=0;it2.hasNext();i++ ) {
    objetoDb4o=it2.next();
    tratdb4o=(Tratam)objetoDb4o;
    for (int j=0;it.hasNext();j++ ) {
        objetoJson = it.next();
        tratJson = (Tratam)objetoJson;
        Log.d(TAG,"Comparing "+tratdb4o.getMedication()+" of db4o  "+ tratJson.getMedication() +" of JSON");

        if(tratdb4o.getMedication()==tratJson.getMedication()
             igual true;
        }

        if (igual==false){
            db4oHelper.db().delete(tratdb4o);
            db4oHelper.listResult();    
        }
        igual=false;
        it=listaendb4o.iterator();
    }
}
  • 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-10T07:48:30+00:00Added an answer on June 10, 2026 at 7:48 am

    instead of

    tratdb4o.getMedication()==tratJson.getMedication()
    

    do

    tratdb4o.getMedication().equals(tratJson.getMedication())
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to compare two objects that are derived from the same base type
I want to add objects from NSArray *small whenever they don´t exist in NSArray
I have a DateTime object I want to compare against an sql datetime field
I want to compare the alpha channel from one image to ~1000 other images.
Is it possible to compare 2 sets of json objects for a difference? What
I want to compare C++ class/structure objects. In C, most of the time, one
I want to create a class that exends Comparator. This comparator will compare two
More specifically I want an interface to compare objects which can be only compared
I want to compare the classes of 2 JavaScript objects. The current call below
Coming from C++, here's my question : I have created objects of this type

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.