• 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: Can I have Editing context managed my objects that returned from raw-row SQL?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can I have Editing context managed my objects that returned from raw-row SQL?


  • Subject: Re: Can I have Editing context managed my objects that returned from raw-row SQL?
  • From: Arturo PĂ©rez <email@hidden>
  • Date: Wed, 19 Feb 2003 21:43:07 -0500

On miircoles, febr 19, 2003, at 20:03 America/Mexico_City, Tom M. wrote:

Hi all,
I used SQL to get my data from database in the form of
raw row (NSDictionary object). Then I create EO
objects from raw rows returned above?
How can I have Editing Context manage my objects, mean
that I can transver relationship..., and use the
benefits of EOF.


A 7 line tutorial given that you have a working EOModel. Assume your model contains an object named
CarModel with a relationship named manufacturer and two attributes named (name, numCylinders). Then


carsWithEightCylinders = EOUtilities.objectsMatchingKeyAndValue(defaultEditingContext,
"CarModel", "numCylinders", new Integer(8));
for (int i = 0; i < carsWithEightCylinders.count(); i++) {
EOGenericRecord eo = (EOGenericRecord)carsWithEightCylinders.objectAtIndex(i);
System.out.println(eoc.valueForKey("manufacturer") + " makes an eight cylinder car named " +
eo.valueForKey("name"));
}


If you actually create a Java class for CarModel with EOModeller then the code above becomes

carsWithEightCylinders = EOUtilities.objectsMatchingKeyAndValue(defaultEditingContext,
"CarModel", "numCylinders", new Integer(8));
for (int i = 0; i < carsWithEightCylinders.count(); i++) {
CarModel car = (CarModel)carsWithEightCylinders.objectAtIndex(i);
System.out.println(car.manufacturer() + " makes an eight cylinder car named " +
car. name());
}


Does that help any?


------- WebObjects in Philadelphia. You want a cheesesteak with that? _______________________________________________ webobjects-dev mailing list | email@hidden Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Can I have Editing context managed my objects that returned from raw-row SQL? (From: Ricardo Strausz <email@hidden>)

  • Prev by Date: Re: Can I have Editing context managed my objects that returned from raw-row SQL?
  • Next by Date: Re: Do any manuals come with WO?
  • Previous by thread: Re: Can I have Editing context managed my objects that returned from raw-row SQL?
  • Next by thread: Re: Can I have Editing context managed my objects that returned from raw-row SQL?
  • Index(es):
    • Date
    • Thread