• 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
EOModelGroup defaultGroup question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

EOModelGroup defaultGroup question


  • Subject: EOModelGroup defaultGroup question
  • From: Scott Lopatin <email@hidden>
  • Date: Mon, 19 Nov 2007 15:45:47 -0800

Hi!

I have a method like the one below, where I want to send in a model with a different connection dictionary and execute a fetch using the alternate model database. I'm running the below, setting the new default group, then setting it back, however the results always appear to come from the regular default model group, not the new model group I'm setting below. Does anyone see something I'm missing?

Thanks,
Scott


public static NSArray executeSQLForModelWithResults(EOEditingContext ec, String sql, EOModel model) {
// Save defaultGroup
EOModelGroup defaultGroup = EOModelGroup.defaultGroup();
// Create new group
EOModelGroup newGroup = new EOModelGroup();
newGroup.addModel(model);
EOModelGroup.setDefaultGroup(newGroup);

// perform fetch
NSArray results = EOUtilities.rawRowsForSQL(ec, "modelname", sql, null);
// reset group to default
EOModelGroup.setDefaultGroup(defaultGroup);
return results;
}
 _______________________________________________
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:
    • Re: EOModelGroup defaultGroup question
      • From: Chuck Hill <email@hidden>
References: 
 >SQL Server questions (From: Randy Wigginton <email@hidden>)

  • Prev by Date: Re: cross-model relationships problem
  • Next by Date: Re: EOModelGroup defaultGroup question
  • Previous by thread: Re: SQL Server questions
  • Next by thread: Re: EOModelGroup defaultGroup question
  • Index(es):
    • Date
    • Thread