[baseten-users] Using relationships with binding

Réjean Lamy rejean.lamy at mac.com
Thu Apr 23 02:05:40 EEST 2009


Thanks for the quick feedback Tuukka

Following your recommendations and using the key name  
"public_Employee_department" (instead of the model name "employees"  
relationship) now all binding are ok.
Looking forward for version 1.6.3 with more examples.

Thanks !

Rejean Lamy




Le 09-04-22 à 08:54, Tuukka Norri a écrit :

> Hi!
>
> Réjean Lamy kirjoitti 21.4.2009 kello 15.43:
>> The first problem  was with one-to-many relationship field and NULL  
>> value. I  manually edited the table to allow the relationship field  
>> to accept NULL.
> This is a bug in BaseTen Assistant (http://basetenframework.org/ticket/179 
> ). It should be fixed in SVN trunk but we'd like to do some more  
> tests.
>
>> But now my second problem is about using relationship with binding.
>>
>> Is it correct with BX to use Array Controllers for the  
>> ManagerPopUP, EmployeeList (Department View) and DeptPopUp  
>> (Employee View) ?
> Yes. You'll probably want to use BXSynchronizedArrayControllers,  
> though, since they are able to fetch objects from the database and  
> change their content based on notifications received from the  
> database.
>
>> Is It ok for these controllers  to be in "Entity mode" with  
>> "Automatically Prepare Content ?
> No. BXSynchronizedArrayController shouldn't even expose these  
> options. Instead, it does have an option called “Fetch on Connect”;  
> it does work quite the same way as Automatically Prepare Content,  
> though.
>
>> What is the correct binding for these controllers ?
> They should be bound like in Hillegass's example. The Managed Object  
> Context binding isn't used (and isn't available), but  
> databaseContext outlet needs to be connected.
>
>> What is the correct key path for a relationship ? (trying the Data  
>> Model name and the "other table" name don't work).
> In BaseTen 1.6.2 one could use the target table's name to reference  
> a relationship, if that particular relationship is the only one  
> between the tables. Obviously this won't work in the Department- 
> Employee example. The foreign keys' names can also be used (see  
> sections 2.2.1 and 2.2.2 in the manual), but for BaseTen 1.6.3 we  
> changed this a bit so that both the relationship's and the inverse  
> relationship's name will work as specified in the Xcode data model.
>
> We'll probably add some functionality to list the relationships into  
> BaseTen Assistant. Meanwhile, there is a command-line tool called  
> Introspection in our source repository (see http://basetenframework.org/browser/trunk/Examples/Introspection) 
>  for this purpose.
>
> We'll write some more examples as soon as we're done with version  
> 1.6.3!
> -- 
> Best regards,
> Tuukka Norri
> MK&C
>
> _______________________________________________
> baseten-users mailing list
> baseten-users at lists.basetenframework.org
> http://lists.basetenframework.org/mailman/listinfo/baseten-users




More information about the baseten-users mailing list