You are not logged in.
Pages: 1
Hi,
I am beginning to look at it now and I really liked this very good framework, so I am considering to use it in my project.
But I have some objects that I want to persist in a database whose classes have generic TObjectList<T> properties set in then.
So, would it be possible to use these generic properties with mormot or am I forced to use a simple TObjectList?
Just to show what I mean, look at this little example:
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
TExampleClass = class(TSQLRecord);
TMySQLRecordClass = class(TSQLRecord)
private
FMYObjList: TObjectList<TExampleClass>;
procedure SetMYObjList(const Value: TObjectList<TExampleClass>);
published
property MYObjList : TObjectList<TExampleClass> read FMYObjList write SetMYObjList;
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////
I know mormot have compability with many prior delphi versions, But I think it would be great if we could use a generic like this, it would make it easier to implement on my project;
Last edited by mORMotStudent (2018-01-13 12:00:34)
Offline
Hi,
I am beginning to look at it now and I really liked this very good framework, so I am considering to use it in my project.
But I have some objects that I want to persist in a database whose classes have generic TObjectList<T> properties set in then.
So, would it be possible to use these generic properties with mormot or am I forced to use a simple TObjectList?
Just to show what I mean, look at this little example:
/////////////////////////////////////////////////////////////////////////////////////////////////////////////
TExampleClass = class(TSQLRecord);
TMySQLRecordClass = class(TSQLRecord)
private
FMYObjList: TObjectList<TExampleClass>;
procedure SetMYObjList(const Value: TObjectList<TExampleClass>);published
property MYObjList : TObjectList<TExampleClass> read FMYObjList write SetMYObjList;
end;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////I know mormot have compability with many prior delphi versions, But I think it would be great if we could use a generic like this, it would make it easier to implement on my project;
mORMot and DDD changed my mind. Now, I have two data models, one for database aggregation with simple types (Arrays and records) and another model for frontend representation and logic (ObjectList, Methods). It's better to separate models than have only one model for logic and aggregation. Correct me Arnaud if I am wrong.
Last edited by turrican (2018-01-15 11:41:31)
Offline
Pages: 1