- pikotools is in src subdirectory now
- map_fields() -> fields()
- prepare_table() -> table()
- instead of pt::MainSpaceParser we have pt::MainOptionsParser now
FT class has following types:
enum FieldType
{
default_type = 0,
primary_key = 1,
foreign_key = 2,
foreign_key_in_child = 4,
no_insertable = 8,
no_updatable = 16,
no_fetchable = 32, /* not supported yet */
};
an object of FT class are now used in Model::field() methods instead of insertable/updatable/is_primary_key/... boolean flags
changed the semantic of has_foreign_key (which was a bool) flag in child Models:
now on Models and list/vector of Models you should use either FT::foreign_key or FT::foreign_key_in_child
1. FT::foreign_key means that field with this flag is a foreign key and is pointing to the child object
(it was the case when has_foreign_key was equal to true beforehand)
2. FT::foreign_key_in child means that the foreign key is in the child object and is pointing to the parent object
Now we know whether the primary key is defined or not
and we do not allow to make update/remove if the key is not defined.
And when doing insert/update we can put NULL if child models don't have
the primary key set (fields with has_foreign_key set to true).
Now in after_select() we should also set has_primary_key_set flag
or just call get_last_sequence_for_primary_key instead of get_last_sequence.
fixed: added prefix +00 when serializing PT::Date to PostgreSQL (time zone)
(for a column with a time zone there was a wrong value saved)
fixed: a parent key was not set in list of childs (insert statements)
git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1215 e52654a7-88a9-db11-a3e9-0013d4bc506e
an additional field (model_save_mode) is printed
changed: if there is no an object the Cursor returns a Model with DO_NOTHING_ON_SAVE flag now
(DO_INSERT_ON_SAVE was beforehand)
fixed: when reading a result from db: for auto generated select there should be used
get_value_by_field_index() method instead of get_value_by_field_name()
changed: flat string (json) is generated only if a model has DO_INSERT_ON_SAVE
or DO_UPDATE_ON_SAVE or is dump_mode turn on
git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1208 e52654a7-88a9-db11-a3e9-0013d4bc506e
for setting a parent key id in child models,
it is called after after_insert() method
added: SetFieldValueHelper class used for storing primary key values from a parent model
git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1204 e52654a7-88a9-db11-a3e9-0013d4bc506e