Issues on object index in master data

1) The index property of the index of an object automatically creates the index of this property when entering data and you do not need to enter an index

2) If the record is deleted from the middle, for example, with index number 3, then the new indexes will be 0 1 2 4 5 6 .. or it will be updated to 0 1 2 3 4 5 ... ??

3) How to delete a single entry for say .. row ID 3 ??

4) How to edit an existing entry with any ID?

thnx in advance; )

+2
source share
2 answers

1) Indexing is processed using Core Data. You are not doing anything about it.

2) I donโ€™t know, it doesnโ€™t matter, because Core Data processes it.

3) You will not do this. Core Data is not a wrapper for SQl and does not apply to tables and rows. Master data uses objects. When you delete an object, Core Data removes it from storage.

4) You are editing data by editing the properties of a specific managed entity.

Master data is not SQL. Objects are not tables. Objects are not strings. Columns are not attributes. Core Data is an object graph management system that may or may not be stored in an object graph and may or may not use SQL far behind the scenes for this. Trying to think about Core Data in terms of SQL will result in you not fully understanding the underlying data and getting a lot of grief and wasted time.

+4
source

creating an indexed property is a performance parameter. It does not add a sortable index, which you can access from your application. What he does is speed up the search for this property if you are using SQLite repository.

+4
source

Source: https://habr.com/ru/post/911320/


All Articles