[WIKI] Valentina vs Core Data

Ruslan Zasukhin sunshine at public.kherson.ua
Sat Oct 14 18:18:32 CDT 2006


On 10/14/06 5:48 PM, "Diederik Hoogenboom" <mailings at obviousmatter.com>
wrote:

This is from Cocoa list:

> Code I've tried so far:
> 
> NSEntityDescription *entityDescription = [NSEntityDescription
> entityForName:@"Car" inManagedObjectContext:context];

> NSFetchRequest *request = [[[NSFetchRequest alloc] init] autorelease];
> [request setEntity:entityDescription];

> NSPredicate *predicate = [NSPredicate predicateWithFormat:[NSString
> stringWithFormat:@"ANY wheels.color like '*black*'] ];

> [request setPredicate:predicate];

> NSArray *array = [context executeFetchRequest:request error:nil];

RZ:

Can somebody explain WHERE and HOW above multi-line, multi-object,
multi-step code-dancing wins, for example, Valentina API:

autos = db.SqlSelect(
       "SELECT Autos.* FROM Autos, wheel WHERE color like '_black_'");

----------
Also in Valentina can be done as:

autos = db.SqlSelect(
       "SELECT Autos.* FROM Autos WHERE wheels->color like '_black_'");


----------
Also via API:

   s1 = tblWheel.fldColor.FindLike( "_black_" )
   s2 = tblWheel.FindLinked( tblAutos, linkWheels, s1 )

s2 is result set with all cars that have BLACK wheels.
Or in more short form:

   s2 = tblWheel.FindLinked(
            tblAutos, linkWheels, tblWheel.fldColor.FindLike("_black_")


-- 
Best regards,

Ruslan Zasukhin
VP Engineering and New Technology
Paradigma Software, Inc

Valentina - Joining Worlds of Information
http://www.paradigmasoft.com

[I feel the need: the need for speed]




More information about the Valentina mailing list