import_from_model


Description:

public bool import_from_model (DataModel from, bool overwrite, HashTable<int,int>? cols_trans) throws Error

Copy the contents of the from data model to the this data model.

The copy stops as soon as an error orrurs.

The cols_trans is a hash table for which keys are this columns numbers and the values are the corresponding column numbers in the from data model. To set the values of a column in this to NULL, create an entry in the hash table with a negative value. For example:

GHashTable *hash;
gint *ptr;
hash = g_hash_table_new_full (g_int_hash, g_int_equal, g_free, NULL);
ptr = g_new (gint, 1);
*ptr = 2;
g_hash_table_insert (hash, ptr, GINT_TO_POINTER (3));
gda_data_model_import_from_model (...);
g_hash_table_free (hash);

Upon errors FALSE will be returned and error will be assigned a Error from the DataModelError domain.

Parameters:

this

the destination DataModel

from

the source DataModel

overwrite

TRUE if this is completely overwritten by from's data, and FALSE if from's data is appended to this

cols_trans

a GenericSet for columns translating, or null

Returns:

TRUE if no error occurred.