• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Duplicated data after fetching on a view
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Duplicated data after fetching on a view


  • Subject: Duplicated data after fetching on a view
  • From: email@hidden
  • Date: Thu, 09 Jun 2011 11:00:48 +0200 (CEST)

Hi All,

I create a view to get all data I want and do a fetch on WO to return specific data. So When I create my fetching code, the sqlExpression is good but return same data several times although it count different data.
I.e : 

Java fetch code:  NSMutableArray<EOQualifier> qualFinal = new NSMutableArray<EOQualifier>();

NSMutableArray<String> qualFi = new NSMutableArray<String>();

qualFi.add("110");

qualFi.add("120");

NSArray DiplOrderings = new NSArray(new Object[]{

EOSortOrdering.sortOrderingWithKey(DilplomeSpec.DIPL_SPEC_C_KEY,EOSortOrdering.CompareAscending),

EOSortOrdering.sortOrderingWithKey(DilplomeSpec.DIPLOME_C_KEY,EOSortOrdering.CompareAscending)});

EOQualifier qualING2 = EOQualifier.qualifierWithQualifierFormat(

"diplomeC = %@", new NSArray<String>("ING2"));

EOQualifier qualING2a = EOQualifier.qualifierWithQualifierFormat(

"diplSpecC <> %@ AND diplSpecC <> %@", new NSArray<String>(qualFi));

qualFinal.add(qualING2);

qualFinal.add(qualING2a);

EOQualifier ingenieux = new EOAndQualifier(qualFinal);

EOQualifier qualMST = EOQualifier.qualifierWithQualifierFormat(

"diplomeC = %@", new NSArray<String>("MST"));

//Liste des spécialité Ingénieur

sessionFr.setIngenieurs(DilplomeSpec.fetchDilplomeSpecs(session().defaultEditingContext(), ingenieux, DiplOrderings));

for (int i=0; i <sessionFr.getIngenieurs().count(); i++){

DilplomeSpec ing = sessionFr.getIngenieurs().objectAtIndex(i);

NSLog.out.appendln(ing.descFr());

}

//Liste des spécialités master

sessionFr.setMasters(DilplomeSpec.fetchDilplomeSpecs(session().defaultEditingContext(), qualMST, DiplOrderings));

for (int i=0; i <sessionFr.getMasters().count(); i++){

DilplomeSpec mst = sessionFr.getMasters().objectAtIndex(i);

NSLog.out.appendln(mst.descFr());

}


Result in Log : 


2327 [WorkerThread0] DEBUG NSLog  -  evaluateExpression: <com.webobjects.jdbcadaptor.OraclePlugIn$OracleExpression: "SELECT t0.DESC_EN, t0.DESC_FR, t0.DIPL_SPEC_C, t0.DIPLOME_C FROM GERRY.V_DIPSPEC_PRDDEF t0 WHERE (t0.DIPLOME_C = ? AND (t0.DIPL_SPEC_C <> ? AND t0.DIPL_SPEC_C <> ?)) ORDER BY t0.DIPL_SPEC_C ASC, t0.DIPLOME_C ASC" withBindings: 1:"ING2"(diplomeC), 2:"110"(diplSpecC), 3:"120"(diplSpecC)>

2460 [WorkerThread0] DEBUG NSLog  - 6 row(s) processed

2461 [WorkerThread0] DEBUG NSLog  -  === Commit Internal Transaction

2480 [WorkerThread0] INFO NSLog  - Systèmes d'Information et de Télécommunications (SIT)

2480 [WorkerThread0] INFO NSLog  - Systèmes d'Information et de Télécommunications (SIT)

2480 [WorkerThread0] INFO NSLog  - Systèmes d'Information et de Télécommunications (SIT)

2480 [WorkerThread0] INFO NSLog  - Systèmes d'Information et de Télécommunications (SIT)

2480 [WorkerThread0] INFO NSLog  - Systèmes d'Information et de Télécommunications (SIT)

2480 [WorkerThread0] INFO NSLog  - Systèmes d'Information et de Télécommunications (SIT)

2480 [WorkerThread0] DEBUG NSLog  -  === Begin Internal Transaction

2480 [WorkerThread0] DEBUG NSLog  -  evaluateExpression: <com.webobjects.jdbcadaptor.OraclePlugIn$OracleExpression: "SELECT t0.DESC_EN, t0.DESC_FR, t0.DIPL_SPEC_C, t0.DIPLOME_C FROM GERRY.V_DIPSPEC_PRDDEF t0 WHERE t0.DIPLOME_C = ? ORDER BY t0.DIPL_SPEC_C ASC, t0.DIPLOME_C ASC" withBindings: 1:"MST"(diplomeC)>

2485 [WorkerThread0] DEBUG NSLog  - 4 row(s) processed

2486 [WorkerThread0] DEBUG NSLog  -  === Commit Internal Transaction

2486 [WorkerThread0] INFO NSLog  - Convention Master (CV MAST)

2486 [WorkerThread0] INFO NSLog  - Convention Master (CV MAST)

2486 [WorkerThread0] INFO NSLog  - Convention Master (CV MAST)

2486 [WorkerThread0] INFO NSLog  - Convention Master (CV MAST)


When I excecute this SQL _expression_ in SqlDeveloper I have this result :

_expression_ 1 : SELECT t0.DESC_EN, t0.DESC_FR, t0.DIPL_SPEC_C, t0.DIPLOME_C FROM GERRY.V_DIPSPEC_PRDDEF t0 WHERE (t0.DIPLOME_C = 'ING2' AND (t0.DIPL_SPEC_C <> '110' AND t0.DIPL_SPEC_C <> '120')) ORDER BY t0.DIPL_SPEC_C ASC, t0.DIPLOME_C ASC;

Result : 
"DESC_EN"                                                                                    "DESC_FR"                                                "DIPL_SPEC_C" "DIPLOME_C"
1-"Information Systems and telecommunications (SIT)" "Systmes d'Information et de TŽlŽcommunications (SIT)" "121" "ING2"
2-"Industrial Systems (SI)" "Systmes Industriels (SI)" "122" "ING2"
3-"Mechanical Systems (SM)" "Systmes MŽcaniques (SM)" "123" "ING2"
4-"Materials Science and Technology (MTE)" "MatŽriaux : Technologie et Economie (MTE)" "124" "ING2"
5-"Informatique et Systmes d'Information (ISI)" "Informatique et Systmes d'Information (ISI)" "125" "ING2"
6-"Systmes, RŽseaux et TŽlŽcommunications (SRT)" "Systmes, RŽseaux et TŽlŽcommunications (SRT)" "126" "ING2"

_expression_ 2 : SELECT t0.DESC_EN, t0.DESC_FR, t0.DIPL_SPEC_C, t0.DIPLOME_C FROM GERRY.V_DIPSPEC_PRDDEF t0 WHERE t0.DIPLOME_C = 'MST' ORDER BY t0.DIPL_SPEC_C ASC, t0.DIPLOME_C ASC;

"DESC_EN" "DESC_FR" "DIPL_SPEC_C" "DIPLOME_C"
1-"Convention Master (CV MAST)" "Convention Master (CV MAST)" "70" "MST"
2-"MŽcanique et Physique (MP)" "MŽcanique et Physique (MP)" "781" "MST"
3-"Sciences et Technologies de l'information et de la communication (STIC)" "Sciences et Technologies de l'information et de la communication (STIC)" "782" "MST"
4-"IngŽnierie et management (IM)" "IngŽnierie et management (IM)" "783" "MST"


My Question is Why WO return the same data and How to fix it?

Thanks for all
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • [RESOLVED] Duplicated data after fetching on a view
      • From: email@hidden
    • Re: Duplicated data after fetching on a view
      • From: Alexis Tual <email@hidden>
  • Prev by Date: Re: Conditionally Opening AjaxModalDialog
  • Next by Date: Re: Duplicated data after fetching on a view
  • Previous by thread: Re: Conditionally Opening AjaxModalDialog
  • Next by thread: Re: Duplicated data after fetching on a view
  • Index(es):
    • Date
    • Thread