added: field_model() method to Model
git-svn-id: svn://ttmath.org/publicrep/morm/trunk@1103 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
26
src/model.h
26
src/model.h
@@ -156,6 +156,20 @@ protected:
|
||||
|
||||
virtual int get_connector_mode();
|
||||
|
||||
// temporarily workaround
|
||||
// these templates will be removed
|
||||
void fieldb(const wchar_t * db_field_name, const wchar_t * flat_field_name, bool & field_value, bool insertable = true, bool updatable = true, bool is_primary_key = false)
|
||||
{
|
||||
if( model_connector )
|
||||
{
|
||||
model_connector->field(db_field_name, flat_field_name, field_value, insertable, updatable, is_primary_key);
|
||||
}
|
||||
}
|
||||
/////////////////////////////////
|
||||
|
||||
|
||||
|
||||
|
||||
template<typename FieldValue>
|
||||
void field(const wchar_t * field_name, FieldValue & field_value, bool insertable = true, bool updatable = true, bool is_primary_key = false)
|
||||
{
|
||||
@@ -201,6 +215,18 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
template<typename ModelClass>
|
||||
void field_model(const wchar_t * field_name, ModelClass & field_model, bool insertable = true, bool updatable = true, bool is_primary_key = false)
|
||||
{
|
||||
if( model_connector )
|
||||
{
|
||||
// is there a possibility for the childs to be connected to different model connectors?
|
||||
field_model.set_connector(model_connector);
|
||||
model_connector->field_model(field_name, field_model, insertable, updatable, is_primary_key);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<typename FieldValue>
|
||||
void get_last_sequence(const wchar_t * sequence_table_name, FieldValue & field_value)
|
||||
{
|
||||
|
Reference in New Issue
Block a user