2010-04-19 10 views
11

Come si aggiunge una proprietà recuperata nell'editor modello dati XCode per il valore minimo di un attributo ??Proprietà recuperata nell'editor modello dati XCode per il valore minimo

Il mio modello:

Model http://www.freeimagehosting.net/uploads/b48853070e.png

Item (name, note, storedItem) 
StoredItem (price, item) 
Item 1 ---> N StoredITem (1->N Relationship) 

voglio che la voce ha una proprietà di nome inverosimile MINPRICE e il suo valore è il valore minimo impostato per prezzo nei storedItems.

Esempio:

Item1 (banana, storedItem1 ... storedItem4, 10) 
StoredItem1 (10,item1) 
StoredItem2 (15,item1) 
StoredItem3 (30,item1) 
StoredItem4 (54,item1) 

Cosa mi metto a destinazione ?? StoredItem?

Fetched Property in Data Model Editor http://www.freeimagehosting.net/uploads/2a68de007d.png

E cosa metto in Expression ??

Expression in Data Model Editor http://www.freeimagehosting.net/uploads/766ab9af6f.png

risposta

2

La destinazione è il tipo di entità che si desidera tornare.

Sembra che tu voglia restituire un oggetto StoredItem, poiché questo ha un prezzo.

Quello che penso che si desidera è una proprietà recuperata sul punto chiamato MINPRICE, con questa espressione:

"@min.storedItems.price" 
Problemi correlati