Difference between save_with_all_relation and save_with_rela

Forum for posting problems using QxOrm library

Difference between save_with_all_relation and save_with_rela

Postby alex » Wed Mar 09, 2016 12:55 pm

Hi,

I would like to have some details on these two functions because I'm trying to save some data and it doesn't behave the same way. I have an object with one relation (two tables in database). If I write:

Code: Select all
qx::dao::save_with_all_relation(dao);


the two tables are correctly updated, but if I write

Code: Select all
qx::dao::save_with_relation_recursive(dao);


only the main table is updated. Is there something I missed?
alex
 
Posts: 1
Joined: Wed Mar 09, 2016 11:34 am

Re: Difference between save_with_all_relation and save_with_

Postby qxorm » Wed Mar 09, 2016 4:41 pm

Hello,

- qx::dao::save_with_all_relation : save your instance in database + 1 level of relationships.

- qx::dao::save_with_relation_recursive : this function was developed for a customer who wanted to insert very quickly a complex tree structure (starting from a root instance with several levels of relationships).
The second parameter of this function is qx::dao::save_mode::e_save_mode eSaveMode, with following possible values :
* qx::dao::save_mode::e_check_insert_or_update (default value) ;
* qx::dao::save_mode::e_insert_only (to improve performance if you know that you are just inserting items in database) ;
* qx::dao::save_mode::e_update_only (to improve performance if you know that you are just updating items in database).

only the main table is updated. Is there something I missed ?

This is not normal, maybe a bug in QxOrm library.

Just FYI, maybe you already saw it, there is a section about relationships in QxOrm manual here : http://www.qxorm.com/qxorm_en/manual.html#manual_380
qxorm
Site Admin
 
Posts: 481
Joined: Mon Apr 12, 2010 7:45 am


Return to QxOrm - Help

Who is online

Users browsing this forum: No registered users and 2 guests

cron