• 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
Re: FW: Model wierdness
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: FW: Model wierdness


  • Subject: Re: FW: Model wierdness
  • From: Stefan Klein <email@hidden>
  • Date: Thu, 27 Mar 2008 10:13:32 +0100

Hi,

is there any flattend attribute in project? In that case you will get 'duplicates' through the toMany relationships.
If not, try spec.setUsesDistinct(true).

To trace in the generated SQL statements, go to Open Run Diolag in Eclipse, select your application and activate NSLog.DebugGroupDatabaseAccess and NSLog.DebugGroupEnterpriseObject. Now you can follow the statement send to the database.

Stefan

Yury Peskin schrieb:

List,

I have a weird model issue.

When I load the database in my application some entities show up double.

For example, I load a projectDisplayGroup and I only want to see projects that are not complete.

In my (oh so appropriately named) viewProjects class constructor, I do the following:

 

Integer status = new Integer(2);

NSMutableArray args = new NSMutableArray();

args.addObject(status);

EOEditingContext ec= session().defaultEditingContext();

EOQualifier qual = EOQualifier.qualifierWithQualifierFormat(“status != %@”, args);

EOFetchSpecification spec = new EOFetchSpecification(“Project”, qual, null);

spec.setRefreshesRefetchedObjects(true);

EODatabaseDataSource ds = (EODatabaseDataSource)projectDisplayGroup.dataSource();

ds.setFetchSpecification(spec);

projectDisplayGroup.fetch();

 

My database does not have any duplicates in it, but my viewProjects page shows a duplicate entries as can be seen by the screen shots I’ve attached.

Anybody have any ideas on what could be causing the problem?

Thank you in advance,

Yury Peskin

 


_______________________________________________ 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
 _______________________________________________
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

References: 
 >FW: Model wierdness (From: "Yury Peskin" <email@hidden>)

  • Prev by Date: Multiple EOModels
  • Next by Date: Fwd: WebObjects 5.4(.1) and https
  • Previous by thread: FW: Model wierdness
  • Next by thread: Multiple EOModels
  • Index(es):
    • Date
    • Thread